Files
Pixelwall/app/build.gradle.kts
T
MrBlakeandClaude Opus 5.5 00d653e4df Add release signing, versioning and dist task
- Version defined once; versionCode = MAJOR*10000 + MINOR*100 + PATCH
- Optional release signing from ~/.gradle/gradle.properties
- ./gradlew dist copies signed APKs to dist/ with Obtainium-friendly names

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 22:06:13 +02:00

116 lines
4.2 KiB
Kotlin

plugins {
alias(libs.plugins.pixelwall.android.application)
alias(libs.plugins.pixelwall.android.compose)
alias(libs.plugins.pixelwall.android.hilt)
}
// Einzige Quelle der Version. versionCode = MAJOR*10000 + MINOR*100 + PATCH (streng monoton für Obtainium).
val appVersion = "0.1.0"
val appVersionCode = appVersion.split(".").map(String::toInt).let { (major, minor, patch) -> major * 10000 + minor * 100 + patch }
// Release-Signatur aus ~/.gradle/gradle.properties; fehlt sie, entstehen unsignierte APKs (z. B. für F-Droid).
val signingStoreFile = providers.gradleProperty("pixelwall.signing.storeFile").orNull
android {
namespace = "org.pixelwall.app"
defaultConfig {
applicationId = "org.pixelwall.app"
versionCode = appVersionCode
versionName = appVersion
}
signingConfigs {
if (signingStoreFile != null) {
create("release") {
storeFile = file(signingStoreFile)
storePassword = providers.gradleProperty("pixelwall.signing.storePassword").get()
keyAlias = providers.gradleProperty("pixelwall.signing.keyAlias").get()
keyPassword = providers.gradleProperty("pixelwall.signing.keyPassword").get()
}
}
}
flavorDimensions += "network"
productFlavors {
// Ohne INTERNET-Berechtigung. Firewall nur als Sperre pro App.
create("core") {
dimension = "network"
isDefault = true
}
// Mit INTERNET: DNS-Filter, Blocklisten, optionale Regelwerk-Updates.
create("full") {
dimension = "network"
applicationIdSuffix = ".full"
versionNameSuffix = "-full"
}
}
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.findByName("release")
}
}
// F-Droid / reproducible builds: keine verschlüsselten Abhängigkeits-Metadaten im APK.
dependenciesInfo {
includeInApk = false
includeInBundle = false
}
androidResources {
localeFilters += listOf("en", "de")
}
}
// Release-APKs mit stabilen Namen für Gitea-Releases/Obtainium nach dist/ kopieren.
val dist = tasks.register<Sync>("dist") {
description = "Copies signed release APKs to dist/ as pixelwall-<flavor>-v<version>.apk"
dependsOn("assembleCoreRelease", "assembleFullRelease")
val version = appVersion // lokale Kopie: Lambdas dürfen keine Skript-Objekte referenzieren (Configuration Cache)
for (flavor in listOf("core", "full")) {
val apkName = "pixelwall-$flavor-v$version.apk"
from(layout.buildDirectory.dir("outputs/apk/$flavor/release")) {
include("*.apk")
rename { apkName }
}
}
into(rootProject.layout.projectDirectory.dir("dist"))
}
dependencies {
implementation(project(":core:model"))
implementation(project(":core:domain"))
implementation(project(":core:data"))
implementation(project(":core:system"))
implementation(project(":core:privileged"))
implementation(project(":core:ui"))
implementation(project(":device-profiles"))
implementation(project(":feature:dashboard"))
implementation(project(":feature:permissions"))
implementation(project(":feature:network"))
implementation(project(":feature:system"))
implementation(project(":feature:profiles"))
implementation(project(":feature:trackers"))
implementation(project(":feature:monitor"))
implementation(project(":feature:changelog"))
implementation(project(":feature:onboarding"))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.hilt.navigation.compose)
testImplementation(project(":core:testing"))
testImplementation(libs.truth)
testImplementation(libs.turbine)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.runner)
}