[Bugfix] Do not override content of gradle.properties if it is exist

This commit is contained in:
mdolinin 2022-01-07 20:51:05 -05:00
parent 42faf281e6
commit 75e3dc9887

View file

@ -230,7 +230,10 @@ export class GradleStateCache {
private initializeGradleUserHome(gradleUserHome: string, initScriptsDir: string): void {
const propertiesFile = path.resolve(gradleUserHome, 'gradle.properties')
fs.writeFileSync(propertiesFile, 'org.gradle.daemon=false')
const requiredProperties = 'org.gradle.daemon=false'
if (!fs.existsSync(propertiesFile) || !fs.readFileSync(propertiesFile).includes(requiredProperties)) {
fs.appendFileSync(propertiesFile, `\n${requiredProperties}`)
}
const buildScanCapture = path.resolve(initScriptsDir, 'build-scan-capture.init.gradle')
fs.writeFileSync(