Skip to content

Commit 4d17b21

Browse files
authored
Update Gradle wrapper to 8.12 (#118683) (#119357)
This updates the gradle wrapper to 8.12 We addressed deprecation warnings due to the update that includes: - Fix change in TestOutputEvent api - Fix deprecation in groovy syntax - Use latest ospackage plugin containing our fix - Remove project usages at execution time - Fix deprecated project references in repository-old-versions (cherry picked from commit ba61f8c) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerCloudElasticsearchDistributionType.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerUbiElasticsearchDistributionType.java # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/Fixture.java # plugins/repository-hdfs/hadoop-client-api/build.gradle # server/src/main/java/org/elasticsearch/inference/ChunkingOptions.java # x-pack/plugin/kql/build.gradle # x-pack/plugin/migrate/build.gradle # x-pack/plugin/security/qa/security-basic/build.gradle
1 parent f75095c commit 4d17b21

File tree

154 files changed

+4411
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+4411
-450
lines changed

build-tools-internal/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=89d4e70e4e84e2d2dfbb63e4daa53e21b25017cc70c37e4eea31ee51fb15098a
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
3+
distributionSha256Sum=7ebdac923867a3cec0098302416d1e3c6c0c729fc4e2e05c10637a8af33a76c5
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
285285
286286
esplugin {
287287
name = 'hello-world-plugin'
288-
classname 'org.acme.HelloWorldPlugin'
288+
classname = 'org.acme.HelloWorldPlugin'
289289
description = "shadowed es plugin"
290290
}
291291
@@ -375,7 +375,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
375375
376376
esplugin {
377377
name = 'hello-world-plugin'
378-
classname 'org.acme.HelloWorldPlugin'
378+
classname = 'org.acme.HelloWorldPlugin'
379379
description = "custom project description"
380380
}
381381

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,13 @@ private static void configureBwcProject(
130130
// We don't use a normal `Copy` task here as snapshotting the entire gradle user home is very expensive. This task is cheap, so
131131
// up-to-date checking doesn't buy us much
132132
project.getTasks().register("setupGradleUserHome", task -> {
133+
File gradleUserHome = project.getGradle().getGradleUserHomeDir();
134+
String projectName = project.getName();
133135
task.doLast(t -> {
134136
fileSystemOperations.copy(copy -> {
135-
String gradleUserHome = project.getGradle().getGradleUserHomeDir().getAbsolutePath();
136-
copy.into(gradleUserHome + "-" + project.getName());
137-
copy.from(gradleUserHome, copySpec -> {
137+
String absoluteGradleUserHomePath = gradleUserHome.getAbsolutePath();
138+
copy.into(absoluteGradleUserHomePath + "-" + projectName);
139+
copy.from(absoluteGradleUserHomePath, copySpec -> {
138140
copySpec.include("gradle.properties");
139141
copySpec.include("init.d/*");
140142
});

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/ErrorReportingTestListener.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ public Destination getDestination() {
172172
return Destination.StdErr;
173173
}
174174

175+
@Override
176+
public long getLogTime() {
177+
return result.getEndTime();
178+
}
179+
175180
@Override
176181
public String getMessage() {
177182
return message;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.11.1
1+
8.12

build-tools/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class TestClustersPluginFuncTest extends AbstractGradleFuncTest {
135135
136136
esplugin {
137137
name = 'test-$pluginType'
138-
classname 'org.acme.TestModule'
138+
classname = 'org.acme.TestModule'
139139
description = "test $pluginType description"
140140
}
141141

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,24 +364,24 @@ tasks.register("verifyBwcTestsEnabled") {
364364
}
365365

366366
tasks.register("branchConsistency") {
367-
description 'Ensures this branch is internally consistent. For example, that versions constants match released versions.'
367+
description = 'Ensures this branch is internally consistent. For example, that versions constants match released versions.'
368368
group 'Verification'
369369
dependsOn ":verifyVersions", ":verifyBwcTestsEnabled"
370370
}
371371

372372
tasks.named("wrapper").configure {
373373
distributionType = 'ALL'
374+
def minimumGradleVersionFile = project.file('build-tools-internal/src/main/resources/minimumGradleVersion')
374375
doLast {
375376
// copy wrapper properties file to build-tools-internal to allow seamless idea integration
376377
def file = new File("build-tools-internal/gradle/wrapper/gradle-wrapper.properties")
377-
Files.copy(wrapper.getPropertiesFile().toPath(), file.toPath(), REPLACE_EXISTING)
378+
Files.copy(getPropertiesFile().toPath(), file.toPath(), REPLACE_EXISTING)
378379
// copy wrapper properties file to plugins/examples to allow seamless idea integration
379380
def examplePluginsWrapperProperties = new File("plugins/examples/gradle/wrapper/gradle-wrapper.properties")
380-
Files.copy(wrapper.getPropertiesFile().toPath(), examplePluginsWrapperProperties.toPath(), REPLACE_EXISTING)
381-
381+
Files.copy(getPropertiesFile().toPath(), examplePluginsWrapperProperties.toPath(), REPLACE_EXISTING)
382382
// Update build-tools to reflect the Gradle upgrade
383383
// TODO: we can remove this once we have tests to make sure older versions work.
384-
project.file('build-tools-internal/src/main/resources/minimumGradleVersion').text = gradleVersion
384+
minimumGradleVersionFile.text = gradleVersion
385385
println "Updated minimum Gradle Version"
386386
}
387387
}

client/client-benchmark-noop-api-plugin/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ group = 'org.elasticsearch.plugin'
1212
apply plugin: 'elasticsearch.internal-es-plugin'
1313

1414
esplugin {
15-
name 'client-benchmark-noop-api'
16-
description 'Stubbed out Elasticsearch actions that can be used for client-side benchmarking'
17-
classname 'org.elasticsearch.plugin.noop.NoopPlugin'
15+
name = 'client-benchmark-noop-api'
16+
description = 'Stubbed out Elasticsearch actions that can be used for client-side benchmarking'
17+
classname ='org.elasticsearch.plugin.noop.NoopPlugin'
1818
}
1919

2020
// Not published so no need to assemble

distribution/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,8 @@ subprojects {
639639
// in the final log4j2.properties configuration, as it appears in the
640640
// archive distribution.
641641
artifacts.add('log4jConfig', file("${defaultOutputs}/log4j2.properties")) {
642-
type 'file'
643-
name 'log4j2.properties'
642+
type = 'file'
643+
name = 'log4j2.properties'
644644
builtBy 'buildDefaultLog4jConfig'
645645
}
646646

distribution/docker/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repositories {
2828
// other Docker variants, the need for the main image to be rebuildable by Docker Hub
2929
// means that the Dockerfile itself has to fetch the binary.
3030
ivy {
31-
url 'https://github.com/'
31+
url = 'https://github.com/'
3232
patternLayout {
3333
artifact '/[organisation]/[module]/releases/download/v[revision]/[module]-[classifier]'
3434
}
@@ -50,7 +50,7 @@ if (useDra == false) {
5050
artifact '/[organisation]/[module]-[revision]-[classifier].[ext]'
5151
}
5252
} else {
53-
url "https://artifacts-snapshot.elastic.co/"
53+
url = "https://artifacts-snapshot.elastic.co/"
5454
patternLayout {
5555
if (VersionProperties.isElasticsearchSnapshot()) {
5656
artifact '/[organization]/[revision]/downloads/[organization]/[module]/[module]-[revision]-[classifier].[ext]'
@@ -570,8 +570,8 @@ subprojects { Project subProject ->
570570
}
571571

572572
artifacts.add('default', file(tarFile)) {
573-
type 'tar'
574-
name artifactName
573+
type = 'tar'
574+
name = artifactName
575575
builtBy exportTaskName
576576
}
577577
}

0 commit comments

Comments
 (0)