Update Gradle wrapper to 8.14 (#126519) (#128070)

* Fix PatternSetFactory incompatibility
* Update ospackage plugin
* Remove ambigious method definitions
* Cleanup verification metadata
* Some cleanup on unused methods and attributes

(cherry picked from commit a2e580fb60)

# Conflicts:
#	build-tools-internal/src/main/resources/minimumGradleVersion
This commit is contained in:
Rene Groeschke 2025-05-14 11:31:44 -07:00 committed by GitHub
parent 3fdbbd61ef
commit 1bc58f68dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 37 additions and 46 deletions

View file

@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612 distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

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

View file

@ -27,8 +27,7 @@ import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.SkipWhenEmpty; import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable; import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet; import org.gradle.api.tasks.util.internal.PatternSetFactory;
import org.gradle.internal.Factory;
import java.io.File; import java.io.File;
import java.util.Map; import java.util.Map;
@ -64,25 +63,25 @@ public abstract class CopyRestTestsTask extends DefaultTask {
private final ProjectLayout projectLayout; private final ProjectLayout projectLayout;
private final FileSystemOperations fileSystemOperations; private final FileSystemOperations fileSystemOperations;
@Inject
public abstract FileOperations getFileOperations();
@Inject @Inject
public CopyRestTestsTask( public CopyRestTestsTask(
ProjectLayout projectLayout, ProjectLayout projectLayout,
Factory<PatternSet> patternSetFactory, PatternSetFactory patternSetFactory,
FileSystemOperations fileSystemOperations, FileSystemOperations fileSystemOperations,
ObjectFactory objectFactory ObjectFactory objectFactory
) { ) {
this.includeCore = objectFactory.listProperty(String.class); this.includeCore = objectFactory.listProperty(String.class);
this.includeXpack = objectFactory.listProperty(String.class); this.includeXpack = objectFactory.listProperty(String.class);
this.outputResourceDir = objectFactory.directoryProperty(); this.outputResourceDir = objectFactory.directoryProperty();
this.corePatternSet = patternSetFactory.create(); this.corePatternSet = patternSetFactory.createPatternSet();
this.xpackPatternSet = patternSetFactory.create(); this.xpackPatternSet = patternSetFactory.createPatternSet();
this.projectLayout = projectLayout; this.projectLayout = projectLayout;
this.fileSystemOperations = fileSystemOperations; this.fileSystemOperations = fileSystemOperations;
} }
@Inject
public abstract FileOperations getFileOperations();
@Input @Input
public ListProperty<String> getIncludeCore() { public ListProperty<String> getIncludeCore() {
return includeCore; return includeCore;

View file

@ -57,7 +57,7 @@ import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable; import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet; 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.File;
import java.io.IOException; import java.io.IOException;
@ -97,18 +97,13 @@ public abstract class RestCompatTestTransformTask extends DefaultTask {
// PatternFilterable -> list of full test names and reasons. Needed for 1 pattern may include many tests and reasons // 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<>(); private final Map<PatternFilterable, List<Pair<String, String>>> skippedTestByTestNameTransformations = new HashMap<>();
@Inject
protected Factory<PatternSet> getPatternSetFactory() {
throw new UnsupportedOperationException();
}
@Inject @Inject
public RestCompatTestTransformTask(FileSystemOperations fileSystemOperations, ObjectFactory objectFactory) { public RestCompatTestTransformTask(FileSystemOperations fileSystemOperations, ObjectFactory objectFactory) {
this.fileSystemOperations = fileSystemOperations; this.fileSystemOperations = fileSystemOperations;
this.compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1; this.compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1;
this.sourceDirectory = objectFactory.directoryProperty(); this.sourceDirectory = objectFactory.directoryProperty();
this.outputDirectory = 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 this.testPatternSet.include("/*" + "*/*.yml"); // concat these strings to keep build from thinking this is invalid javadoc
// always inject compat headers // always inject compat headers
headers.put("Content-Type", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion); headers.put("Content-Type", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
@ -116,6 +111,9 @@ public abstract class RestCompatTestTransformTask extends DefaultTask {
getTransformations().add(new InjectHeaders(headers, Sets.newHashSet(RestCompatTestTransformTask::doesNotHaveCatOperation))); getTransformations().add(new InjectHeaders(headers, Sets.newHashSet(RestCompatTestTransformTask::doesNotHaveCatOperation)));
} }
@Inject
protected abstract PatternSetFactory getPatternSetFactory();
private static boolean doesNotHaveCatOperation(ObjectNode doNodeValue) { private static boolean doesNotHaveCatOperation(ObjectNode doNodeValue) {
final Iterator<String> fieldNamesIterator = doNodeValue.fieldNames(); final Iterator<String> fieldNamesIterator = doNodeValue.fieldNames();
while (fieldNamesIterator.hasNext()) { while (fieldNamesIterator.hasNext()) {
@ -143,7 +141,7 @@ public abstract class RestCompatTestTransformTask extends DefaultTask {
); );
} }
PatternSet skippedPatternSet = getPatternSetFactory().create(); PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
// create file patterns for all a1/a2/a3/b.yml possibilities. // create file patterns for all a1/a2/a3/b.yml possibilities.
for (int i = testParts.length - 1; i > 1; i--) { for (int i = testParts.length - 1; i > 1; i--) {
final String lastPart = testParts[i]; final String lastPart = testParts[i];
@ -157,7 +155,7 @@ public abstract class RestCompatTestTransformTask extends DefaultTask {
} }
public void skipTestsByFilePattern(String filePattern, String reason) { public void skipTestsByFilePattern(String filePattern, String reason) {
PatternSet skippedPatternSet = getPatternSetFactory().create(); PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
skippedPatternSet.include(filePattern); skippedPatternSet.include(filePattern);
skippedTestByFilePatternTransformations.put(skippedPatternSet, reason); skippedTestByFilePatternTransformations.put(skippedPatternSet, reason);
} }

View file

@ -8,7 +8,6 @@
*/ */
package org.elasticsearch.gradle.test; package org.elasticsearch.gradle.test;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Input; import org.gradle.api.tasks.Input;
import org.gradle.process.CommandLineArgumentProvider; import org.gradle.process.CommandLineArgumentProvider;
@ -20,10 +19,6 @@ import java.util.stream.Collectors;
public class SystemPropertyCommandLineArgumentProvider implements CommandLineArgumentProvider { public class SystemPropertyCommandLineArgumentProvider implements CommandLineArgumentProvider {
private final Map<String, Object> systemProperties = new LinkedHashMap<>(); 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) { public void systemProperty(String key, Supplier<String> value) {
systemProperties.put(key, value); systemProperties.put(key, value);
} }

View file

@ -49,4 +49,4 @@ wiremock = "com.github.tomakehurst:wiremock-jre8-standalone:2.23.2"
xmlunit-core = "org.xmlunit:xmlunit-core:2.8.2" xmlunit-core = "org.xmlunit:xmlunit-core:2.8.2"
[plugins] [plugins]
ospackage = { id = "com.netflix.nebula.ospackage-base", version = "11.11.1" } ospackage = { id = "com.netflix.nebula.ospackage-base", version = "11.11.2" }

View file

@ -936,9 +936,9 @@
<sha256 value="d694edd7bae3bc1a8e0dae2f5a22c479ff04d6b9bfcb0ab751a42f02e02d2100" origin="Generated by Gradle"/> <sha256 value="d694edd7bae3bc1a8e0dae2f5a22c479ff04d6b9bfcb0ab751a42f02e02d2100" origin="Generated by Gradle"/>
</artifact> </artifact>
</component> </component>
<component group="com.netflix.nebula" name="gradle-ospackage-plugin" version="11.11.1"> <component group="com.netflix.nebula" name="gradle-ospackage-plugin" version="11.11.2">
<artifact name="gradle-ospackage-plugin-11.11.1.jar"> <artifact name="gradle-ospackage-plugin-11.11.2.jar">
<sha256 value="34027ac840adb81b80de43082ce335a6518875217a38ac0204d5a84dc669b7ac" origin="Generated by Gradle"/> <sha256 value="2cad0d0af05514e07b163d30d71c486ef1a205265ecc4821f8fb9a121f2cabe5" origin="Generated by Gradle"/>
</artifact> </artifact>
</component> </component>
<component group="com.netflix.nebula" name="nebula-gradle-interop" version="2.0.0"> <component group="com.netflix.nebula" name="nebula-gradle-interop" version="2.0.0">

Binary file not shown.

View file

@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612 distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

4
gradlew vendored
View file

@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;; NONSTOP* ) nonstop=true ;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \ -classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@" "$@"
# Stop when "xargs" is not available. # Stop when "xargs" is not available.

4
gradlew.bat vendored
View file

@ -70,11 +70,11 @@ goto fail
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=
@rem Execute Gradle @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 :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell

View file

@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612 distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME