Skip to content

Commit a2e580f

Browse files
authored
Update Gradle wrapper to 8.14 (#126519)
* Fix PatternSetFactory incompatibility * Update ospackage plugin * Remove ambigious method definitions * Cleanup verification metadata * Some cleanup on unused methods and attributes
1 parent 9ae7759 commit a2e580f

File tree

14 files changed

+37
-46
lines changed

14 files changed

+37
-46
lines changed

build-tools-internal/gradle/wrapper/gradle-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
3+
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
import org.gradle.api.tasks.SkipWhenEmpty;
2626
import org.gradle.api.tasks.TaskAction;
2727
import org.gradle.api.tasks.util.PatternFilterable;
28-
import org.gradle.api.tasks.util.PatternSet;
29-
import org.gradle.internal.Factory;
28+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
3029

3130
import java.io.File;
3231
import java.io.IOException;
@@ -65,14 +64,14 @@ public class CopyRestApiTask extends DefaultTask {
6564
@Inject
6665
public CopyRestApiTask(
6766
ProjectLayout projectLayout,
68-
Factory<PatternSet> patternSetFactory,
67+
PatternSetFactory patternSetFactory,
6968
FileSystemOperations fileSystemOperations,
7069
ObjectFactory objectFactory
7170
) {
7271
this.include = objectFactory.listProperty(String.class);
7372
this.outputResourceDir = objectFactory.directoryProperty();
7473
this.additionalYamlTestsDir = objectFactory.directoryProperty();
75-
this.patternSet = patternSetFactory.create();
74+
this.patternSet = patternSetFactory.createPatternSet();
7675
this.projectLayout = projectLayout;
7776
this.fileSystemOperations = fileSystemOperations;
7877
}

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

+7-8
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
import org.gradle.api.tasks.SkipWhenEmpty;
3030
import org.gradle.api.tasks.TaskAction;
3131
import org.gradle.api.tasks.util.PatternFilterable;
32-
import org.gradle.api.tasks.util.PatternSet;
33-
import org.gradle.internal.Factory;
32+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
3433

3534
import java.io.File;
3635
import java.util.Map;
@@ -66,25 +65,25 @@ public abstract class CopyRestTestsTask extends DefaultTask {
6665
private final ProjectLayout projectLayout;
6766
private final FileSystemOperations fileSystemOperations;
6867

69-
@Inject
70-
public abstract FileOperations getFileOperations();
71-
7268
@Inject
7369
public CopyRestTestsTask(
7470
ProjectLayout projectLayout,
75-
Factory<PatternSet> patternSetFactory,
71+
PatternSetFactory patternSetFactory,
7672
FileSystemOperations fileSystemOperations,
7773
ObjectFactory objectFactory
7874
) {
7975
this.includeCore = objectFactory.listProperty(String.class);
8076
this.includeXpack = objectFactory.listProperty(String.class);
8177
this.outputResourceDir = objectFactory.directoryProperty();
82-
this.corePatternSet = patternSetFactory.create();
83-
this.xpackPatternSet = patternSetFactory.create();
78+
this.corePatternSet = patternSetFactory.createPatternSet();
79+
this.xpackPatternSet = patternSetFactory.createPatternSet();
8480
this.projectLayout = projectLayout;
8581
this.fileSystemOperations = fileSystemOperations;
8682
}
8783

84+
@Inject
85+
public abstract FileOperations getFileOperations();
86+
8887
@Input
8988
public ListProperty<String> getIncludeCore() {
9089
return includeCore;

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/RestCompatTestTransformTask.java

+7-9
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
import org.gradle.api.tasks.TaskAction;
5959
import org.gradle.api.tasks.util.PatternFilterable;
6060
import org.gradle.api.tasks.util.PatternSet;
61-
import org.gradle.internal.Factory;
61+
import org.gradle.api.tasks.util.internal.PatternSetFactory;
6262

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

101-
@Inject
102-
protected Factory<PatternSet> getPatternSetFactory() {
103-
throw new UnsupportedOperationException();
104-
}
105-
106101
@Inject
107102
public RestCompatTestTransformTask(FileSystemOperations fileSystemOperations, ObjectFactory objectFactory) {
108103
this.fileSystemOperations = fileSystemOperations;
109104
this.compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1;
110105
this.sourceDirectory = objectFactory.directoryProperty();
111106
this.outputDirectory = objectFactory.directoryProperty();
112-
this.testPatternSet = getPatternSetFactory().create();
107+
this.testPatternSet = getPatternSetFactory().createPatternSet();
113108
this.testPatternSet.include("/*" + "*/*.yml"); // concat these strings to keep build from thinking this is invalid javadoc
114109
// always inject compat headers
115110
headers.put("Content-Type", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
116111
headers.put("Accept", "application/vnd.elasticsearch+json;compatible-with=" + compatibleVersion);
117112
getTransformations().add(new InjectHeaders(headers, Sets.newHashSet(RestCompatTestTransformTask::doesNotHaveCatOperation)));
118113
}
119114

115+
@Inject
116+
protected abstract PatternSetFactory getPatternSetFactory();
117+
120118
private static boolean doesNotHaveCatOperation(ObjectNode doNodeValue) {
121119
final Iterator<String> fieldNamesIterator = doNodeValue.fieldNames();
122120
while (fieldNamesIterator.hasNext()) {
@@ -144,7 +142,7 @@ public void skipTest(String fullTestName, String reason) {
144142
);
145143
}
146144

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

160158
public void skipTestsByFilePattern(String filePattern, String reason) {
161-
PatternSet skippedPatternSet = getPatternSetFactory().create();
159+
PatternSet skippedPatternSet = getPatternSetFactory().createPatternSet();
162160
skippedPatternSet.include(filePattern);
163161
skippedTestByFilePatternTransformations.put(skippedPatternSet, reason);
164162
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.12.1
1+
8.14

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

-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
package org.elasticsearch.gradle.test;
1010

11-
import org.gradle.api.provider.Provider;
1211
import org.gradle.api.tasks.Input;
1312
import org.gradle.process.CommandLineArgumentProvider;
1413

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

23-
public void systemProperty(String key, Provider<Object> value) {
24-
systemProperties.put(key, (Supplier<String>) () -> String.valueOf(value.get()));
25-
}
26-
2722
public void systemProperty(String key, Supplier<String> value) {
2823
systemProperties.put(key, value);
2924
}

gradle/build.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ wiremock = "com.github.tomakehurst:wiremock-jre8-standalone:2.23.2"
4848
xmlunit-core = "org.xmlunit:xmlunit-core:2.8.2"
4949

5050
[plugins]
51-
ospackage = { id = "com.netflix.nebula.ospackage-base", version = "11.11.1" }
51+
ospackage = { id = "com.netflix.nebula.ospackage-base", version = "11.11.2" }

gradle/verification-metadata.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -991,9 +991,9 @@
991991
<sha256 value="d694edd7bae3bc1a8e0dae2f5a22c479ff04d6b9bfcb0ab751a42f02e02d2100" origin="Generated by Gradle"/>
992992
</artifact>
993993
</component>
994-
<component group="com.netflix.nebula" name="gradle-ospackage-plugin" version="11.11.1">
995-
<artifact name="gradle-ospackage-plugin-11.11.1.jar">
996-
<sha256 value="34027ac840adb81b80de43082ce335a6518875217a38ac0204d5a84dc669b7ac" origin="Generated by Gradle"/>
994+
<component group="com.netflix.nebula" name="gradle-ospackage-plugin" version="11.11.2">
995+
<artifact name="gradle-ospackage-plugin-11.11.2.jar">
996+
<sha256 value="2cad0d0af05514e07b163d30d71c486ef1a205265ecc4821f8fb9a121f2cabe5" origin="Generated by Gradle"/>
997997
</artifact>
998998
</component>
999999
<component group="com.netflix.nebula" name="nebula-gradle-interop" version="2.0.0">

gradle/wrapper/gradle-wrapper.jar

59 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
3+
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

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

119119

120120
# Determine the Java command to use to start the JVM.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

gradlew.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7474

7575

7676
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%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" %*
7878

7979
:end
8080
@rem End local scope for the variables with windows NT shell

modules/reindex/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ if (OS.current() == OS.WINDOWS) {
168168

169169
tasks.named("javaRestTest").configure {
170170
dependsOn fixture
171-
systemProperty "tests.fromOld", "true"
172-
/* Use a closure on the string to delay evaluation until right before we
173-
* run the integration tests so that we can be sure that the file is
174-
* ready. */
175-
nonInputProperties.systemProperty "es${version}.port", fixture.map(f->f.addressAndPort)
171+
systemProperty "tests.fromOld", "true"
172+
/* Use a closure on the string to delay evaluation until right before we
173+
* run the integration tests so that we can be sure that the file is
174+
* ready. */
175+
nonInputProperties.systemProperty "es${version}.port", fixture.map(f->f.addressAndPort)
176176
}
177177
}
178178
}

plugins/examples/gradle/wrapper/gradle-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
3+
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)