diff --git a/CHANGELOG.md b/CHANGELOG.md index a4bd3cf26ec5e..8769b0b29894b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Cluster health call to throw decommissioned exception for local decommissioned node([#6008](https://github.com/opensearch-project/OpenSearch/pull/6008)) - [Refactor] core.common to new opensearch-common library ([#5976](https://github.com/opensearch-project/OpenSearch/pull/5976)) - Cluster local health call to throw exception if node is decommissioned or weighed away ([#6198](https://github.com/opensearch-project/OpenSearch/pull/6198)) +- Remove deprecated org.gradle.util.DistributionLocator usage ([#6212](https://github.com/opensearch-project/OpenSearch/pull/6212)) ### Deprecated diff --git a/build.gradle b/build.gradle index 8d09879ca4842..0c15a962073a8 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 @@ -546,16 +544,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" } }