99 lines
3.4 KiB
Kotlin
99 lines
3.4 KiB
Kotlin
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
}
|
|
|
|
val configuredApiUrl = providers.gradleProperty("KEEPLY_API_BASE_URL")
|
|
.orElse("https://api.pantrymanager.kitchen")
|
|
.get()
|
|
.trimEnd('/')
|
|
|
|
val signingProperties = Properties().apply {
|
|
val propertiesFile = rootProject.file("signing.properties")
|
|
if (propertiesFile.isFile) propertiesFile.inputStream().use(::load)
|
|
}
|
|
|
|
android {
|
|
namespace = "com.keeply.pantry"
|
|
compileSdk = 36
|
|
|
|
defaultConfig {
|
|
applicationId = "com.keeply.pantry"
|
|
minSdk = 23
|
|
targetSdk = 36
|
|
versionCode = 1
|
|
versionName = "1.0.0"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables.useSupportLibrary = true
|
|
buildConfigField("String", "API_BASE_URL", "\"$configuredApiUrl\"")
|
|
manifestPlaceholders["allowCleartextTraffic"] = "false"
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
storeFile = rootProject.file(signingProperties.getProperty("storeFile"))
|
|
storePassword = signingProperties.getProperty("storePassword")
|
|
keyAlias = signingProperties.getProperty("keyAlias")
|
|
keyPassword = signingProperties.getProperty("keyPassword")
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
manifestPlaceholders["allowCleartextTraffic"] = "true"
|
|
}
|
|
release {
|
|
isMinifyEnabled = true
|
|
signingConfig = signingConfigs.getByName("release")
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro",
|
|
)
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
isCoreLibraryDesugaringEnabled = true
|
|
}
|
|
kotlinOptions.jvmTarget = "17"
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = true
|
|
}
|
|
|
|
packaging.resources.excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
|
|
dependencies {
|
|
val composeBom = platform("androidx.compose:compose-bom:2025.05.01")
|
|
|
|
implementation(composeBom)
|
|
androidTestImplementation(composeBom)
|
|
implementation("androidx.core:core-ktx:1.16.0")
|
|
implementation("androidx.activity:activity-compose:1.10.1")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.1")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.9.1")
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
implementation("androidx.compose.foundation:foundation")
|
|
implementation("androidx.compose.material3:material3")
|
|
implementation("androidx.compose.material:material-icons-extended")
|
|
implementation("androidx.security:security-crypto:1.1.0-alpha06")
|
|
implementation("com.google.android.gms:play-services-code-scanner:16.1.0")
|
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
|
|
|
|
testImplementation("junit:junit:4.13.2")
|
|
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
debugImplementation("androidx.compose.ui:ui-test-manifest")
|
|
}
|