145 lines
5.2 KiB
Kotlin
145 lines
5.2 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("com.google.devtools.ksp")
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
id("com.google.dagger.hilt.android")
|
|
}
|
|
|
|
val localApiBaseUrl = providers.gradleProperty("LOCAL_API_BASE_URL")
|
|
.orElse("https://harheimertc.tsschulz.de/")
|
|
.get()
|
|
val sentryDsn = providers.gradleProperty("SENTRY_DSN")
|
|
.orElse("")
|
|
.get()
|
|
|
|
android {
|
|
namespace = "de.harheimertc"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "de.harheimertc"
|
|
minSdk = 24
|
|
targetSdk = 34
|
|
versionCode = 1
|
|
versionName = "0.1.0"
|
|
}
|
|
|
|
flavorDimensions += "environment"
|
|
productFlavors {
|
|
create("local") {
|
|
dimension = "environment"
|
|
applicationIdSuffix = ".local"
|
|
versionNameSuffix = "-local"
|
|
buildConfigField("String", "API_BASE_URL", "\"$localApiBaseUrl\"")
|
|
buildConfigField("String", "SENTRY_DSN", "\"\"")
|
|
buildConfigField("String", "ENVIRONMENT_NAME", "\"LOCAL\"")
|
|
manifestPlaceholders["usesCleartextTraffic"] = "true"
|
|
}
|
|
create("instantTest") {
|
|
dimension = "environment"
|
|
applicationIdSuffix = ".test"
|
|
versionNameSuffix = "-test"
|
|
buildConfigField("String", "API_BASE_URL", "\"https://harheimertc.tsschulz.de/\"")
|
|
buildConfigField("String", "SENTRY_DSN", "\"$sentryDsn\"")
|
|
buildConfigField("String", "ENVIRONMENT_NAME", "\"TEST\"")
|
|
manifestPlaceholders["usesCleartextTraffic"] = "false"
|
|
}
|
|
create("production") {
|
|
dimension = "environment"
|
|
buildConfigField("String", "API_BASE_URL", "\"https://harheimertc.tsschulz.de/\"")
|
|
buildConfigField("String", "SENTRY_DSN", "\"$sentryDsn\"")
|
|
buildConfigField("String", "ENVIRONMENT_NAME", "\"\"")
|
|
manifestPlaceholders["usesCleartextTraffic"] = "false"
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = true
|
|
}
|
|
|
|
compileOptions {
|
|
isCoreLibraryDesugaringEnabled = true
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
testOptions {
|
|
unitTests.all {
|
|
// allow Byte Buddy experimental features for newer JVMs
|
|
it.jvmArgs = listOf("-Dnet.bytebuddy.experimental=true")
|
|
}
|
|
}
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
|
|
implementation("androidx.core:core-ktx:1.10.1")
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
|
|
// Compose
|
|
implementation("androidx.compose.ui:ui:1.5.0")
|
|
implementation("androidx.compose.ui:ui-tooling-preview:1.5.0")
|
|
debugImplementation("androidx.compose.ui:ui-tooling:1.5.0")
|
|
implementation("androidx.compose.material3:material3:1.1.0")
|
|
implementation("androidx.navigation:navigation-compose:2.6.0")
|
|
implementation("androidx.hilt:hilt-navigation-compose:1.0.0")
|
|
|
|
// Lifecycle
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
|
|
|
|
// Hilt
|
|
implementation("com.google.dagger:hilt-android:2.59.2")
|
|
ksp("com.google.dagger:hilt-compiler:2.59.2")
|
|
|
|
// Networking
|
|
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
|
implementation("com.squareup.okhttp3:okhttp:4.11.0")
|
|
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")
|
|
implementation("com.squareup.okhttp3:okhttp-urlconnection:4.11.0")
|
|
implementation("com.squareup.retrofit2:converter-moshi:2.9.0")
|
|
implementation("com.squareup.moshi:moshi-kotlin:1.15.1")
|
|
|
|
// Passkeys / Credential Manager
|
|
implementation("androidx.credentials:credentials:1.6.0")
|
|
implementation("androidx.credentials:credentials-play-services-auth:1.6.0")
|
|
|
|
// Coil
|
|
implementation("io.coil-kt:coil-compose:2.4.0")
|
|
|
|
// Crash reporting
|
|
implementation("io.sentry:sentry-android:8.42.0")
|
|
|
|
// Room
|
|
implementation("androidx.room:room-runtime:2.6.1")
|
|
ksp("androidx.room:room-compiler:2.6.1")
|
|
implementation("androidx.room:room-ktx:2.6.1")
|
|
|
|
// WorkManager, DataStore
|
|
implementation("androidx.work:work-runtime-ktx:2.8.1")
|
|
implementation("androidx.datastore:datastore-preferences:1.0.0")
|
|
implementation("androidx.security:security-crypto:1.1.0-alpha06")
|
|
|
|
// Testing (skeleton)
|
|
testImplementation("junit:junit:4.13.2")
|
|
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
|
|
testImplementation("io.mockk:mockk:1.13.7")
|
|
// Compose UI testing
|
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.0")
|
|
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
|
// Hilt testing
|
|
androidTestImplementation("com.google.dagger:hilt-android-testing:2.59.2")
|
|
// Ensure Hilt runtime is available in the test APK so HiltTestApplication can be instantiated
|
|
androidTestImplementation("com.google.dagger:hilt-android:2.59.2")
|
|
kspAndroidTest("com.google.dagger:hilt-compiler:2.59.2")
|
|
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.0")
|
|
}
|