kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abu...@apache.org
Subject [kudu] branch master updated: [build] Make Gradle download URLs configurable
Date Tue, 19 Mar 2019 09:11:10 GMT
This is an automated email from the ASF dual-hosted git repository.

abukor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new be04a39  [build] Make Gradle download URLs configurable
be04a39 is described below

commit be04a398c1e373ebbe56347e1eb5b4885deecaa0
Author: Attila Bukor <abukor@apache.org>
AuthorDate: Mon Mar 18 23:17:18 2019 +0100

    [build] Make Gradle download URLs configurable
    
    Make the Gradle and Gradle Wrapper download URLs configurable from
    gradle.properties so they can be changed to a mirror if needed in an
    internal network behind a firewall.
    
    Change-Id: I9317d8a84ccf788892163de1d89999e7749fdb34
    Reviewed-on: http://gerrit.cloudera.org:8080/12775
    Reviewed-by: Grant Henke <granthenke@apache.org>
    Tested-by: Kudu Jenkins
---
 java/build.gradle          |  2 +-
 java/gradle.properties     | 11 +++++++++++
 java/gradle/wrapper.gradle |  7 +------
 java/gradlew               |  2 +-
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/java/build.gradle b/java/build.gradle
index 49862d9..035fff8 100755
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -95,4 +95,4 @@ task distTest(type: DistTestTask, dependsOn: copyDistTestJars) {
       addTestTask it
     }
   }
-}
\ No newline at end of file
+}
diff --git a/java/gradle.properties b/java/gradle.properties
index f786b30..9f77dde 100755
--- a/java/gradle.properties
+++ b/java/gradle.properties
@@ -59,3 +59,14 @@ org.gradle.daemon = true
 # org.gradle.configureondemand = true
 # org.gradle.parallel = true
 # org.gradle.workers.max = 4
+
+# The below parameters are used in the `gradle wrapper` to generate `gradlew`
+# and `gradle-wrapper.properties`
+gradleDistUrlBase = https://services.gradle.org/distributions
+
+# Leverages the wrapper jar checked into the gradle project on github because
+# the jar isn't available elsewhere. Using raw.githubusercontent.com instead of
+# github.com because github.com servers deprecated TLSv1/TLSv1.1 support some
+# time ago, so older versions of curl (built against OpenSSL library that
+# doesn't support TLSv1.2) would fail to fetch the jar.
+wrapperBaseUrl = https://raw.githubusercontent.com/gradle/gradle/v5.0.0/gradle/wrapper/
diff --git a/java/gradle/wrapper.gradle b/java/gradle/wrapper.gradle
index 10171d5..708c8be 100644
--- a/java/gradle/wrapper.gradle
+++ b/java/gradle/wrapper.gradle
@@ -23,6 +23,7 @@
 wrapper {
   gradleVersion = versions.gradle
   distributionType = Wrapper.DistributionType.ALL
+  distributionUrl = "${gradleDistUrlBase}/gradle-${versions.gradle}-all.zip"
 }
 
 def licenseString = """#
@@ -51,12 +52,6 @@ task bootstrapWrapper() {
 
     // Add a trailing zero to the version if needed.
     def fullVersion = versions.gradle.count(".") == 1 ? "${versions.gradle}.0" : versions.gradle
-    // Leverages the wrapper jar checked into the gradle project on github because the jar
isn't
-    // available elsewhere. Using raw.githubusercontent.com instead of github.com because
-    // github.com servers deprecated TLSv1/TLSv1.1 support some time ago, so older versions
-    // of curl (built against OpenSSL library that doesn't support TLSv1.2) would fail to
-    // fetch the jar.
-    def wrapperBaseUrl = "https://raw.githubusercontent.com/gradle/gradle/v$fullVersion/gradle/wrapper"
     def wrapperJarUrl = wrapperBaseUrl + "/gradle-wrapper.jar"
 
     def bootstrapString = """
diff --git a/java/gradlew b/java/gradlew
index a68eae9..ed25bfa 100755
--- a/java/gradlew
+++ b/java/gradlew
@@ -82,7 +82,7 @@ esac
 # Loop in case we encounter an error.
 for attempt in 1 2 3; do
   if [ ! -e $APP_HOME/gradle/wrapper/gradle-wrapper.jar ]; then
-    if ! curl -s -S --retry 3 -L -o "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" "https://raw.githubusercontent.com/gradle/gradle/v5.1.1/gradle/wrapper/gradle-wrapper.jar";
then
+    if ! curl -s -S --retry 3 -L -o "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" "https://raw.githubusercontent.com/gradle/gradle/v5.0.0/gradle/wrapper//gradle-wrapper.jar";
then
       rm -f "$APP_HOME/gradle/wrapper/gradle-wrapper.jar"
       # Pause for a bit before looping in case the server throttled us.
       sleep 5


Mime
View raw message