From 7c57ba1136d1e27519de8e648b9bb3a4b24085ba Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 3 Jan 2024 18:49:57 -0700 Subject: [PATCH] Remove writing value to gradle.properties in setup The written property will override any project-level setting, which can lead to confusing behaviour. Fixes #1024 --- src/cache-base.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/cache-base.ts b/src/cache-base.ts index a4dbc45..d1a4093 100644 --- a/src/cache-base.ts +++ b/src/cache-base.ts @@ -189,21 +189,6 @@ export class GradleStateCache { } private initializeGradleUserHome(gradleUserHome: string, initScriptsDir: string): void { - // Ensure that pre-installed java versions are detected. Only add property if it isn't already defined. - const gradleProperties = path.resolve(gradleUserHome, 'gradle.properties') - const existingGradleProperties = fs.existsSync(gradleProperties) - ? fs.readFileSync(gradleProperties, 'utf8') - : '' - if (!existingGradleProperties.includes('org.gradle.java.installations.fromEnv=')) { - fs.appendFileSync( - gradleProperties, - ` -# Auto-detect pre-installed JDKs -org.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_11_X64,JAVA_HOME_17_X64 -` - ) - } - // Copy init scripts from src/resources const initScriptFilenames = [ 'gradle-build-action.build-result-capture.init.gradle',