diff --git a/CHANGELOG.md b/CHANGELOG.md index 0989db87c1673..7b796b19cafe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Remove LegacyESVersion.V_7_6_ and V_7_7_ Constants ([#4837](https://github.com/opensearch-project/OpenSearch/pull/4837)) - Remove LegacyESVersion.V_7_10_ Constants ([#5018](https://github.com/opensearch-project/OpenSearch/pull/5018)) - Remove Version.V_1_ Constants ([#5021](https://github.com/opensearch-project/OpenSearch/pull/5021)) +- Remove deprecated org.gradle.util.DistributionLocator usage ([#6212](https://github.com/opensearch-project/OpenSearch/pull/6212)) ### Fixed - Fix 'org.apache.hc.core5.http.ParseException: Invalid protocol version' under JDK 16+ ([#4827](https://github.com/opensearch-project/OpenSearch/pull/4827)) diff --git a/build.gradle b/build.gradle index 10b243bdb31a2..359ce8bd24ab1 100644 --- a/build.gradle +++ b/build.gradle @@ -47,8 +47,6 @@ import org.gradle.plugins.ide.eclipse.model.SourceFolder import org.gradle.api.Project; import org.gradle.api.internal.tasks.testing.junit.JUnitTestFramework import org.gradle.process.ExecResult; -import org.gradle.util.DistributionLocator -import org.gradle.util.GradleVersion import static org.opensearch.gradle.util.GradleUtils.maybeConfigure @@ -547,16 +545,12 @@ allprojects { wrapper { distributionType = 'ALL' doLast { - final DistributionLocator locator = new DistributionLocator() - final GradleVersion version = GradleVersion.version(wrapper.gradleVersion) - final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH)) - final URI sha256Uri = new URI(distributionUri.toString() + ".sha256") - final String sha256Sum = new String(sha256Uri.toURL().bytes) - wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n" + def sha256Sum = new String(new URL(getDistributionUrl() + ".sha256").bytes) + propertiesFile << "distributionSha256Sum=${sha256Sum}\n" println "Added checksum to wrapper properties" // Update build-tools to reflect the Gradle upgrade // TODO: we can remove this once we have tests to make sure older versions work. - project(':build-tools').file('src/main/resources/minimumGradleVersion').text = gradleVersion + project(':build-tools').file('src/main/resources/minimumGradleVersion').text = gradleVersion + "\n" println "Updated minimum Gradle Version" } }