Initial commit. v0.0.1
This commit is contained in:
103
app/build.gradle.kts
Normal file
103
app/build.gradle.kts
Normal file
@@ -0,0 +1,103 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.plugin.compose")
|
||||
id("com.android.application")
|
||||
kotlin("android")
|
||||
kotlin("kapt")
|
||||
}
|
||||
|
||||
// === Läs local.properties utan java.util.Properties ===
|
||||
val localProps: Map<String, String> = run {
|
||||
val file = rootProject.file("local.properties")
|
||||
if (!file.exists()) emptyMap()
|
||||
else file.readLines()
|
||||
.asSequence()
|
||||
.map { it.trim() }
|
||||
.filter { it.isNotEmpty() && !it.startsWith("#") && it.contains("=") }
|
||||
.map {
|
||||
val i = it.indexOf('=')
|
||||
val k = it.substring(0, i).trim()
|
||||
val v = it.substring(i + 1).trim()
|
||||
k to v
|
||||
}
|
||||
.toMap()
|
||||
}
|
||||
|
||||
fun propOrEmpty(key: String) = localProps[key] ?: ""
|
||||
// ======================================================
|
||||
|
||||
|
||||
android {
|
||||
namespace = "com.example.yorlik"
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.yorlik"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
// BuildConfig-fält (åtkomst i Kotlin via BuildConfig.X)
|
||||
buildConfigField("String", "SERVER_API_BASE_URL", "\"${propOrEmpty("SERVER_API_BASE_URL")}\"")
|
||||
buildConfigField("String", "SERVER_API_KEY", "\"${propOrEmpty("SERVER_API_KEY")}\"")
|
||||
buildConfigField("String", "WEB_CLIENT_ID", "\"${propOrEmpty("WEB_CLIENT_ID")}\"")
|
||||
|
||||
// Skicka Maps‑nyckeln som manifest‑placeholder (används i AndroidManifest.xml)
|
||||
manifestPlaceholders["MAPS_API_KEY"] = propOrEmpty("MAPS_API_KEY")
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
kotlinOptions { jvmTarget = "17" }
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Compose
|
||||
val composeBom = platform("androidx.compose:compose-bom:2025.01.00")
|
||||
implementation(composeBom)
|
||||
androidTestImplementation(composeBom)
|
||||
implementation("androidx.activity:activity-compose:1.9.3")
|
||||
implementation("androidx.compose.ui:ui")
|
||||
implementation("androidx.compose.material3:material3:1.3.0")
|
||||
implementation("androidx.compose.ui:ui-tooling-preview")
|
||||
debugImplementation("androidx.compose.ui:ui-tooling")
|
||||
implementation("com.google.android.material:material:1.12.0")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.9.0")
|
||||
// --- Nätverk ---
|
||||
implementation("com.squareup.retrofit2:retrofit:2.11.0")
|
||||
implementation("com.squareup.retrofit2:converter-moshi:2.11.0")
|
||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
|
||||
implementation("com.squareup.moshi:moshi-kotlin:1.15.1")
|
||||
// Google Maps (Compose + Play Services)
|
||||
implementation("com.google.maps.android:maps-compose:4.4.1")
|
||||
implementation("com.google.android.gms:play-services-maps:18.2.0")
|
||||
|
||||
// Google Sign-In
|
||||
implementation("com.google.android.gms:play-services-auth:21.2.0")
|
||||
|
||||
// Lifecycle
|
||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
|
||||
|
||||
// Room
|
||||
val room = "2.6.1"
|
||||
implementation("androidx.room:room-runtime:$room")
|
||||
kapt("androidx.room:room-compiler:$room")
|
||||
implementation("androidx.room:room-ktx:$room")
|
||||
|
||||
// Play Services Location
|
||||
implementation("com.google.android.gms:play-services-location:21.3.0")
|
||||
|
||||
// Coroutines
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
|
||||
|
||||
// WorkManager (valfritt, ej nödvändigt här)
|
||||
implementation("androidx.work:work-runtime-ktx:2.9.1")
|
||||
}
|
||||
Reference in New Issue
Block a user