86 lines
2.4 KiB
Kotlin
86 lines
2.4 KiB
Kotlin
import java.util.Properties
|
|
import java.io.FileInputStream
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("kotlin-android")
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
}
|
|
|
|
val keystoreProperties = Properties()
|
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
android {
|
|
namespace = "com.urukmap.app"
|
|
compileSdk = flutter.compileSdkVersion
|
|
ndkVersion = "28.2.13676358"
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "com.urukmap.app"
|
|
minSdk = flutter.minSdkVersion
|
|
targetSdk = flutter.targetSdkVersion
|
|
versionCode = flutter.versionCode
|
|
versionName = flutter.versionName
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
keyAlias = keystoreProperties["keyAlias"] as String?
|
|
keyPassword = keystoreProperties["keyPassword"] as String?
|
|
val storeFilePath = keystoreProperties["storeFile"] as String?
|
|
if (storeFilePath != null) {
|
|
storeFile = file(storeFilePath)
|
|
}
|
|
storePassword = keystoreProperties["storePassword"] as String?
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
val hasReleaseKey = keystorePropertiesFile.exists() && keystoreProperties["storeFile"] != null
|
|
signingConfig = if (hasReleaseKey) {
|
|
signingConfigs.getByName("release")
|
|
} else {
|
|
signingConfigs.getByName("debug")
|
|
}
|
|
|
|
// Enable R8 / ProGuard Code Optimization & Shrinking
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
|
|
ndk {
|
|
debugSymbolLevel = "none"
|
|
}
|
|
}
|
|
debug {
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.car.app:app:1.4.0")
|
|
implementation("androidx.car.app:app-projected:1.4.0")
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|