Upgrade to gradle 4.0

- updated common functions into closures for exporting
This commit is contained in:
Connor Tumbleson 2017-07-03 07:16:53 -04:00
parent f8fe98d9a6
commit 988fd15f0a
No known key found for this signature in database
GPG Key ID: C3CC0A201EC7DA75
4 changed files with 33 additions and 32 deletions

View File

@ -14,10 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
gradle.allprojects { def getCheckedOutGitCommitHash() {
// https://gist.github.com/JonasGroeger/7620911
ext.getCheckedOutGitCommitHash = {
def gitFolder = "$projectDir/.git/" def gitFolder = "$projectDir/.git/"
def takeFromHash = 6 def takeFromHash = 6
@ -33,9 +30,9 @@ gradle.allprojects {
def refHead = new File(gitFolder + head[1].trim()) def refHead = new File(gitFolder + head[1].trim())
refHead.text.trim().take takeFromHash refHead.text.trim().take takeFromHash
} }
ext.getCheckedOutBranch = { def getCheckedOutBranch() {
def gitFolder = "$projectDir/.git/" def gitFolder = "$projectDir/.git/"
def head def head
@ -45,5 +42,9 @@ gradle.allprojects {
} catch(Exception e) { } catch(Exception e) {
return "SNAPSHOT"; return "SNAPSHOT";
} }
} }
ext {
getCheckedOutGitCommitHash = this.&getCheckedOutGitCommitHash
getCheckedOutBranch = this.&getCheckedOutBranch
} }

Binary file not shown.

View File

@ -1,6 +1,6 @@
#Mon Apr 24 12:27:08 SGT 2017 #Mon Jul 03 07:09:45 EDT 2017
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip

6
gradlew vendored
View File

@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
warn ( ) { warn () {
echo "$*" echo "$*"
} }
die ( ) { die () {
echo echo
echo "$*" echo "$*"
echo echo
@ -155,7 +155,7 @@ if $cygwin ; then
fi fi
# Escape application args # Escape application args
save ( ) { save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " " echo " "
} }