Disable incremental compilation in CI environments (#103346)

This commit is contained in:
Mark Vieira 2023-12-12 13:10:27 -08:00 committed by GitHub
parent e2f48f0409
commit a9546a07f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 1 deletions

View file

@ -92,3 +92,7 @@ project.getPlugins().withType(JavaBasePlugin.class) {
}
}
}
tasks.withType(JavaCompile).configureEach {
options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null && System.getProperty("isCI") == null
}

View file

@ -229,6 +229,7 @@ sourceSets {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null && System.getProperty("isCI") == null
}
tasks.named('licenseHeaders').configure {

View file

@ -132,6 +132,7 @@ public class ElasticsearchJavaBasePlugin implements Plugin<Project> {
compileTask.getConventionMapping().map("sourceCompatibility", () -> java.getSourceCompatibility().toString());
compileTask.getConventionMapping().map("targetCompatibility", () -> java.getTargetCompatibility().toString());
compileOptions.getRelease().set(releaseVersionProviderFromCompileTask(project, compileTask));
compileOptions.setIncremental(BuildParams.isCi() == false);
});
// also apply release flag to groovy, which is used in build-tools
project.getTasks().withType(GroovyCompile.class).configureEach(compileTask -> {

View file

@ -124,7 +124,9 @@ public class GlobalBuildInfoPlugin implements Plugin<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));

View file

@ -158,6 +158,10 @@ dependencies {
}
tasks.withType(JavaCompile).configureEach {
options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null && System.getProperty("isCI") == null
}
tasks.named('test').configure {
useJUnitPlatform()
}