Skip to content

Commit 99fedfd

Browse files
authored
Fix configuration cache compatibility issues (#124073) (#124084)
- for running :plugins:discovery-ec2:check - checking if in idea in build scan background action
1 parent 803d6e7 commit 99fedfd

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ develocity {
133133
}
134134
} else {
135135
tag 'LOCAL'
136-
if (providers.systemProperty('idea.active').present) {
136+
if (System.getProperty('idea.active') == 'true') {
137137
tag 'IDEA'
138138
}
139139
}

plugins/discovery-ec2/build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ esplugin.bundleSpec.from('config/discovery-ec2') {
5151
}
5252

5353
tasks.register("writeTestJavaPolicy") {
54+
boolean inFips = buildParams.inFipsJvm
55+
inputs.property("inFipsJvm", inFips)
56+
final File javaPolicy = new File(layout.buildDirectory.asFile.get(), "tmp/java.policy")
57+
outputs.file(javaPolicy)
5458
doLast {
55-
final File tmp = file("${buildDir}/tmp")
56-
if (tmp.exists() == false && tmp.mkdirs() == false) {
57-
throw new GradleException("failed to create temporary directory [${tmp}]")
58-
}
59-
final File javaPolicy = file("${tmp}/java.policy")
60-
if (buildParams.inFipsJvm) {
59+
if (inFips) {
6160
javaPolicy.write(
6261
[
6362
"grant {",
@@ -100,9 +99,9 @@ tasks.named("test").configure {
10099
// this is needed to manipulate com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property
101100
// it is better rather disable security manager at all with `systemProperty 'tests.security.manager', 'false'`
102101
if (buildParams.inFipsJvm){
103-
nonInputProperties.systemProperty 'java.security.policy', "=file://${buildDir}/tmp/java.policy"
102+
nonInputProperties.systemProperty 'java.security.policy', "=file://${layout.buildDirectory.asFile.get()}/tmp/java.policy"
104103
} else {
105-
nonInputProperties.systemProperty 'java.security.policy', "file://${buildDir}/tmp/java.policy"
104+
nonInputProperties.systemProperty 'java.security.policy', "file://${layout.buildDirectory.asFile.get()}/tmp/java.policy"
106105
}
107106
}
108107

0 commit comments

Comments
 (0)