You've already forked KsuWebUIStandalone
mirror of
https://github.com/5ec1cff/KsuWebUIStandalone.git
synced 2025-09-06 06:37:11 +00:00
use git commit count as versionCode
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.FileInputStream
|
import java.io.FileInputStream
|
||||||
import java.util.Properties
|
import java.util.Properties
|
||||||
|
|
||||||
@@ -13,6 +14,18 @@ val keystoreProperties = if (keystorePropertiesFile.exists() && keystoreProperti
|
|||||||
}
|
}
|
||||||
} else null
|
} else null
|
||||||
|
|
||||||
|
fun String.execute(currentWorkingDir: File = file("./")): String {
|
||||||
|
val byteOut = ByteArrayOutputStream()
|
||||||
|
project.exec {
|
||||||
|
workingDir = currentWorkingDir
|
||||||
|
commandLine = split("\\s".toRegex())
|
||||||
|
standardOutput = byteOut
|
||||||
|
}
|
||||||
|
return String(byteOut.toByteArray()).trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
val gitCommitCount = "git rev-list HEAD --count".execute().toInt()
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "io.github.a13e300.ksuwebui"
|
namespace = "io.github.a13e300.ksuwebui"
|
||||||
compileSdk = 35
|
compileSdk = 35
|
||||||
@@ -32,7 +45,7 @@ android {
|
|||||||
applicationId = "io.github.a13e300.ksuwebui"
|
applicationId = "io.github.a13e300.ksuwebui"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 1
|
versionCode = gitCommitCount
|
||||||
versionName = "1.0"
|
versionName = "1.0"
|
||||||
setProperty("archivesBaseName", "KsuWebUI-$versionName-$versionCode")
|
setProperty("archivesBaseName", "KsuWebUI-$versionName-$versionCode")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user