2026-06-11 22:16:57 +02:00
|
|
|
import java.util.Properties
|
|
|
|
|
import java.io.FileInputStream
|
|
|
|
|
|
2026-06-02 23:28:39 +02:00
|
|
|
plugins {
|
|
|
|
|
id("com.android.application")
|
|
|
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
|
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-11 22:16:57 +02:00
|
|
|
// Release signing is read from android/key.properties (kept out of version
|
|
|
|
|
// control). When it is absent we fall back to the debug key so that
|
|
|
|
|
// `flutter run --release` keeps working during development — but a build meant
|
|
|
|
|
// for distribution must provide a real keystore here.
|
|
|
|
|
val keystoreProperties = Properties()
|
|
|
|
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
|
|
|
val hasReleaseKeystore = keystorePropertiesFile.exists()
|
|
|
|
|
if (hasReleaseKeystore) {
|
|
|
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-02 23:28:39 +02:00
|
|
|
android {
|
|
|
|
|
namespace = "com.example.ocideck"
|
|
|
|
|
compileSdk = flutter.compileSdkVersion
|
|
|
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
|
|
|
applicationId = "com.example.ocideck"
|
|
|
|
|
// You can update the following values to match your application needs.
|
|
|
|
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
|
|
|
|
minSdk = flutter.minSdkVersion
|
|
|
|
|
targetSdk = flutter.targetSdkVersion
|
|
|
|
|
versionCode = flutter.versionCode
|
|
|
|
|
versionName = flutter.versionName
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-11 22:16:57 +02:00
|
|
|
signingConfigs {
|
|
|
|
|
if (hasReleaseKeystore) {
|
|
|
|
|
create("release") {
|
|
|
|
|
keyAlias = keystoreProperties["keyAlias"] as String
|
|
|
|
|
keyPassword = keystoreProperties["keyPassword"] as String
|
|
|
|
|
storeFile = file(keystoreProperties["storeFile"] as String)
|
|
|
|
|
storePassword = keystoreProperties["storePassword"] as String
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-02 23:28:39 +02:00
|
|
|
buildTypes {
|
|
|
|
|
release {
|
2026-06-11 22:16:57 +02:00
|
|
|
// Use the real release keystore when configured; otherwise fall back
|
|
|
|
|
// to the debug key so `flutter run --release` still works locally.
|
|
|
|
|
// Do NOT distribute a build signed with the debug key.
|
|
|
|
|
signingConfig = if (hasReleaseKeystore) {
|
|
|
|
|
signingConfigs.getByName("release")
|
|
|
|
|
} else {
|
|
|
|
|
signingConfigs.getByName("debug")
|
|
|
|
|
}
|
2026-06-02 23:28:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
|
compilerOptions {
|
|
|
|
|
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flutter {
|
|
|
|
|
source = "../.."
|
|
|
|
|
}
|