mirror of
https://github.com/revanced/Apktool.git
synced 2024-11-27 06:36:47 +01:00
Upgrade to gradle 4.0
- updated common functions into closures for exporting
This commit is contained in:
parent
f8fe98d9a6
commit
988fd15f0a
@ -14,36 +14,37 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
gradle.allprojects {
|
||||
def getCheckedOutGitCommitHash() {
|
||||
def gitFolder = "$projectDir/.git/"
|
||||
def takeFromHash = 6
|
||||
|
||||
// https://gist.github.com/JonasGroeger/7620911
|
||||
ext.getCheckedOutGitCommitHash = {
|
||||
def gitFolder = "$projectDir/.git/"
|
||||
def takeFromHash = 6
|
||||
|
||||
def head
|
||||
try {
|
||||
head = new File(gitFolder + "HEAD").text.split(":")
|
||||
} catch(Exception e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
def isCommit = head.length == 1
|
||||
if(isCommit) return head[0].trim().take(takeFromHash)
|
||||
|
||||
def refHead = new File(gitFolder + head[1].trim())
|
||||
refHead.text.trim().take takeFromHash
|
||||
def head
|
||||
try {
|
||||
head = new File(gitFolder + "HEAD").text.split(":")
|
||||
} catch(Exception e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ext.getCheckedOutBranch = {
|
||||
def gitFolder = "$projectDir/.git/"
|
||||
def isCommit = head.length == 1
|
||||
if(isCommit) return head[0].trim().take(takeFromHash)
|
||||
|
||||
def head
|
||||
try {
|
||||
head = new File(gitFolder + "HEAD").text.split("/")
|
||||
return head[2].trim();
|
||||
} catch(Exception e) {
|
||||
return "SNAPSHOT";
|
||||
}
|
||||
def refHead = new File(gitFolder + head[1].trim())
|
||||
refHead.text.trim().take takeFromHash
|
||||
}
|
||||
|
||||
def getCheckedOutBranch() {
|
||||
def gitFolder = "$projectDir/.git/"
|
||||
|
||||
def head
|
||||
try {
|
||||
head = new File(gitFolder + "HEAD").text.split("/")
|
||||
return head[2].trim();
|
||||
} catch(Exception e) {
|
||||
return "SNAPSHOT";
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
getCheckedOutGitCommitHash = this.&getCheckedOutGitCommitHash
|
||||
getCheckedOutBranch = this.&getCheckedOutBranch
|
||||
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
#Mon Apr 24 12:27:08 SGT 2017
|
||||
#Mon Jul 03 07:09:45 EDT 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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
6
gradlew
vendored
@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user