Skip to content

Commit 7cacb05

Browse files
committed
Update Gradle to 8.11
Signed-off-by: Andriy Redko <[email protected]>
1 parent c9edb48 commit 7cacb05

File tree

5 files changed

+24
-14
lines changed

5 files changed

+24
-14
lines changed

build.gradle

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,21 @@ Map<String, String> buildMetadataMap = buildMetadataValue.tokenize(';').collectE
162162
return [key, value]
163163
}
164164

165-
/**
166-
* Using 'git' command line (if available), tries to fetch the commit date of the current revision
167-
* @return commit date of the current revision or 0 if it is not available
168-
*/
165+
// See please https://docs.gradle.org/8.11/userguide/service_injection.html#execoperations
166+
interface InjectedExecOps {
167+
@Inject //@javax.inject.Inject
168+
ExecOperations getExecOps()
169+
}
170+
171+
/**
172+
* Using 'git' command line (if available), tries to fetch the commit date of the current revision
173+
* @return commit date of the current revision or 0 if it is not available
174+
*/
169175
long gitRevisionDate = {
176+
def execOps = project.objects.newInstance(InjectedExecOps)
170177
// Try to get last commit date as Unix timestamp
171178
try (ByteArrayOutputStream stdout = new ByteArrayOutputStream()) {
172-
ExecResult result = project.exec(spec -> {
179+
ExecResult result = execOps.execOps.exec(spec -> {
173180
spec.setIgnoreExitValue(true);
174181
spec.setStandardOutput(stdout);
175182
spec.commandLine("git", "log", "-1", "--format=%ct");
@@ -362,7 +369,7 @@ allprojects {
362369
if ((dep instanceof ProjectDependency) == false) {
363370
return
364371
}
365-
Project upstreamProject = dep.dependencyProject
372+
Project upstreamProject = project.project(dep.path)
366373
if (upstreamProject == null) {
367374
return
368375
}
@@ -438,7 +445,7 @@ gradle.projectsEvaluated {
438445

439446
configurations.matching { it.canBeResolved }.all { Configuration configuration ->
440447
dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep ->
441-
Project upstreamProject = dep.dependencyProject
448+
Project upstreamProject = project.project(dep.path)
442449
if (upstreamProject != null) {
443450
if (project.path == upstreamProject.path) {
444451
// TODO: distribution integ tests depend on themselves (!), fix that

buildSrc/src/main/groovy/org/opensearch/gradle/test/TestWithDependenciesPlugin.groovy

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,12 @@ class TestWithDependenciesPlugin implements Plugin<Project> {
5656

5757
project.configurations.testImplementation.dependencies.all { Dependency dep ->
5858
// this closure is run every time a compile dependency is added
59-
if (dep instanceof ProjectDependency && dep.dependencyProject.plugins.hasPlugin(PluginBuildPlugin)) {
60-
project.gradle.projectsEvaluated {
61-
addPluginResources(project, dep.dependencyProject)
59+
if (dep instanceof ProjectDependency) {
60+
Project dependencyProject = project.project(((ProjectDependency)dep).path)
61+
if (dependencyProject.plugins.hasPlugin(PluginBuildPlugin)) {
62+
project.gradle.projectsEvaluated {
63+
addPluginResources(project, dependencyProject)
64+
}
6265
}
6366
}
6467
}

buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public String call() throws Exception {
121121
Node dependencyNode = dependenciesNode.appendNode("dependency");
122122
dependencyNode.appendNode("groupId", dependency.getGroup());
123123
ProjectDependency projectDependency = (ProjectDependency) dependency;
124-
String artifactId = getArchivesBaseName(projectDependency.getDependencyProject());
124+
String artifactId = getArchivesBaseName(project.project(projectDependency.getPath()));
125125
dependencyNode.appendNode("artifactId", artifactId);
126126
dependencyNode.appendNode("version", dependency.getVersion());
127127
dependencyNode.appendNode("scope", "compile");

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
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.10.2-all.zip
14+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-all.zip
1515
zipStoreBase=GRADLE_USER_HOME
1616
zipStorePath=wrapper/dists
17-
distributionSha256Sum=2ab88d6de2c23e6adae7363ae6e29cbdd2a709e992929b48b6530fd0c7133bd6
17+
distributionSha256Sum=73d2d553933194d8eefed0a291acbe45392ca3572ba13834cbbf373da375276d

libs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ subprojects {
4242
project.afterEvaluate {
4343
configurations.all { Configuration conf ->
4444
dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep ->
45-
Project depProject = dep.dependencyProject
45+
Project depProject = project.project(dep.path)
4646
if (depProject != null
4747
&& (false == depProject.path.equals(':libs:opensearch-core') &&
4848
false == depProject.path.equals(':libs:opensearch-common'))

0 commit comments

Comments
 (0)