121 lines
4.0 KiB
Kotlin
121 lines
4.0 KiB
Kotlin
// :app — Android application entry point. Hosts MainActivity and the
|
|
// application manifest, including the launcher icon and theme.
|
|
//
|
|
// Version scheme (v0.3.0.0 onwards):
|
|
// versionName = "MAJOR.MINOR.MAINTENANCE.EMERGENCY"
|
|
// - MAJOR: large breaking redesigns (rare in v0.x)
|
|
// - MINOR: normal feature releases
|
|
// - MAINTENANCE: bug fixes / refactors on a given MINOR
|
|
// - EMERGENCY: 0 in normal releases; non-zero only for hotfixes
|
|
// shipped out-of-band (e.g. v0.2.0.1 — search-icon fix)
|
|
// versionCode: monotonic int. Always +1 per release.
|
|
//
|
|
// The validator below fails the build if versionName doesn't match the
|
|
// required dotted format, so we can't regress the scheme by accident.
|
|
import java.util.Properties
|
|
|
|
plugins {
|
|
alias(libs.plugins.androidApplication)
|
|
alias(libs.plugins.kotlinAndroid)
|
|
alias(libs.plugins.kotlinCompose)
|
|
}
|
|
|
|
android {
|
|
namespace = "org.incido.app"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "org.incido.app"
|
|
minSdk = 26
|
|
targetSdk = 35
|
|
// v0.3.3.4: emergency hotfix — the favorite star on the note
|
|
// cards was drawn in the title row and overlapped the
|
|
// three-dot overflow button in the card's top-right corner.
|
|
// The star is now an overlay in the card's bottom-right corner
|
|
// with the same 4.dp end offset as the overflow button, so
|
|
// both controls sit in the same vertical column and no longer
|
|
// collide. versionCode monotonic +1 from v0.3.3.3 (18).
|
|
versionCode = 19
|
|
versionName = "0.3.3.4"
|
|
}
|
|
|
|
// --- Signing ---
|
|
signingConfigs {
|
|
create("release") {
|
|
val keystoreFilePath = rootProject.file("keystore/release.jks")
|
|
if (keystoreFilePath.exists()) {
|
|
storeFile = keystoreFilePath
|
|
storePassword = "incido_dev_keystore"
|
|
keyAlias = "incido"
|
|
keyPassword = "incido_dev_keystore"
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
isMinifyEnabled = false
|
|
}
|
|
release {
|
|
isMinifyEnabled = false // TODO(v0.3.0.0+): enable R8
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(17)
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(":composeApp"))
|
|
// v0.3.1.0: MainActivity needs the NoteRepository type to hand it
|
|
// through to IncidoApp (used by the editor's full-screen image
|
|
// viewer + the list card thumbnails). It's the *interface* in
|
|
// :core:domain, not the impl, so this stays clean of ObjectBox.
|
|
implementation(project(":core:domain"))
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.kotlinx.coroutines.android)
|
|
// v0.3.2.0: MainActivity now extends FragmentActivity so the
|
|
// BiometricPrompt has a Fragment-based host.
|
|
implementation(libs.androidx.fragment.ktx)
|
|
|
|
val composeBom = platform(libs.composeBom)
|
|
implementation(composeBom)
|
|
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.compose.ui)
|
|
implementation(libs.compose.material3)
|
|
}
|
|
|
|
// --- Version-name scheme validator ---
|
|
//
|
|
// MAJOR.MINOR.MAINTENANCE.EMERGENCY — exactly four dotted integers.
|
|
// Fails fast so we can't accidentally publish a "0.3" again.
|
|
val versionScheme = Regex("""^\d+\.\d+\.\d+\.\d+$""")
|
|
|
|
gradle.taskGraph.whenReady {
|
|
val vn = android.defaultConfig.versionName
|
|
if (vn != null && !versionScheme.matches(vn)) {
|
|
throw GradleException(
|
|
"app versionName = \"$vn\" doesn't match the required " +
|
|
"MAJOR.MINOR.MAINTENANCE.EMERGENCY scheme (e.g. 0.3.0.0). " +
|
|
"Update app/build.gradle.kts."
|
|
)
|
|
}
|
|
} |