Skip to content

Commit 6b7cd03

Browse files
authored
Update Gradle wrapper to 8.12 (#118683) (#119363)
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)
1 parent 6cd4164 commit 6b7cd03

File tree

162 files changed

+4434
-474
lines changed

Some content is hidden

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

162 files changed

+4434
-474
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
@@ -282,7 +282,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
282282
283283
esplugin {
284284
name = 'hello-world-plugin'
285-
classname 'org.acme.HelloWorldPlugin'
285+
classname = 'org.acme.HelloWorldPlugin'
286286
description = "shadowed es plugin"
287287
}
288288
@@ -371,7 +371,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
371371
372372
esplugin {
373373
name = 'hello-world-plugin'
374-
classname 'org.acme.HelloWorldPlugin'
374+
classname = 'org.acme.HelloWorldPlugin'
375375
description = "custom project description"
376376
}
377377

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
@@ -367,24 +367,24 @@ tasks.register("verifyBwcTestsEnabled") {
367367
}
368368

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

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

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
@@ -647,8 +647,8 @@ subprojects {
647647
// in the final log4j2.properties configuration, as it appears in the
648648
// archive distribution.
649649
artifacts.add('log4jConfig', file("${defaultOutputs}/log4j2.properties")) {
650-
type 'file'
651-
name 'log4j2.properties'
650+
type = 'file'
651+
name = 'log4j2.properties'
652652
builtBy 'buildDefaultLog4jConfig'
653653
}
654654

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]'
@@ -585,8 +585,8 @@ subprojects { Project subProject ->
585585
}
586586

587587
artifacts.add('default', file(tarFile)) {
588-
type 'tar'
589-
name artifactName
588+
type = 'tar'
589+
name = artifactName
590590
builtBy exportTaskName
591591
}
592592
}

0 commit comments

Comments
 (0)