mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-05 12:38:24 +00:00
103 lines
3.2 KiB
Kotlin
103 lines
3.2 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")
|
|
}
|
|
|
|
// Load signing properties from key.properties (not checked into VCS)
|
|
val keystoreProperties = Properties()
|
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
android {
|
|
namespace = "dev.zapstore.alpha"
|
|
compileSdk = 36
|
|
ndkVersion = "27.0.12077973"
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
isCoreLibraryDesugaringEnabled = true
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_11.toString()
|
|
}
|
|
|
|
defaultConfig {
|
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
applicationId = "dev.zapstore.alpha"
|
|
// You can update the following values to match your application needs.
|
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
|
minSdk = 29
|
|
targetSdk = 36
|
|
versionCode = flutter.versionCode
|
|
versionName = flutter.versionName
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
val alias = keystoreProperties["keyAlias"] as String?
|
|
val keyPass = keystoreProperties["keyPassword"] as String?
|
|
val storePath = keystoreProperties["storeFile"] as String?
|
|
val storePass = keystoreProperties["storePassword"] as String?
|
|
|
|
if (!storePath.isNullOrBlank()) {
|
|
storeFile = file(storePath)
|
|
}
|
|
if (!alias.isNullOrBlank()) {
|
|
keyAlias = alias
|
|
}
|
|
if (!keyPass.isNullOrBlank()) {
|
|
keyPassword = keyPass
|
|
}
|
|
if (!storePass.isNullOrBlank()) {
|
|
storePassword = storePass
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
// Use release signing config when key.properties is present
|
|
signingConfig = signingConfigs.getByName("release")
|
|
// Enable code shrinking and resource optimization
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
dependenciesInfo {
|
|
// Disables dependency metadata when building APKs (for IzzyOnDroid/F-Droid)
|
|
includeInApk = false
|
|
// Disables dependency metadata when building Android App Bundles (for Google Play)
|
|
includeInBundle = false
|
|
}
|
|
|
|
packagingOptions {
|
|
jniLibs {
|
|
// Compress native .so files inside the APK to reduce artifact size
|
|
useLegacyPackaging = true
|
|
}
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|
|
|
|
dependencies {
|
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
|
implementation("androidx.lifecycle:lifecycle-process:2.7.0")
|
|
}
|