Skip to content

Commit 78646d4

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

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
@@ -129,7 +129,7 @@ develocity {
129129
}
130130
} else {
131131
tag 'LOCAL'
132-
if (providers.systemProperty('idea.active').present) {
132+
if (System.getProperty('idea.active') == 'true') {
133133
tag 'IDEA'
134134
}
135135
}

plugins/discovery-ec2/build.gradle

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

5050
tasks.register("writeTestJavaPolicy") {
51+
boolean inFips = buildParams.inFipsJvm
52+
inputs.property("inFipsJvm", inFips)
53+
final File javaPolicy = new File(layout.buildDirectory.asFile.get(), "tmp/java.policy")
54+
outputs.file(javaPolicy)
5155
doLast {
52-
final File tmp = file("${buildDir}/tmp")
53-
if (tmp.exists() == false && tmp.mkdirs() == false) {
54-
throw new GradleException("failed to create temporary directory [${tmp}]")
55-
}
56-
final File javaPolicy = file("${tmp}/java.policy")
57-
if (buildParams.inFipsJvm) {
56+
if (inFips) {
5857
javaPolicy.write(
5958
[
6059
"grant {",
@@ -97,9 +96,9 @@ tasks.withType(Test).configureEach {
9796
// this is needed to manipulate com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property
9897
// it is better rather disable security manager at all with `systemProperty 'tests.security.manager', 'false'`
9998
if (buildParams.inFipsJvm){
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
} else {
102-
nonInputProperties.systemProperty 'java.security.policy', "file://${buildDir}/tmp/java.policy"
101+
nonInputProperties.systemProperty 'java.security.policy', "file://${layout.buildDirectory.asFile.get()}/tmp/java.policy"
103102
}
104103
}
105104

0 commit comments

Comments
 (0)