You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by da...@apache.org on 2017/09/01 16:06:56 UTC

kudu git commit: gradle: convert gradle-wrapper.properties into a real generated file

Repository: kudu
Updated Branches:
  refs/heads/master c6592eef9 -> cc0b19e91


gradle: convert gradle-wrapper.properties into a real generated file

Let's handle gradle-wrapper.properties the same way as gradle-wrapper.jar:
by downloading it during invocations of gradlew if it's not already there.

I also put gradle/wrapper into .gitignore since it is only expected to
contain generated files.

Finally, I added an ASL2 header to gradlew and linked to it from Kudu's
central license file.

Change-Id: I02f31865b27f186291d18f7683c5e40698b8ce37
Reviewed-on: http://gerrit.cloudera.org:8080/7927
Reviewed-by: Mike Percy <mp...@apache.org>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/cc0b19e9
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/cc0b19e9
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/cc0b19e9

Branch: refs/heads/master
Commit: cc0b19e912de7126a25695466215803c3efbaa4c
Parents: c6592ee
Author: Adar Dembo <ad...@cloudera.com>
Authored: Thu Aug 31 15:50:45 2017 -0700
Committer: Dan Burkert <da...@apache.org>
Committed: Fri Sep 1 16:06:04 2017 +0000

----------------------------------------------------------------------
 LICENSE.txt                                   |  1 +
 java/.gitignore                               |  1 +
 java/gradle/wrapper.gradle                    | 17 ++++++++++++-----
 java/gradle/wrapper/gradle-wrapper.properties |  5 -----
 java/gradlew                                  | 17 +++++++++++++++++
 5 files changed, 31 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/cc0b19e9/LICENSE.txt
----------------------------------------------------------------------
diff --git a/LICENSE.txt b/LICENSE.txt
index 1107e89..56c24b8 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -560,6 +560,7 @@ src/kudu/server/url-coding.cc (some portions): Boost software license
 
 www/bootstrap: Apache 2.0 license
 java/kudu-client/src/main/java/org/apache/kudu/util/{Slice,Slices}.java: Apache 2.0 license
+java/gradlew: Apache 2.0 license
   - See above for full text.
 
 ================================================================================

http://git-wip-us.apache.org/repos/asf/kudu/blob/cc0b19e9/java/.gitignore
----------------------------------------------------------------------
diff --git a/java/.gitignore b/java/.gitignore
index b418b4c..202e5f5 100644
--- a/java/.gitignore
+++ b/java/.gitignore
@@ -28,6 +28,7 @@ dependency-reduced-pom.xml
 # Gradle build artifacts
 .gradle
 build
+gradle/wrapper
 
 # IntelliJ
 *.ipr

http://git-wip-us.apache.org/repos/asf/kudu/blob/cc0b19e9/java/gradle/wrapper.gradle
----------------------------------------------------------------------
diff --git a/java/gradle/wrapper.gradle b/java/gradle/wrapper.gradle
index a030569..cda582f 100644
--- a/java/gradle/wrapper.gradle
+++ b/java/gradle/wrapper.gradle
@@ -29,17 +29,24 @@ task wrapper(type: Wrapper) {
 task bootstrapWrapper() {
   // In the doLast block so this runs when the task is called and not during project configuration.
   doLast {
-    def wrapperJarPath = "\$APP_HOME/gradle/wrapper/gradle-wrapper.jar"
+    def wrapperBasePath = "\$APP_HOME/gradle/wrapper"
+    def wrapperJarPath = wrapperBasePath + "/gradle-wrapper.jar"
+    def wrapperPropertiesPath = wrapperBasePath + "/gradle-wrapper.properties"
 
     // 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.
-    def wrapperJarUrl = "https://raw.githubusercontent.com/gradle/gradle/v$fullVersion/gradle/wrapper/gradle-wrapper.jar"
+    def wrapperBaseUrl = "https://raw.githubusercontent.com/gradle/gradle/v$fullVersion/gradle/wrapper"
+    def wrapperJarUrl = wrapperBaseUrl + "/gradle-wrapper.jar"
+    def wrapperPropertiesUrl = wrapperBaseUrl + "/gradle-wrapper.properties"
 
-    def boostrapString = """
+    def bootstrapString = """
       if [ ! -e $wrapperJarPath ]; then
          curl -o $wrapperJarPath $wrapperJarUrl
       fi
+      if [ ! -e $wrapperPropertiesPath ]; then
+         curl -o $wrapperPropertiesPath $wrapperPropertiesUrl
+      fi
       """.stripIndent()
 
     def wrapperScript = file("$rootDir/gradlew")
@@ -49,7 +56,7 @@ task bootstrapWrapper() {
       wrapperLines.each { line ->
         // Print the wrapper bootstrap before the first usage of the wrapper jar.
         if (!bootstrapWritten && line.contains("gradle-wrapper.jar")) {
-          out.println(boostrapString)
+          out.println(bootstrapString)
           bootstrapWritten = true
         }
         out.println(line)
@@ -63,4 +70,4 @@ wrapper.finalizedBy bootstrapWrapper
 task removeWindowScript(type: Delete) {
   delete "$rootDir/gradlew.bat"
 }
-wrapper.finalizedBy removeWindowScript
\ No newline at end of file
+wrapper.finalizedBy removeWindowScript

http://git-wip-us.apache.org/repos/asf/kudu/blob/cc0b19e9/java/gradle/wrapper/gradle-wrapper.properties
----------------------------------------------------------------------
diff --git a/java/gradle/wrapper/gradle-wrapper.properties b/java/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index f16d266..0000000
--- a/java/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip

http://git-wip-us.apache.org/repos/asf/kudu/blob/cc0b19e9/java/gradlew
----------------------------------------------------------------------
diff --git a/java/gradlew b/java/gradlew
index 19a088c..d1b51e6 100755
--- a/java/gradlew
+++ b/java/gradlew
@@ -1,4 +1,18 @@
 #!/usr/bin/env sh
+#
+# Copyright 2017 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 ##############################################################################
 ##
@@ -68,6 +82,9 @@ esac
 if [ ! -e $APP_HOME/gradle/wrapper/gradle-wrapper.jar ]; then
    curl -o $APP_HOME/gradle/wrapper/gradle-wrapper.jar https://raw.githubusercontent.com/gradle/gradle/v4.1.0/gradle/wrapper/gradle-wrapper.jar
 fi
+if [ ! -e $APP_HOME/gradle/wrapper/gradle-wrapper.properties ]; then
+   curl -o $APP_HOME/gradle/wrapper/gradle-wrapper.properties https://raw.githubusercontent.com/gradle/gradle/v4.1.0/gradle/wrapper/gradle-wrapper.properties
+fi
 
 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar