Skip to content

Commit

Permalink
Remove writing value to gradle.properties in setup
Browse files Browse the repository at this point in the history
The written property will override any project-level setting, which
can lead to confusing behaviour.

Fixes #1024
  • Loading branch information
bigdaz committed Jan 4, 2024
1 parent 32bab5b commit 7c57ba1
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/cache-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 7c57ba1

Please sign in to comment.