Skip to content

Commit cfa98f3

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

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
@@ -46,13 +46,12 @@ esplugin.bundleSpec.from('config/discovery-ec2') {
4646
}
4747

4848
tasks.register("writeTestJavaPolicy") {
49+
boolean inFips = buildParams.inFipsJvm
50+
inputs.property("inFipsJvm", inFips)
51+
final File javaPolicy = new File(layout.buildDirectory.asFile.get(), "tmp/java.policy")
52+
outputs.file(javaPolicy)
4953
doLast {
50-
final File tmp = file("${buildDir}/tmp")
51-
if (tmp.exists() == false && tmp.mkdirs() == false) {
52-
throw new GradleException("failed to create temporary directory [${tmp}]")
53-
}
54-
final File javaPolicy = file("${tmp}/java.policy")
55-
if (buildParams.inFipsJvm) {
54+
if (inFips) {
5655
javaPolicy.write(
5756
[
5857
"grant {",
@@ -95,9 +94,9 @@ tasks.withType(Test).configureEach {
9594
// this is needed to manipulate com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property
9695
// it is better rather disable security manager at all with `systemProperty 'tests.security.manager', 'false'`
9796
if (buildParams.inFipsJvm){
98-
nonInputProperties.systemProperty 'java.security.policy', "=file://${buildDir}/tmp/java.policy"
97+
nonInputProperties.systemProperty 'java.security.policy', "=file://${layout.buildDirectory.asFile.get()}/tmp/java.policy"
9998
} else {
100-
nonInputProperties.systemProperty 'java.security.policy', "file://${buildDir}/tmp/java.policy"
99+
nonInputProperties.systemProperty 'java.security.policy', "file://${layout.buildDirectory.asFile.get()}/tmp/java.policy"
101100
}
102101
}
103102

0 commit comments

Comments
 (0)