diff --git a/.travis.yml b/.travis.yml index fb817f5d..5e7b24c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ script: - echo sdk.dir $ANDROID_HOME > local.properties - export TERM=dumb - export JAVA_OPTS="-XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" - - ./gradlew assemble + - ./gradlew --stacktrace assemble android: components: - tools diff --git a/build.gradle b/build.gradle index eb2ee5dc..c2e1817c 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.0' + classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' } } diff --git a/extern/GmsApi b/extern/GmsApi index 216861e7..a57ac35b 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit 216861e7dd86b11d6fcaafb87f64c22fa35af445 +Subproject commit a57ac35b5da42e8b7f78cb1cd002daae404420fb diff --git a/extern/GmsLib b/extern/GmsLib index 7015d9e7..d3a6dfcb 160000 --- a/extern/GmsLib +++ b/extern/GmsLib @@ -1 +1 @@ -Subproject commit 7015d9e7f8f793e3b6d009a6e453f84f35b9d1c8 +Subproject commit d3a6dfcb054dd3464b1663057af8be13167a9241 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f5c485b8..9ec837b2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Feb 7 18:49:43 UTC 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index b43dfe90..746ea19b 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -37,35 +37,33 @@ dependencies { implementation project(':vtm-microg-theme') } -String getMyVersionName() { - def stdout = new ByteArrayOutputStream() - if (rootProject.file("gradlew").exists()) - exec { - commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout - } - else // automatic build system, don't tag dirty - exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } - return stdout.toString().trim().substring(1) -} - -int getMyVersionCode() { +def execResult(...args) { def stdout = new ByteArrayOutputStream() exec { - commandLine 'git', 'rev-list', '--count', "HEAD" + commandLine args standardOutput = stdout } - return Integer.parseInt(stdout.toString().trim()) + return stdout.toString().trim() } +def gmsVersion = "12.8.79" +def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', '')) +def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0').substring(1) +def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD")) +def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').split(' ')[0] +def gitDirty = execResult('git', 'status', '--porcelain').size() > 0 +def ourVersionBase = gitVersionBase.substring(0, gitVersionBase.lastIndexOf('.')) +def ourVersionCode = gmsVersionCode * 1000 + gitCommitCount + (gitDirty ? 1 : 0) +def ourVersionName = "$ourVersionBase.$gmsVersionCode" + (gitCommitCount > 0 ? "-$gitCommitCount-$gitCommitId" : "") + (gitDirty ? "-dirty" : "") +logger.lifecycle('Starting build for version {} ({})...', ourVersionName, ourVersionCode) + android { compileSdkVersion androidCompileSdk() buildToolsVersion "$androidBuildVersionTools" defaultConfig { - versionName getMyVersionName() - def x = getMyVersionCode() - 367 - // We are not allowed to freely choose the hundreds column as it defines the device type - versionCode(12221400 + x % 100 + ((int) (x / 100)) * 1000) + versionName ourVersionName + versionCode ourVersionCode minSdkVersion androidMinSdk() targetSdkVersion androidTargetSdk()