You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

173 lines
6.2 KiB

import java.util.Properties
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.compose")
}
// Machine-local signing credentials; never commit the keystore or passwords.
val releaseSigningProperties = Properties().apply {
val propertiesFile = rootProject.file("signing.properties")
if (propertiesFile.isFile) propertiesFile.inputStream().use { load(it) }
}
android {
namespace = "com.dct.app"
compileSdk = 34
defaultConfig {
applicationId = "com.dct.app"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0.2"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
signingConfigs {
create("release") {
storeFile = releaseSigningProperties.getProperty("storeFile")?.let { rootProject.file(it) }
storePassword = releaseSigningProperties.getProperty("storePassword")
keyAlias = releaseSigningProperties.getProperty("keyAlias")
keyPassword = releaseSigningProperties.getProperty("keyPassword")
}
}
buildTypes {
release {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
debug {
isMinifyEnabled = false
isDebuggable = true
}
}
applicationVariants.all {
if (buildType.name == "release") {
val appVersion = versionName
outputs.all {
(this as com.android.build.gradle.internal.api.BaseVariantOutputImpl)
.outputFileName = "dct_v${appVersion}.apk"
}
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlinOptions {
jvmTarget = "21"
freeCompilerArgs += listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api"
)
}
buildFeatures {
compose = true
viewBinding = true
buildConfig = true
}
packaging {
resources {
excludes += listOf(
"/META-INF/{AL2.0,LGPL2.1}",
"META-INF/INDEX.LIST",
"META-INF/io.netty.versions.properties",
"META-INF/DEPENDENCIES",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/license.txt",
"META-INF/NOTICE",
"META-INF/NOTICE.txt",
"META-INF/notice.txt"
)
}
}
testOptions {
unitTests.isReturnDefaultValues = true
unitTests.all {
it.useJUnitPlatform()
it.maxHeapSize = "2048m"
it.testLogging {
events("passed", "skipped", "failed")
showStandardStreams = false
}
}
}
}
dependencies {
// 1. Pure Java MDB Engine (Jackcess 4.0.11) & Apache Commons
implementation("com.healthmarketscience.jackcess:jackcess:4.0.11")
implementation("org.apache.commons:commons-lang3:3.14.0")
implementation("commons-logging:commons-logging:1.3.0")
// 2. Android Core & Lifecycle
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.activity:activity-ktx:1.8.2")
implementation("androidx.fragment:fragment-ktx:1.6.2")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.7.0")
// 3. Kotlin Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")
// 4. Jetpack Compose BOM & Material 3 (Stitch Design System)
implementation(platform("androidx.compose:compose-bom:2024.02.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
implementation("androidx.compose.foundation:foundation")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.material:material-icons-extended")
implementation("androidx.activity:activity-compose:1.8.2")
implementation("androidx.navigation:navigation-compose:2.7.7")
// 5. Unit Testing Framework (JUnit 5 Jupiter, Vintage, MockK, Coroutines Test, Truth, Turbine)
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("junit:junit:4.13.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.10.2")
testImplementation("io.mockk:mockk:1.13.9")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0")
testImplementation("com.google.truth:truth:1.4.1")
testImplementation("app.cash.turbine:turbine:1.1.0")
testImplementation("org.json:json:20240303")
// 6. Android Instrumented Tests
androidTestImplementation(platform("androidx.compose:compose-bom:2024.02.00"))
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
}
tasks.withType<Test>().configureEach {
binaryResultsDirectory.set(file("${layout.buildDirectory.get().asFile.absolutePath}/test-bin/${name}_${System.currentTimeMillis()}"))
}