diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesPlugin.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesPlugin.java index 685a7a276434d..2d56e42e3d951 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesPlugin.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesPlugin.java @@ -11,24 +11,23 @@ import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.provider.Provider; -import org.gradle.initialization.layout.BuildLayout; -import javax.inject.Inject; import java.io.File; public class VersionPropertiesPlugin implements Plugin { - private BuildLayout buildLayout; - - @Inject - VersionPropertiesPlugin(BuildLayout buildLayout) { - this.buildLayout = buildLayout; - } - @Override public void apply(Project project) { + File workspaceDir; + if (project.getGradle().getIncludedBuilds().isEmpty()) { + // This is an included build, use the parent directory as workspace root + workspaceDir = project.getRootDir().getParentFile(); + } else { + workspaceDir = project.getRootDir(); + } + // Register the service if not done yet - File infoPath = new File(buildLayout.getRootDirectory(), "build-tools-internal"); + File infoPath = new File(workspaceDir, "build-tools-internal"); Provider serviceProvider = project.getGradle().getSharedServices() .registerIfAbsent("versions", VersionPropertiesBuildService.class, spec -> { spec.getParameters().getInfoPath().set(infoPath); diff --git a/build-tools-internal/gradle/wrapper/gradle-wrapper.properties b/build-tools-internal/gradle/wrapper/gradle-wrapper.properties index 1df766d36bac2..fb04efa8e8848 100644 --- a/build-tools-internal/gradle/wrapper/gradle-wrapper.properties +++ b/build-tools-internal/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b +distributionSha256Sum=00b273629df4ce46e68df232161d5a7c4e495b9a029ce6e0420f071e21316867 diff --git a/build-tools-internal/settings.gradle b/build-tools-internal/settings.gradle deleted file mode 100644 index 6981f837d4a2c..0000000000000 --- a/build-tools-internal/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -includeBuild '../build-conventions' -includeBuild '../build-tools' diff --git a/build-tools-internal/src/main/resources/minimumGradleVersion b/build-tools-internal/src/main/resources/minimumGradleVersion index be4cea5e2b261..a88f81184a32c 100644 --- a/build-tools-internal/src/main/resources/minimumGradleVersion +++ b/build-tools-internal/src/main/resources/minimumGradleVersion @@ -1 +1 @@ -7.2 \ No newline at end of file +7.3 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1df766d36bac2..fb04efa8e8848 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b +distributionSha256Sum=00b273629df4ce46e68df232161d5a7c4e495b9a029ce6e0420f071e21316867