Skip to content

Update Gradle wrapper to 8.14 #126519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 6, 2025
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet;
import org.gradle.internal.Factory;
import org.gradle.api.tasks.util.internal.PatternSetFactory;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -65,14 +64,14 @@ public class CopyRestApiTask extends DefaultTask {
@Inject
public CopyRestApiTask(
ProjectLayout projectLayout,
Factory<PatternSet> patternSetFactory,
PatternSetFactory patternSetFactory,
FileSystemOperations fileSystemOperations,
ObjectFactory objectFactory
) {
this.include = objectFactory.listProperty(String.class);
this.outputResourceDir = objectFactory.directoryProperty();
this.additionalYamlTestsDir = objectFactory.directoryProperty();
this.patternSet = patternSetFactory.create();
this.patternSet = patternSetFactory.createPatternSet();
this.projectLayout = projectLayout;
this.fileSystemOperations = fileSystemOperations;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet;
import org.gradle.internal.Factory;
import org.gradle.api.tasks.util.internal.PatternSetFactory;

import java.io.File;
import java.util.Map;
Expand Down Expand Up @@ -66,25 +65,25 @@ public abstract class CopyRestTestsTask extends DefaultTask {
private final ProjectLayout projectLayout;
private final FileSystemOperations fileSystemOperations;

@Inject
public abstract FileOperations getFileOperations();

@Inject
public CopyRestTestsTask(
ProjectLayout projectLayout,
Factory<PatternSet> patternSetFactory,
PatternSetFactory patternSetFactory,
FileSystemOperations fileSystemOperations,
ObjectFactory objectFactory
) {
this.includeCore = objectFactory.listProperty(String.class);
this.includeXpack = objectFactory.listProperty(String.class);
this.outputResourceDir = objectFactory.directoryProperty();
this.corePatternSet = patternSetFactory.create();
this.xpackPatternSet = patternSetFactory.create();
this.corePatternSet = patternSetFactory.createPatternSet();
this.xpackPatternSet = patternSetFactory.createPatternSet();
this.projectLayout = projectLayout;
this.fileSystemOperations = fileSystemOperations;
}

@Inject
public abstract FileOperations getFileOperations();

@Input
public ListProperty<String> getIncludeCore() {
return includeCore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet;
import org.gradle.internal.Factory;
import org.gradle.api.tasks.util.internal.PatternSetFactory;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -98,25 +98,23 @@ public abstract class RestCompatTestTransformTask extends DefaultTask {
// PatternFilterable -> list of full test names and reasons. Needed for 1 pattern may include many tests and reasons
private final Map<PatternFilterable, List<Pair<String, String>>> skippedTestByTestNameTransformations = new HashMap<>();

@Inject
protected Factory<PatternSet> getPatternSetFactory() {
throw new UnsupportedOperationException();
}

@Inject
public RestCompatTestTransformTask(FileSystemOperations fileSystemOperations, ObjectFactory objectFactory) {
this.fileSystemOperations = fileSystemOperations;
this.compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1;
this.sourceDirectory = objectFactory.directoryProperty();
this.outputDirectory = objectFactory.directoryProperty();
this.testPatternSet = getPatternSetFactory().create();
this.testPatternSet = getPatternSetFactory().createPatternSet();
this.testPatternSet.include("/*" + "*/*.yml"); // concat these strings to keep build from thinking this is invalid javadoc
// always inject compat headers
headers.put("Content-Type", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
headers.put("Accept", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
getTransformations().add(new InjectHeaders(headers, Sets.newHashSet(RestCompatTestTransformTask::doesNotHaveCatOperation)));
}

@Inject
protected abstract PatternSetFactory getPatternSetFactory();

private static boolean doesNotHaveCatOperation(ObjectNode doNodeValue) {
final Iterator<String> fieldNamesIterator = doNodeValue.fieldNames();
while (fieldNamesIterator.hasNext()) {
Expand Down Expand Up @@ -144,7 +142,7 @@ public void skipTest(String fullTestName, String reason) {
);
}

PatternSet skippedPatternSet = getPatternSetFactory().create();
PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
// create file patterns for all a1/a2/a3/b.yml possibilities.
for (int i = testParts.length - 1; i > 1; i--) {
final String lastPart = testParts[i];
Expand All @@ -158,7 +156,7 @@ public void skipTest(String fullTestName, String reason) {
}

public void skipTestsByFilePattern(String filePattern, String reason) {
PatternSet skippedPatternSet = getPatternSetFactory().create();
PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
skippedPatternSet.include(filePattern);
skippedTestByFilePatternTransformations.put(skippedPatternSet, reason);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.12.1
8.14
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/
package org.elasticsearch.gradle.test;

import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Input;
import org.gradle.process.CommandLineArgumentProvider;

Expand All @@ -20,10 +19,6 @@
public class SystemPropertyCommandLineArgumentProvider implements CommandLineArgumentProvider {
private final Map<String, Object> systemProperties = new LinkedHashMap<>();

public void systemProperty(String key, Provider<Object> value) {
systemProperties.put(key, (Supplier<String>) () -> String.valueOf(value.get()));
}

public void systemProperty(String key, Supplier<String> value) {
systemProperties.put(key, value);
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/build.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ wiremock = "com.github.tomakehurst:wiremock-jre8-standalone:2.23.2"
xmlunit-core = "org.xmlunit:xmlunit-core:2.8.2"

[plugins]
ospackage = { id = "com.netflix.nebula.ospackage-base", version = "11.11.1" }
ospackage = { id = "com.netflix.nebula.ospackage-base", version = "11.11.2" }
6 changes: 3 additions & 3 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,9 @@
<sha256 value="d694edd7bae3bc1a8e0dae2f5a22c479ff04d6b9bfcb0ab751a42f02e02d2100" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.netflix.nebula" name="gradle-ospackage-plugin" version="11.11.1">
<artifact name="gradle-ospackage-plugin-11.11.1.jar">
<sha256 value="34027ac840adb81b80de43082ce335a6518875217a38ac0204d5a84dc669b7ac" origin="Generated by Gradle"/>
<component group="com.netflix.nebula" name="gradle-ospackage-plugin" version="11.11.2">
<artifact name="gradle-ospackage-plugin-11.11.2.jar">
<sha256 value="2cad0d0af05514e07b163d30d71c486ef1a205265ecc4821f8fb9a121f2cabe5" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.netflix.nebula" name="nebula-gradle-interop" version="2.0.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=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""


# Determine the Java command to use to start the JVM.
Expand Down Expand Up @@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

# Stop when "xargs" is not available.
Expand Down
4 changes: 2 additions & 2 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ goto fail
:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
10 changes: 5 additions & 5 deletions modules/reindex/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ if (OS.current() == OS.WINDOWS) {

tasks.named("javaRestTest").configure {
dependsOn fixture
systemProperty "tests.fromOld", "true"
/* Use a closure on the string to delay evaluation until right before we
* run the integration tests so that we can be sure that the file is
* ready. */
nonInputProperties.systemProperty "es${version}.port", fixture.map(f->f.addressAndPort)
systemProperty "tests.fromOld", "true"
/* Use a closure on the string to delay evaluation until right before we
* run the integration tests so that we can be sure that the file is
* ready. */
nonInputProperties.systemProperty "es${version}.port", fixture.map(f->f.addressAndPort)
}
}
}
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=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down