123 lines
4.3 KiB
Kotlin
123 lines
4.3 KiB
Kotlin
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
id("com.google.dagger.hilt.android")
|
|
kotlin("kapt")
|
|
}
|
|
|
|
val gitShaProvider = providers.exec {
|
|
workingDir = rootDir.resolve("../..")
|
|
commandLine("git", "rev-parse", "--short=12", "HEAD")
|
|
}.standardOutput.asText.map { it.trim().ifBlank { "dev" } }
|
|
|
|
val gitSha: String = runCatching { gitShaProvider.get() }.getOrDefault("dev")
|
|
|
|
android {
|
|
namespace = "de.yourpart.nativeapp"
|
|
compileSdk = 36
|
|
|
|
defaultConfig {
|
|
applicationId = "de.yourpart.nativeapp"
|
|
minSdk = 26
|
|
targetSdk = 36
|
|
versionCode = 1
|
|
versionName = "0.1.0"
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
buildConfigField("String", "GIT_SHA", "\"$gitSha\"")
|
|
}
|
|
|
|
flavorDimensions += "environment"
|
|
productFlavors {
|
|
create("local") {
|
|
dimension = "environment"
|
|
applicationIdSuffix = ".local"
|
|
versionNameSuffix = "-local"
|
|
buildConfigField("String", "API_BASE_URL", "\"http://10.0.2.2:2020\"")
|
|
buildConfigField("String", "SOCKET_IO_URL", "\"http://10.0.2.2:2020\"")
|
|
buildConfigField("String", "DAEMON_SOCKET_URL", "\"ws://10.0.2.2:2021\"")
|
|
}
|
|
create("staging") {
|
|
dimension = "environment"
|
|
applicationIdSuffix = ".staging"
|
|
versionNameSuffix = "-staging"
|
|
buildConfigField("String", "API_BASE_URL", "\"https://staging.your-part.de\"")
|
|
buildConfigField("String", "SOCKET_IO_URL", "\"https://staging.your-part.de\"")
|
|
buildConfigField("String", "DAEMON_SOCKET_URL", "\"wss://staging.your-part.de\"")
|
|
}
|
|
create("production") {
|
|
dimension = "environment"
|
|
buildConfigField("String", "API_BASE_URL", "\"https://www.your-part.de\"")
|
|
buildConfigField("String", "SOCKET_IO_URL", "\"https://www.your-part.de\"")
|
|
buildConfigField("String", "DAEMON_SOCKET_URL", "\"wss://www.your-part.de\"")
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix = ".debug"
|
|
versionNameSuffix = "-debug"
|
|
}
|
|
release {
|
|
isMinifyEnabled = false
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro",
|
|
)
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
compose = true
|
|
}
|
|
|
|
lint {
|
|
abortOnError = true
|
|
checkReleaseBuilds = true
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget.set(JvmTarget.JVM_17)
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.core:core-ktx:1.17.0")
|
|
implementation("androidx.activity:activity-compose:1.13.0")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.10.0")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.10.0")
|
|
implementation("androidx.navigation:navigation-compose:2.9.6")
|
|
implementation("androidx.compose.material3:material3:1.4.0")
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
|
|
implementation("com.squareup.retrofit2:retrofit:3.0.0")
|
|
implementation("com.squareup.okhttp3:okhttp:5.3.2")
|
|
implementation("com.squareup.okhttp3:logging-interceptor:5.3.2")
|
|
implementation("com.google.dagger:hilt-android:2.57.2")
|
|
kapt("com.google.dagger:hilt-android-compiler:2.57.2")
|
|
implementation("androidx.room:room-runtime:2.6.1")
|
|
implementation("androidx.room:room-ktx:2.6.1")
|
|
kapt("androidx.room:room-compiler:2.6.1")
|
|
implementation("androidx.datastore:datastore-preferences:1.1.7")
|
|
implementation("io.coil-kt:coil-compose:2.6.0")
|
|
implementation("androidx.work:work-runtime-ktx:2.8.1")
|
|
implementation("com.google.firebase:firebase-messaging:24.1.2")
|
|
|
|
testImplementation("junit:junit:4.13.2")
|
|
androidTestImplementation("androidx.test.ext:junit:1.3.0")
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.7.0")
|
|
}
|