88 lines
2.7 KiB
Kotlin
88 lines
2.7 KiB
Kotlin
|
|
import java.util.Properties
|
||
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||
|
|
|
||
|
|
plugins {
|
||
|
|
alias(libs.plugins.android.application)
|
||
|
|
alias(libs.plugins.kotlin.android)
|
||
|
|
alias(libs.plugins.kotlin.compose)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Release signing is wired up only when android/keystore.properties exists.
|
||
|
|
// That file holds the keystore passwords and is gitignored, as is the .jks
|
||
|
|
// itself — keep both outside the repo. See android/README.md for the
|
||
|
|
// keytool invocation that creates them.
|
||
|
|
val keystorePropsFile = rootProject.file("keystore.properties")
|
||
|
|
val keystoreProps = Properties().apply {
|
||
|
|
if (keystorePropsFile.exists()) keystorePropsFile.inputStream().use { load(it) }
|
||
|
|
}
|
||
|
|
|
||
|
|
android {
|
||
|
|
namespace = "ws.inflo.photogallery"
|
||
|
|
compileSdk = 36
|
||
|
|
|
||
|
|
defaultConfig {
|
||
|
|
applicationId = "ws.inflo.photogallery"
|
||
|
|
minSdk = 28 // ImageDecoder + HEIF decode both land here
|
||
|
|
targetSdk = 36
|
||
|
|
versionCode = 1
|
||
|
|
versionName = "0.1.0"
|
||
|
|
}
|
||
|
|
|
||
|
|
signingConfigs {
|
||
|
|
if (keystorePropsFile.exists()) {
|
||
|
|
create("release") {
|
||
|
|
storeFile = rootProject.file(keystoreProps.getProperty("storeFile"))
|
||
|
|
storePassword = keystoreProps.getProperty("storePassword")
|
||
|
|
keyAlias = keystoreProps.getProperty("keyAlias")
|
||
|
|
keyPassword = keystoreProps.getProperty("keyPassword")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
buildTypes {
|
||
|
|
release {
|
||
|
|
isMinifyEnabled = true
|
||
|
|
isShrinkResources = true
|
||
|
|
proguardFiles(
|
||
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||
|
|
"proguard-rules.pro",
|
||
|
|
)
|
||
|
|
// Falls back to unsigned when keystore.properties is absent, so a
|
||
|
|
// fresh clone still builds.
|
||
|
|
signingConfig = signingConfigs.findByName("release")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
compileOptions {
|
||
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
||
|
|
targetCompatibility = JavaVersion.VERSION_17
|
||
|
|
}
|
||
|
|
|
||
|
|
buildFeatures {
|
||
|
|
compose = true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
kotlin {
|
||
|
|
compilerOptions {
|
||
|
|
jvmTarget.set(JvmTarget.JVM_17)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
dependencies {
|
||
|
|
implementation(libs.androidx.core.ktx)
|
||
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||
|
|
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
||
|
|
implementation(libs.androidx.activity.compose)
|
||
|
|
implementation(platform(libs.androidx.compose.bom))
|
||
|
|
implementation(libs.androidx.ui)
|
||
|
|
implementation(libs.androidx.ui.graphics)
|
||
|
|
implementation(libs.androidx.ui.tooling.preview)
|
||
|
|
implementation(libs.androidx.material3)
|
||
|
|
implementation(libs.androidx.work.runtime.ktx)
|
||
|
|
implementation(libs.androidx.exifinterface)
|
||
|
|
implementation(libs.okhttp)
|
||
|
|
|
||
|
|
debugImplementation(libs.androidx.ui.tooling)
|
||
|
|
}
|