From ded2bdccbefeb0983c32084472d001d805dd52b4 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Tue, 12 Dec 2023 12:10:47 -0800 Subject: [PATCH] Add explicit system property for enabling "CI-mode" in build --- build-conventions/build.gradle | 2 +- build-tools-internal/build.gradle | 2 +- .../gradle/internal/info/GlobalBuildInfoPlugin.java | 4 +++- build-tools/build.gradle | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build-conventions/build.gradle b/build-conventions/build.gradle index f694b8695aae5..cd9a548a9901f 100644 --- a/build-conventions/build.gradle +++ b/build-conventions/build.gradle @@ -94,5 +94,5 @@ project.getPlugins().withType(JavaBasePlugin.class) { } tasks.withType(JavaCompile).configureEach { - options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null + options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null && System.getProperty("isCI") == null } diff --git a/build-tools-internal/build.gradle b/build-tools-internal/build.gradle index 0fa970c37f5da..d0c52945801d3 100644 --- a/build-tools-internal/build.gradle +++ b/build-tools-internal/build.gradle @@ -229,7 +229,7 @@ sourceSets { tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' - options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null + options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null && System.getProperty("isCI") == null } tasks.named('licenseHeaders').configure { diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/info/GlobalBuildInfoPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/info/GlobalBuildInfoPlugin.java index 115c4b0694141..5e62790a9d78a 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/info/GlobalBuildInfoPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/info/GlobalBuildInfoPlugin.java @@ -124,7 +124,9 @@ public void apply(Project project) { params.setGitOrigin(gitInfo.getOrigin()); params.setBuildDate(ZonedDateTime.now(ZoneOffset.UTC)); params.setTestSeed(getTestSeed()); - params.setIsCi(System.getenv("JENKINS_URL") != null || System.getenv("BUILDKITE_BUILD_URL") != null); + params.setIsCi( + System.getenv("JENKINS_URL") != null || System.getenv("BUILDKITE_BUILD_URL") != null || System.getProperty("isCI") != null + ); params.setDefaultParallel(ParallelDetector.findDefaultParallel(project)); params.setInFipsJvm(Util.getBooleanProperty("tests.fips.enabled", false)); params.setIsSnapshotBuild(Util.getBooleanProperty("build.snapshot", true)); diff --git a/build-tools/build.gradle b/build-tools/build.gradle index 906b1419f98be..eb5573ac03e0e 100644 --- a/build-tools/build.gradle +++ b/build-tools/build.gradle @@ -159,7 +159,7 @@ dependencies { } tasks.withType(JavaCompile).configureEach { - options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null + options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null && System.getProperty("isCI") == null } tasks.named('test').configure {