Skip to content

Commit 9234a42

Browse files
authored
Update to Gradle 8.9 (opensearch-project#14574)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
1 parent 82bffb1 commit 9234a42

File tree

5 files changed

+38
-31
lines changed

5 files changed

+38
-31
lines changed

buildSrc/src/main/java/org/opensearch/gradle/test/rest/RestResourcesPlugin.java

+29-27
Original file line numberDiff line numberDiff line change
@@ -81,50 +81,52 @@ public void apply(Project project) {
8181
// tests
8282
Configuration testConfig = project.getConfigurations().create("restTestConfig");
8383
project.getConfigurations().create("restTests");
84+
85+
if (BuildParams.isInternal()) {
86+
// core
87+
Dependency restTestdependency = project.getDependencies().project(new HashMap<String, String>() {
88+
{
89+
put("path", ":rest-api-spec");
90+
put("configuration", "restTests");
91+
}
92+
});
93+
testConfig.withDependencies(s -> s.add(restTestdependency));
94+
} else {
95+
Dependency dependency = project.getDependencies().create("org.opensearch:rest-api-spec:" + VersionProperties.getOpenSearch());
96+
testConfig.withDependencies(s -> s.add(dependency));
97+
}
98+
8499
Provider<CopyRestTestsTask> copyRestYamlTestTask = project.getTasks()
85100
.register("copyYamlTestsTask", CopyRestTestsTask.class, task -> {
86101
task.includeCore.set(extension.restTests.getIncludeCore());
87102
task.coreConfig = testConfig;
88103
task.sourceSetName = SourceSet.TEST_SOURCE_SET_NAME;
89-
if (BuildParams.isInternal()) {
90-
// core
91-
Dependency restTestdependency = project.getDependencies().project(new HashMap<String, String>() {
92-
{
93-
put("path", ":rest-api-spec");
94-
put("configuration", "restTests");
95-
}
96-
});
97-
project.getDependencies().add(task.coreConfig.getName(), restTestdependency);
98-
} else {
99-
Dependency dependency = project.getDependencies()
100-
.create("org.opensearch:rest-api-spec:" + VersionProperties.getOpenSearch());
101-
project.getDependencies().add(task.coreConfig.getName(), dependency);
102-
}
103104
task.dependsOn(task.coreConfig);
104105
});
105106

106107
// api
107108
Configuration specConfig = project.getConfigurations().create("restSpec"); // name chosen for passivity
108109
project.getConfigurations().create("restSpecs");
110+
111+
if (BuildParams.isInternal()) {
112+
Dependency restSpecDependency = project.getDependencies().project(new HashMap<String, String>() {
113+
{
114+
put("path", ":rest-api-spec");
115+
put("configuration", "restSpecs");
116+
}
117+
});
118+
specConfig.withDependencies(s -> s.add(restSpecDependency));
119+
} else {
120+
Dependency dependency = project.getDependencies().create("org.opensearch:rest-api-spec:" + VersionProperties.getOpenSearch());
121+
specConfig.withDependencies(s -> s.add(dependency));
122+
}
123+
109124
Provider<CopyRestApiTask> copyRestYamlSpecTask = project.getTasks()
110125
.register("copyRestApiSpecsTask", CopyRestApiTask.class, task -> {
111126
task.includeCore.set(extension.restApi.getIncludeCore());
112127
task.dependsOn(copyRestYamlTestTask);
113128
task.coreConfig = specConfig;
114129
task.sourceSetName = SourceSet.TEST_SOURCE_SET_NAME;
115-
if (BuildParams.isInternal()) {
116-
Dependency restSpecDependency = project.getDependencies().project(new HashMap<String, String>() {
117-
{
118-
put("path", ":rest-api-spec");
119-
put("configuration", "restSpecs");
120-
}
121-
});
122-
project.getDependencies().add(task.coreConfig.getName(), restSpecDependency);
123-
} else {
124-
Dependency dependency = project.getDependencies()
125-
.create("org.opensearch:rest-api-spec:" + VersionProperties.getOpenSearch());
126-
project.getDependencies().add(task.coreConfig.getName(), dependency);
127-
}
128130
task.dependsOn(task.coreConfig);
129131
});
130132

gradle/wrapper/gradle-wrapper.jar

42 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
distributionBase=GRADLE_USER_HOME
1313
distributionPath=wrapper/dists
14-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
14+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
1515
zipStoreBase=GRADLE_USER_HOME
1616
zipStorePath=wrapper/dists
17-
distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961
17+
distributionSha256Sum=258e722ec21e955201e31447b0aed14201765a3bfbae296a46cf60b70e66db70

gradlew

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

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

gradlew.bat

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

0 commit comments

Comments
 (0)