Add selectable Zhanxun signing profile for Android APK
This commit is contained in:
1 parent
208d37b7d8
commit
40ff016f6b
3 files changed
+13
-5
No files matched your search
@@ -1,7 +1,9 @@
|
||||
import java.util.Properties
|
||||
|
||||
plugins { id("com.android.application"); id("org.jetbrains.kotlin.android") }
|
||||
val signingFile = rootProject.file("signing.local.properties")
|
||||
val signingProfile = providers.gradleProperty("adsSigning").orElse("crosshatch").get()
|
||||
require(signingProfile in listOf("crosshatch", "zhanxun")) { "Unsupported adsSigning profile" }
|
||||
val signingFile = rootProject.file(if (signingProfile == "crosshatch") "signing.local.properties" else "signing.zhanxun.local.properties")
|
||||
val crosshatchProperties = Properties().apply {
|
||||
if (signingFile.isFile) signingFile.inputStream().use { load(it) }
|
||||
}
|
||||
@@ -22,7 +24,7 @@ android {
|
||||
buildConfigField("String", "AGENT_TOKEN", "\"" + agentToken.replace("\\", "\\\\").replace("\"", "\\\"") + "\"")
|
||||
applicationId = "com.ttstd.ads"; minSdk = 23; targetSdk = 35; versionCode = 2; versionName = "0.1.1"; ndk { abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86_64") } }
|
||||
signingConfigs {
|
||||
create("crosshatch") {
|
||||
create(signingProfile) {
|
||||
storeFile = file(signingValue("storeFile"))
|
||||
storePassword = signingValue("storePassword")
|
||||
keyAlias = signingValue("keyAlias")
|
||||
@@ -30,8 +32,8 @@ android {
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
getByName("debug") { signingConfig = signingConfigs.getByName("crosshatch") }
|
||||
getByName("release") { signingConfig = signingConfigs.getByName("crosshatch"); isMinifyEnabled = false }
|
||||
getByName("debug") { signingConfig = signingConfigs.getByName(signingProfile) }
|
||||
getByName("release") { signingConfig = signingConfigs.getByName(signingProfile); isMinifyEnabled = false }
|
||||
}
|
||||
compileOptions { sourceCompatibility = JavaVersion.VERSION_17; targetCompatibility = JavaVersion.VERSION_17 }
|
||||
kotlinOptions { jvmTarget = "17" }
|
||||
@@ -55,7 +57,7 @@ tasks.matching { it.name == "assembleRelease" || it.name == "assembleDebug" }.co
|
||||
copy {
|
||||
from(source)
|
||||
into(rootProject.file("../bin/apk"))
|
||||
rename { "ads-android-agent-${android.defaultConfig.versionName}-crosshatch${if (variant == "debug") "-debug" else ""}.apk" }
|
||||
rename { "ads-android-agent-${android.defaultConfig.versionName}-${signingProfile}${if (variant == "debug") "-debug" else ""}.apk" }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user