import java.util.Properties import java.io.FileInputStream 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") } // 릴리스 서명 키: android/key.properties 에서 읽음(파일은 git 제외). // 파일이 없으면(다른 개발자/CI) debug 키로 폴백하여 빌드는 깨지지 않게 함. val keystoreProperties = Properties() val keystorePropertiesFile = rootProject.file("key.properties") val hasReleaseKeystore = keystorePropertiesFile.exists() if (hasReleaseKeystore) { keystoreProperties.load(FileInputStream(keystorePropertiesFile)) } android { namespace = "com.specialpartners.spin" 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.specialpartners.spin" // 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") { storeFile = file(keystoreProperties["storeFile"] as String) storePassword = keystoreProperties["storePassword"] as String keyAlias = keystoreProperties["keyAlias"] as String keyPassword = keystoreProperties["keyPassword"] as String } } } buildTypes { release { // key.properties 있으면 release 키로 서명, 없으면 debug 키 폴백. signingConfig = if (hasReleaseKeystore) { signingConfigs.getByName("release") } else { signingConfigs.getByName("debug") } } } } kotlin { compilerOptions { jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 } } flutter { source = "../.." }