feat(android): provider selection, stop button, adaptive icon, release signing; docs + previews
This commit is contained in:
parent
49fdc5a189
commit
6ff31589be
38 changed files with 468 additions and 41 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
|
|
@ -6,6 +8,21 @@ plugins {
|
|||
alias(libs.plugins.paparazzi) // screenshot tests only (JVM, test source set)
|
||||
}
|
||||
|
||||
// Release signing: values come from env (BYTECLAW_KEYSTORE_FILE/_PASSWORD, BYTECLAW_KEY_ALIAS/_PASSWORD)
|
||||
// or from android/keystore.properties (storeFile, storePassword, keyAlias, keyPassword).
|
||||
// keystore.properties and *.jks/*.keystore are gitignored. Without them the release APK stays unsigned.
|
||||
val keystoreProps = Properties().apply {
|
||||
val f = rootProject.file("keystore.properties")
|
||||
if (f.isFile) f.inputStream().use { load(it) }
|
||||
}
|
||||
fun signingValue(env: String, prop: String): String? =
|
||||
System.getenv(env)?.takeIf { it.isNotBlank() } ?: keystoreProps.getProperty(prop)?.takeIf { it.isNotBlank() }
|
||||
val releaseStoreFile = signingValue("BYTECLAW_KEYSTORE_FILE", "storeFile")
|
||||
val releaseStorePassword = signingValue("BYTECLAW_KEYSTORE_PASSWORD", "storePassword")
|
||||
val releaseKeyAlias = signingValue("BYTECLAW_KEY_ALIAS", "keyAlias")
|
||||
val releaseKeyPassword = signingValue("BYTECLAW_KEY_PASSWORD", "keyPassword")
|
||||
val hasReleaseSigning = listOf(releaseStoreFile, releaseStorePassword, releaseKeyAlias, releaseKeyPassword).all { it != null }
|
||||
|
||||
android {
|
||||
namespace = "dev.byteclaw.client"
|
||||
compileSdk = 35
|
||||
|
|
@ -18,8 +35,22 @@ android {
|
|||
versionName = "0.1.0"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (hasReleaseSigning) {
|
||||
create("release") {
|
||||
storeFile = file(releaseStoreFile!!.replaceFirst(Regex("^~"), System.getProperty("user.home")))
|
||||
storePassword = releaseStorePassword
|
||||
keyAlias = releaseKeyAlias
|
||||
keyPassword = releaseKeyPassword
|
||||
enableV2Signing = true
|
||||
enableV3Signing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
if (hasReleaseSigning) signingConfig = signingConfigs.getByName("release")
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue