Skip to content

Commit

Permalink
[8.7] Update Gradle wrapper to 8.1 (#94663) (#95453)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
breskeby and csoulios authored Apr 21, 2023
1 parent 8e77077 commit 27faf83
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tasks.register("copyPainless", Copy) {

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

Expand Down
8 changes: 4 additions & 4 deletions build-tools-internal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ configurations {
}

dependencies {
constraints {
integTestImplementation('org.ow2.asm:asm:9.4')
implementation "org.yaml:snakeyaml:${versions.snakeyaml}"
}
components.all(JacksonAlignmentRule)
constraints {
// ensuring brought asm version brought in by spock is up-to-date
testImplementation buildLibs.asm
integTestImplementation buildLibs.asm
integTestImplementation('org.ow2.asm:asm:9.4')
api("org.yaml:snakeyaml") {
version { strictly(versions.snakeyaml) }
}
}
// Forcefully downgrade the jackson platform as used in production
api enforcedPlatform(buildLibs.jackson.platform)
Expand Down
8 changes: 8 additions & 0 deletions build-tools-internal/gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<configuration>
<verify-metadata>true</verify-metadata>
<verify-signatures>false</verify-signatures>
</configuration>
<components/>
</verification-metadata>
4 changes: 2 additions & 2 deletions build-tools-internal/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=47a5bfed9ef814f90f8debcbbb315e8e7c654109acd224595ea39fca95c5d4da
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionSha256Sum=2cbafcd2c47a101cb2165f636b4677fac0b954949c9429c1c988da399defe6a9
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
import org.gradle.api.artifacts.dsl.DependencyHandler;
import org.gradle.api.artifacts.type.ArtifactTypeDefinition;
import org.gradle.api.plugins.JavaBasePlugin;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.provider.Provider;
import org.gradle.api.specs.Specs;
import org.gradle.api.tasks.Copy;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.testing.Test;
import org.gradle.initialization.layout.BuildLayout;
Expand Down Expand Up @@ -375,6 +377,9 @@ private static TaskProvider<Test> configureTestTask(
t.onlyIf(t3 -> distribution.getArchitecture() == Architecture.current());
t.getOutputs().doNotCacheIf("Build cache is disabled for packaging tests", Specs.satisfyAll());
t.setMaxParallelForks(1);
SourceSet testSourceSet = project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().getByName("test");
t.setClasspath(testSourceSet.getRuntimeClasspath());
t.setTestClassesDirs(testSourceSet.getOutput().getClassesDirs());
t.setWorkingDir(project.getProjectDir());
if (System.getProperty(IN_VM_SYSPROP) == null) {
t.dependsOn(deps);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.2
8.1
2 changes: 1 addition & 1 deletion build-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ gradlePlugin {
// we write this back out below to load it in the Build.java which will be shown in rest main action
// to indicate this being a snapshot build or a release build.
def generateVersionProperties = tasks.register("generateVersionProperties", WriteProperties) {
outputFile = "${buildDir}/version.properties"
destinationFile = new File(buildDir, "version.properties");
comment = 'Generated version properties'
properties(versions)
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/build.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bytebuddy = "net.bytebuddy:byte-buddy:1.12.10"
checkstyle = "com.puppycrawl.tools:checkstyle:10.3"
commons-codec = "commons-codec:commons-codec:1.11"
commmons-io = "commons-io:commons-io:2.2"
docker-compose = "com.avast.gradle:gradle-docker-compose-plugin:0.14.13"
docker-compose = "com.avast.gradle:gradle-docker-compose-plugin:0.16.12"
forbiddenApis = "de.thetaphi:forbiddenapis:3.4"
hamcrest = "org.hamcrest:hamcrest:2.1"
httpcore = "org.apache.httpcomponents:httpcore:4.4.12"
Expand Down
6 changes: 3 additions & 3 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@
<sha256 value="515d1afb0cd0176630c0707acabd4a3e48424ea938b89359774f61a24b6450f1" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.avast.gradle" name="gradle-docker-compose-plugin" version="0.14.13">
<artifact name="gradle-docker-compose-plugin-0.14.13.jar">
<sha256 value="3a444766b2a7ed012ef73e35f3187aea3e2d589be74ef9ce232190b1f9b25f2d" origin="Generated by Gradle"/>
<component group="com.avast.gradle" name="gradle-docker-compose-plugin" version="0.16.12">
<artifact name="gradle-docker-compose-plugin-0.16.12.jar">
<sha256 value="e7ef50e9a06c177dda788e0b8e7c0509bdfaa22e2455d5a89119ab6de73f7f34" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.azure" name="azure-core" version="1.34.0">
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=47a5bfed9ef814f90f8debcbbb315e8e7c654109acd224595ea39fca95c5d4da
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionSha256Sum=2cbafcd2c47a101cb2165f636b4677fac0b954949c9429c1c988da399defe6a9
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 4 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
2 changes: 2 additions & 0 deletions modules/repository-s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ esplugin.bundleSpec.from('config/repository-s3') {
def testRepositoryCreds = tasks.register("testRepositoryCreds", Test) {
include '**/RepositoryCredentialsTests.class'
systemProperty 'es.allow_insecure_settings', 'true'
classpath = sourceSets.test.runtimeClasspath
testClassesDirs = sourceSets.test.output.classesDirs
}

tasks.named('check').configure {
Expand Down
2 changes: 2 additions & 0 deletions modules/transport-netty4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ tasks.named("dependencyLicenses").configure {
TaskProvider<Test> pooledTest = tasks.register("pooledTest", Test) {
include '**/*Tests.class'
systemProperty 'es.use_unpooled_allocator', 'false'
classpath = sourceSets.test.runtimeClasspath
testClassesDirs = sourceSets.test.output.classesDirs
}

TaskProvider<Test> pooledInternalClusterTest = tasks.register("pooledInternalClusterTest", Test) {
Expand Down
4 changes: 2 additions & 2 deletions plugins/examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=47a5bfed9ef814f90f8debcbbb315e8e7c654109acd224595ea39fca95c5d4da
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionSha256Sum=2cbafcd2c47a101cb2165f636b4677fac0b954949c9429c1c988da399defe6a9
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 27faf83

Please sign in to comment.