mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-15 02:36:12 -04:00
- Add UnmatchedDevicesCard to show/hide devices without profiles - Separate devices with profiles from unmatched devices in overview - Add priority-based sorting (profile.priority with 0 = highest) - Add compiler args for experimental unsigned types and annotation targets - Add string resources for unmatched devices UI - Refactor overview to handle both profiled and non-profiled devices The UI now shows: 1. Devices with configured profiles first (sorted by priority) 2. Collapsible section for unmatched devices with toggle button 3. Session-persistent show/hide state for unmatched devices
157 lines
4.6 KiB
Kotlin
157 lines
4.6 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("kotlin-android")
|
|
id("com.google.devtools.ksp")
|
|
id("kotlin-kapt")
|
|
id("kotlin-parcelize")
|
|
}
|
|
apply(plugin = "dagger.hilt.android.plugin")
|
|
apply(plugin = "androidx.navigation.safeargs.kotlin")
|
|
|
|
android {
|
|
compileSdk = ProjectConfig.compileSdk
|
|
namespace = ProjectConfig.packageName
|
|
|
|
defaultConfig {
|
|
applicationId = ProjectConfig.packageName
|
|
|
|
minSdk = ProjectConfig.minSdk
|
|
targetSdk = ProjectConfig.targetSdk
|
|
|
|
versionCode = ProjectConfig.Version.code + 0 // Base app
|
|
versionName = ProjectConfig.Version.name
|
|
|
|
testInstrumentationRunner = "eu.darken.capod.HiltTestRunner"
|
|
}
|
|
|
|
signingConfigs {
|
|
val basePath = File(System.getProperty("user.home"), ".appconfig/${ProjectConfig.packageName}")
|
|
create("releaseFoss") {
|
|
setupCredentials(File(basePath, "signing-foss.properties"))
|
|
}
|
|
create("releaseGplay") {
|
|
setupCredentials(File(basePath, "signing-gplay-upload.properties"))
|
|
}
|
|
}
|
|
|
|
flavorDimensions.add("version")
|
|
productFlavors {
|
|
create("foss") {
|
|
dimension = "version"
|
|
signingConfig = signingConfigs["releaseFoss"]
|
|
// The info block is encrypted and can only be read by google
|
|
dependenciesInfo {
|
|
includeInApk = false
|
|
includeInBundle = false
|
|
}
|
|
}
|
|
create("gplay") {
|
|
dimension = "version"
|
|
signingConfig = signingConfigs["releaseGplay"]
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
val customProguardRules = fileTree(File(projectDir, "proguard")) {
|
|
include("*.pro")
|
|
}
|
|
debug {
|
|
isMinifyEnabled = false
|
|
isShrinkResources = false
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
|
|
proguardFiles(*customProguardRules.toList().toTypedArray())
|
|
proguardFiles("proguard-rules-debug.pro")
|
|
}
|
|
create("beta") {
|
|
lint {
|
|
abortOnError = true
|
|
fatal.add("StopShip")
|
|
}
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
|
|
proguardFiles(*customProguardRules.toList().toTypedArray())
|
|
}
|
|
release {
|
|
lint {
|
|
abortOnError = true
|
|
fatal.add("StopShip")
|
|
}
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
|
|
proguardFiles(*customProguardRules.toList().toTypedArray())
|
|
}
|
|
}
|
|
|
|
buildOutputs.all {
|
|
val variantOutputImpl = this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
|
|
val variantName: String = variantOutputImpl.name
|
|
|
|
if (listOf("release", "beta").any { variantName.lowercase().contains(it) }) {
|
|
val outputFileName = ProjectConfig.packageName +
|
|
"-v${defaultConfig.versionName}-${defaultConfig.versionCode}" +
|
|
"-${variantName.uppercase()}.apk"
|
|
|
|
variantOutputImpl.outputFileName = outputFileName
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding = true
|
|
}
|
|
|
|
compileOptions {
|
|
isCoreLibraryDesugaringEnabled = true
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
freeCompilerArgs = freeCompilerArgs + listOf(
|
|
"-opt-in=kotlin.ExperimentalStdlibApi",
|
|
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
|
"-opt-in=kotlinx.coroutines.FlowPreview",
|
|
"-opt-in=kotlin.time.ExperimentalTime",
|
|
"-opt-in=kotlin.RequiresOptIn",
|
|
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
|
"-Xannotation-default-target=param-property"
|
|
)
|
|
}
|
|
|
|
testOptions {
|
|
unitTests {
|
|
isIncludeAndroidResources = true
|
|
}
|
|
//noinspection WrongGradleMethod
|
|
tasks.withType<Test> {
|
|
useJUnitPlatform()
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
|
|
|
|
addBaseKotlin()
|
|
|
|
addDagger()
|
|
|
|
addMoshi()
|
|
|
|
addOkio()
|
|
|
|
addBaseAndroid()
|
|
addBaseAndroidUi()
|
|
|
|
implementation("androidx.core:core-splashscreen:1.0.0-alpha02")
|
|
|
|
addNavigation()
|
|
addBaseWorkManager()
|
|
|
|
addTesting()
|
|
|
|
"gplayImplementation"("com.android.billingclient:billing:8.0.0")
|
|
"gplayImplementation"("com.android.billingclient:billing-ktx:8.0.0")
|
|
} |