Skip to content

Commit c0088a5

Browse files
authored
[ML][6.6] Upgrade Gradle to v5.0 (#326)
Needs to be merged before elastic/elasticsearch#34263 to prevent builds with ml-cpp in elasticsearch-extra from failing. Defining a custom wrapper task was incompatible with Gradle 5, so this is replaced with a modification to the built in wrapper task. The Gradle Wrapper is also upgraded to the latest version. Backport of #325
1 parent 6d0d6c4 commit c0088a5

File tree

6 files changed

+7
-21
lines changed

6 files changed

+7
-21
lines changed

build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,15 @@ task build(dependsOn: [check, assemble]) {
188188
description = 'Assemble and test the C++ part of Machine Learning'
189189
}
190190

191-
task wrapper(type: Wrapper) {
192-
distributionType = DistributionType.ALL
193-
191+
wrapper {
192+
distributionType = 'ALL'
194193
doLast {
195194
final DistributionLocator locator = new DistributionLocator()
196195
final GradleVersion version = GradleVersion.version(wrapper.gradleVersion)
197196
final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH))
198197
final URI sha256Uri = new URI(distributionUri.toString() + ".sha256")
199198
final String sha256Sum = new String(sha256Uri.toURL().bytes)
200199
wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n"
200+
println "Added checksum to wrapper properties"
201201
}
202202
}
203-

gradle/wrapper/gradle-wrapper.jar

1014 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionSha256Sum=fc049dcbcb245d5892bebae143bd515a78f6a5a93cec99d489b312dc0ce4aad9
6+
distributionSha256Sum=17847c8e12b2bcfce26a79f425f082c31d4ded822f99a66127eee2d96bf18216

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
2828
APP_BASE_NAME=`basename "$0"`
2929

3030
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
31+
DEFAULT_JVM_OPTS='"-Xmx64m"'
3232

3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"

gradlew.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
1414
set APP_HOME=%DIRNAME%
1515

1616
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
17+
set DEFAULT_JVM_OPTS="-Xmx64m"
1818

1919
@rem Find java.exe
2020
if defined JAVA_HOME goto findJavaFromJavaHome

upload.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,3 @@ task uberUpload(type: UploadS3Task, dependsOn: buildUberZip) {
9191
description = 'Upload C++ uber zip to S3 Bucket'
9292
}
9393

94-
task wrapper(type: Wrapper) {
95-
distributionType = DistributionType.ALL
96-
97-
doLast {
98-
final DistributionLocator locator = new DistributionLocator()
99-
final GradleVersion version = GradleVersion.version(wrapper.gradleVersion)
100-
final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH))
101-
final URI sha256Uri = new URI(distributionUri.toString() + ".sha256")
102-
final String sha256Sum = new String(sha256Uri.toURL().bytes)
103-
wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n"
104-
}
105-
}
106-

0 commit comments

Comments
 (0)