Skip to content

Commit 27faf83

Browse files
breskebycsoulios
andauthored
[8.7] Update Gradle wrapper to 8.1 (#94663) (#95453)
* Update Gradle wrapper to 8.1 (#94663) - Udpate docker compose plugin to use 8.1 compliant version - Fix deprecations of test task configurations * Fix microbenchmarks build (#95385) Fix build error when running microbenchmarks suite --------- Co-authored-by: Christos Soulios <1561376+csoulios@users.noreply.github.com>
1 parent 8e77077 commit 27faf83

File tree

15 files changed

+38
-20
lines changed

15 files changed

+38
-20
lines changed

benchmarks/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ tasks.register("copyPainless", Copy) {
5858

5959
tasks.named("run").configure {
6060
executable = "${BuildParams.runtimeJavaHome}/bin/java"
61-
jvmArgs << "-Dplugins.dir=${buildDir}/plugins" << "-Dtests.index=${buildDir}/index"
61+
args << "-Dplugins.dir=${buildDir}/plugins" << "-Dtests.index=${buildDir}/index"
6262
dependsOn "copyExpression", "copyPainless"
6363
}
6464

build-tools-internal/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ configurations {
231231
}
232232

233233
dependencies {
234-
constraints {
235-
integTestImplementation('org.ow2.asm:asm:9.4')
236-
implementation "org.yaml:snakeyaml:${versions.snakeyaml}"
237-
}
238234
components.all(JacksonAlignmentRule)
239235
constraints {
240236
// ensuring brought asm version brought in by spock is up-to-date
241237
testImplementation buildLibs.asm
242238
integTestImplementation buildLibs.asm
239+
integTestImplementation('org.ow2.asm:asm:9.4')
240+
api("org.yaml:snakeyaml") {
241+
version { strictly(versions.snakeyaml) }
242+
}
243243
}
244244
// Forcefully downgrade the jackson platform as used in production
245245
api enforcedPlatform(buildLibs.jackson.platform)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<verification-metadata xmlns="https://schema.gradle.org/dependency-verification" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://schema.gradle.org/dependency-verification https://schema.gradle.org/dependency-verification/dependency-verification-1.2.xsd">
3+
<configuration>
4+
<verify-metadata>true</verify-metadata>
5+
<verify-signatures>false</verify-signatures>
6+
</configuration>
7+
<components/>
8+
</verification-metadata>
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=47a5bfed9ef814f90f8debcbbb315e8e7c654109acd224595ea39fca95c5d4da
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
3+
distributionSha256Sum=2cbafcd2c47a101cb2165f636b4677fac0b954949c9429c1c988da399defe6a9
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
55
networkTimeout=10000
66
zipStoreBase=GRADLE_USER_HOME
77
zipStorePath=wrapper/dists

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@
3737
import org.gradle.api.artifacts.dsl.DependencyHandler;
3838
import org.gradle.api.artifacts.type.ArtifactTypeDefinition;
3939
import org.gradle.api.plugins.JavaBasePlugin;
40+
import org.gradle.api.plugins.JavaPluginExtension;
4041
import org.gradle.api.provider.Provider;
4142
import org.gradle.api.specs.Specs;
4243
import org.gradle.api.tasks.Copy;
44+
import org.gradle.api.tasks.SourceSet;
4345
import org.gradle.api.tasks.TaskProvider;
4446
import org.gradle.api.tasks.testing.Test;
4547
import org.gradle.initialization.layout.BuildLayout;
@@ -375,6 +377,9 @@ private static TaskProvider<Test> configureTestTask(
375377
t.onlyIf(t3 -> distribution.getArchitecture() == Architecture.current());
376378
t.getOutputs().doNotCacheIf("Build cache is disabled for packaging tests", Specs.satisfyAll());
377379
t.setMaxParallelForks(1);
380+
SourceSet testSourceSet = project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().getByName("test");
381+
t.setClasspath(testSourceSet.getRuntimeClasspath());
382+
t.setTestClassesDirs(testSourceSet.getOutput().getClassesDirs());
378383
t.setWorkingDir(project.getProjectDir());
379384
if (System.getProperty(IN_VM_SYSPROP) == null) {
380385
t.dependsOn(deps);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.0.2
1+
8.1

build-tools/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ gradlePlugin {
6868
// we write this back out below to load it in the Build.java which will be shown in rest main action
6969
// to indicate this being a snapshot build or a release build.
7070
def generateVersionProperties = tasks.register("generateVersionProperties", WriteProperties) {
71-
outputFile = "${buildDir}/version.properties"
71+
destinationFile = new File(buildDir, "version.properties");
7272
comment = 'Generated version properties'
7373
properties(versions)
7474
}

gradle/build.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ bytebuddy = "net.bytebuddy:byte-buddy:1.12.10"
1414
checkstyle = "com.puppycrawl.tools:checkstyle:10.3"
1515
commons-codec = "commons-codec:commons-codec:1.11"
1616
commmons-io = "commons-io:commons-io:2.2"
17-
docker-compose = "com.avast.gradle:gradle-docker-compose-plugin:0.14.13"
17+
docker-compose = "com.avast.gradle:gradle-docker-compose-plugin:0.16.12"
1818
forbiddenApis = "de.thetaphi:forbiddenapis:3.4"
1919
hamcrest = "org.hamcrest:hamcrest:2.1"
2020
httpcore = "org.apache.httpcomponents:httpcore:4.4.12"

gradle/verification-metadata.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@
104104
<sha256 value="515d1afb0cd0176630c0707acabd4a3e48424ea938b89359774f61a24b6450f1" origin="Generated by Gradle"/>
105105
</artifact>
106106
</component>
107-
<component group="com.avast.gradle" name="gradle-docker-compose-plugin" version="0.14.13">
108-
<artifact name="gradle-docker-compose-plugin-0.14.13.jar">
109-
<sha256 value="3a444766b2a7ed012ef73e35f3187aea3e2d589be74ef9ce232190b1f9b25f2d" origin="Generated by Gradle"/>
107+
<component group="com.avast.gradle" name="gradle-docker-compose-plugin" version="0.16.12">
108+
<artifact name="gradle-docker-compose-plugin-0.16.12.jar">
109+
<sha256 value="e7ef50e9a06c177dda788e0b8e7c0509bdfaa22e2455d5a89119ab6de73f7f34" origin="Generated by Gradle"/>
110110
</artifact>
111111
</component>
112112
<component group="com.azure" name="azure-core" version="1.34.0">

gradle/wrapper/gradle-wrapper.jar

468 Bytes
Binary file not shown.
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=47a5bfed9ef814f90f8debcbbb315e8e7c654109acd224595ea39fca95c5d4da
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
3+
distributionSha256Sum=2cbafcd2c47a101cb2165f636b4677fac0b954949c9429c1c988da399defe6a9
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
55
networkTimeout=10000
66
zipStoreBase=GRADLE_USER_HOME
77
zipStorePath=wrapper/dists

gradlew

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
197194
done
198195
fi
199196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
200201
# Collect all arguments for the java command;
201202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202203
# shell script including quotes and variable substitutions, so put them in

modules/repository-s3/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ esplugin.bundleSpec.from('config/repository-s3') {
7878
def testRepositoryCreds = tasks.register("testRepositoryCreds", Test) {
7979
include '**/RepositoryCredentialsTests.class'
8080
systemProperty 'es.allow_insecure_settings', 'true'
81+
classpath = sourceSets.test.runtimeClasspath
82+
testClassesDirs = sourceSets.test.output.classesDirs
8183
}
8284

8385
tasks.named('check').configure {

modules/transport-netty4/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ tasks.named("dependencyLicenses").configure {
6060
TaskProvider<Test> pooledTest = tasks.register("pooledTest", Test) {
6161
include '**/*Tests.class'
6262
systemProperty 'es.use_unpooled_allocator', 'false'
63+
classpath = sourceSets.test.runtimeClasspath
64+
testClassesDirs = sourceSets.test.output.classesDirs
6365
}
6466

6567
TaskProvider<Test> pooledInternalClusterTest = tasks.register("pooledInternalClusterTest", Test) {
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=47a5bfed9ef814f90f8debcbbb315e8e7c654109acd224595ea39fca95c5d4da
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
3+
distributionSha256Sum=2cbafcd2c47a101cb2165f636b4677fac0b954949c9429c1c988da399defe6a9
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
55
networkTimeout=10000
66
zipStoreBase=GRADLE_USER_HOME
77
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)