mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Revert "Revert "Add Beta flavor builds""
This reverts commit 20aa3c6e2d
.
This commit is contained in:
parent
20aa3c6e2d
commit
cc9fefe4eb
8 changed files with 98 additions and 42 deletions
|
@ -17,10 +17,6 @@ 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 {
|
||||
|
@ -46,9 +42,11 @@ 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
|
||||
|
@ -81,6 +79,7 @@ android {
|
|||
buildTypes {
|
||||
getByName("debug") {
|
||||
applicationIdSuffix = ".debugJ2K"
|
||||
versionNameSuffix = "-d${getCommitCount()}"
|
||||
}
|
||||
getByName("release") {
|
||||
applicationIdSuffix = ".j2k"
|
||||
|
@ -88,6 +87,12 @@ android {
|
|||
isMinifyEnabled = true
|
||||
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
||||
}
|
||||
create("beta") {
|
||||
initWith(getByName("release"))
|
||||
buildConfigField("boolean", "BETA", "true")
|
||||
|
||||
versionNameSuffix = "-b${getCommitCountSinceLastRelease()}"
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
|
@ -178,6 +183,7 @@ 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