Files
android-webview-kiosk/app/build.gradle.kts
T
Arnie via Claude a36d3869b1
build / build (push) Failing after 3m11s
refactor: rename dashboards→webviews, unique applicationId per flavor
Each flavor gets applicationIdSuffix = ".<name>" so the Bravia
getApplicationList API returns a distinct URI per webview, enabling
Control4 to launch specific flavors independently.

BREAKING CHANGE: applicationId changed from cz.c3c.webviewkiosk to
cz.c3c.webviewkiosk.<flavor> — uninstall old app before reinstalling.
BuildConfig.DASHBOARD_URL renamed to WEBVIEW_URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 18:22:51 +02:00

79 lines
2.0 KiB
Kotlin

import org.yaml.snakeyaml.Yaml
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}
@Suppress("UNCHECKED_CAST")
val webviews: Map<String, Map<String, String>> =
Yaml().load(rootProject.file("webviews.yaml").inputStream())
android {
namespace = "cz.c3c.webviewkiosk"
compileSdk = 34
defaultConfig {
applicationId = "cz.c3c.webviewkiosk"
minSdk = 26 // Sony KD-65XE9305 final firmware = Android 8.0
targetSdk = 34
versionCode = 1 // bump on every release; adb install -r refuses downgrades
versionName = "0.1.0"
}
buildFeatures {
buildConfig = true
}
signingConfigs {
create("release") {
storeFile = rootProject.file("signing/release.keystore")
storePassword = "android-webview-kiosk"
keyAlias = "kiosk"
keyPassword = "android-webview-kiosk"
}
}
buildTypes {
release {
isMinifyEnabled = false
signingConfig = signingConfigs.getByName("release")
}
}
flavorDimensions += "webview"
productFlavors {
webviews.forEach { (name, config) ->
create(name) {
dimension = "webview"
applicationIdSuffix = ".$name"
buildConfigField("String", "WEBVIEW_URL", "\"${config["url"]}\"")
resValue("string", "app_name", config["label"] ?: name)
}
}
}
@Suppress("DEPRECATION")
applicationVariants.all {
val flavor = productFlavors.first().name
val type = buildType.name
outputs.all {
(this as com.android.build.gradle.internal.api.BaseVariantOutputImpl)
.outputFileName = "$flavor-$type.apk"
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}
dependencies {
testImplementation("junit:junit:4.13.2")
}