import org.yaml.snakeyaml.Yaml plugins { id("com.android.application") } @Suppress("UNCHECKED_CAST") val webviews: Map> = Yaml().load(rootProject.file("webviews.yaml").inputStream()) android { namespace = "cz.c3c.webviewkiosk" compileSdk = 35 buildToolsVersion = "36.0.0" defaultConfig { applicationId = "cz.c3c.webviewkiosk" minSdk = 26 // Sony KD-65XE9305 final firmware = Android 8.0 targetSdk = 35 versionCode = 3 // bump on every release; adb install -r refuses downgrades versionName = "0.1.0" } buildFeatures { buildConfig = true resValues = 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["ui_label"] ?: config["label"] ?: name}") } } } compileOptions { sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 } } androidComponents { onVariants { variant -> variant.outputs.forEach { output -> val flavor = variant.productFlavors.firstOrNull()?.second ?: variant.name val buildType = variant.buildType ?: "debug" output.outputFileName.set("$flavor-$buildType.apk") } } } dependencies { testImplementation("junit:junit:4.13.2") }