mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
parent
2040462c49
commit
20aa3c6e2d
8 changed files with 42 additions and 98 deletions
|
@ -17,6 +17,10 @@ if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
|||
apply<com.google.gms.googleservices.GoogleServicesPlugin>()
|
||||
}
|
||||
|
||||
fun getBuildTime() = DateTimeFormatter.ISO_DATE_TIME.format(LocalDateTime.now(ZoneOffset.UTC))
|
||||
fun getCommitCount() = runCommand("git rev-list --count HEAD")
|
||||
fun getGitSha() = runCommand("git rev-parse --short HEAD")
|
||||
|
||||
fun runCommand(command: String): String {
|
||||
val byteOut = ByteArrayOutputStream()
|
||||
project.exec {
|
||||
|
@ -42,11 +46,9 @@ android {
|
|||
multiDexEnabled = true
|
||||
|
||||
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
||||
buildConfigField("String", "BETA_COMMIT_COUNT", "\"${getCommitCountSinceLastRelease()}\"")
|
||||
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
||||
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
||||
buildConfigField("Boolean", "INCLUDE_UPDATER", "false")
|
||||
buildConfigField("boolean", "BETA", "false")
|
||||
|
||||
ndk {
|
||||
abiFilters += supportedAbis
|
||||
|
@ -79,7 +81,6 @@ android {
|
|||
buildTypes {
|
||||
getByName("debug") {
|
||||
applicationIdSuffix = ".debugJ2K"
|
||||
versionNameSuffix = "-d${getCommitCount()}"
|
||||
}
|
||||
getByName("release") {
|
||||
applicationIdSuffix = ".j2k"
|
||||
|
@ -87,12 +88,6 @@ android {
|
|||
isMinifyEnabled = true
|
||||
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
||||
}
|
||||
create("beta") {
|
||||
initWith(getByName("release"))
|
||||
buildConfigField("boolean", "BETA", "true")
|
||||
|
||||
versionNameSuffix = "-b${getCommitCountSinceLastRelease()}"
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
|
@ -183,7 +178,6 @@ dependencies {
|
|||
val chuckerVersion = "3.5.2"
|
||||
debugImplementation("com.github.ChuckerTeam.Chucker:library:$chuckerVersion")
|
||||
releaseImplementation("com.github.ChuckerTeam.Chucker:library-no-op:$chuckerVersion")
|
||||
add("betaImplementation", "com.github.ChuckerTeam.Chucker:library-no-op:$chuckerVersion")
|
||||
|
||||
implementation(kotlin("reflect", version = AndroidVersions.kotlin))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue