|
|
@@ -3,33 +3,7 @@ plugins {
|
|
|
id 'org.jetbrains.kotlin.android'
|
|
|
}
|
|
|
|
|
|
-def getVersionCode = { ->
|
|
|
- try {
|
|
|
- def stdout = new ByteArrayOutputStream()
|
|
|
- exec {
|
|
|
- commandLine 'git', 'rev-list', '--first-parent', '--count', 'master'
|
|
|
- standardOutput = stdout
|
|
|
- }
|
|
|
- return Integer.parseInt(stdout.toString().trim())
|
|
|
- }
|
|
|
- catch (ignored) {
|
|
|
- return -1;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-def getVersionName = { ->
|
|
|
- try {
|
|
|
- def stdout = new ByteArrayOutputStream()
|
|
|
- exec {
|
|
|
- commandLine 'git', 'describe', '--always', '--tags', '--dirty'
|
|
|
- standardOutput = stdout
|
|
|
- }
|
|
|
- return stdout.toString().trim()
|
|
|
- }
|
|
|
- catch (ignored) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-}
|
|
|
+apply from: '../helpers.gradle'
|
|
|
|
|
|
// Signing config, mainly intended for debug builds
|
|
|
def keystorePropertiesFile = rootProject.file("keystore.properties");
|
|
|
@@ -43,8 +17,8 @@ android {
|
|
|
applicationId "im.angry.openeuicc"
|
|
|
minSdk 30
|
|
|
targetSdk 31
|
|
|
- versionCode getVersionCode()
|
|
|
- versionName getVersionName()
|
|
|
+ versionCode getGitVersionCode()
|
|
|
+ versionName getGitVersionName()
|
|
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
}
|
|
|
@@ -67,7 +41,7 @@ android {
|
|
|
signingConfig signingConfigs.config
|
|
|
}
|
|
|
}
|
|
|
- applicationVariants.all { variant ->
|
|
|
+ applicationVariants.configureEach { variant ->
|
|
|
if (variant.name == "debug") {
|
|
|
variant.outputs.each { o -> o.versionCodeOverride = System.currentTimeSeconds() }
|
|
|
}
|