git / moonbite-network / mobile/android/app/build.gradle.kts · raw
import java.util.Propertiesimport java.io.FileInputStreamplugins { id("com.android.application") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin")}// Release signing credentials live OUTSIDE version control in key.properties// (gitignored). We never fall back to the debug keystore for a release build:// a wallet signed with the world-readable Android debug key can be trivially// re-signed and impersonated on the Play Store. See key.properties.example.val keystoreProperties = Properties()val keystorePropertiesFile = rootProject.file("key.properties")val hasReleaseKeystore = keystorePropertiesFile.exists()if (hasReleaseKeystore) { keystoreProperties.load(FileInputStream(keystorePropertiesFile))}android { namespace = "org.moonbite.moonbite_mobile" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } defaultConfig { applicationId = "org.moonbite.moonbite_mobile" // 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 } signingConfigs { if (hasReleaseKeystore) { create("release") { keyAlias = keystoreProperties["keyAlias"] as String keyPassword = keystoreProperties["keyPassword"] as String storeFile = keystoreProperties["storeFile"]?.let { file(it) } storePassword = keystoreProperties["storePassword"] as String } } } buildTypes { release { // A release build MUST be signed with the real upload key. If // key.properties is missing we fail the build rather than silently // shipping a debug-signed (and therefore forgeable) wallet. if (hasReleaseKeystore) { signingConfig = signingConfigs.getByName("release") } else { throw GradleException( "Release build requires android/key.properties (see " + "key.properties.example). Refusing to sign with the debug key." ) } } }}kotlin { compilerOptions { jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 }}flutter { source = "../.."}