build.gradle.kts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import java.util.Properties
  2. val localPropertiesFile = rootProject.file("key.properties")
  3. val localProperties = Properties()
  4. if (localPropertiesFile.exists()) {
  5. localPropertiesFile.inputStream().use { inputStream ->
  6. localProperties.load(inputStream)
  7. }
  8. }
  9. plugins {
  10. id("com.android.application")
  11. id("kotlin-android")
  12. // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
  13. id("dev.flutter.flutter-gradle-plugin")
  14. id("com.google.gms.google-services")
  15. }
  16. android {
  17. namespace = "jigsort.solitaire.jigsaw.match.games"
  18. // compileSdk = flutter.compileSdkVersion
  19. // ndkVersion = flutter.ndkVersion
  20. compileSdk = 36
  21. ndkVersion = "27.0.12077973"
  22. compileOptions {
  23. sourceCompatibility = JavaVersion.VERSION_11
  24. targetCompatibility = JavaVersion.VERSION_11
  25. }
  26. kotlinOptions {
  27. jvmTarget = JavaVersion.VERSION_11.toString()
  28. }
  29. defaultConfig {
  30. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  31. applicationId = "jigsort.solitaire.jigsaw.match.games"
  32. // You can update the following values to match your application needs.
  33. // For more information, see: https://flutter.dev/to/review-gradle-config.
  34. // minSdk = flutter.minSdkVersion
  35. minSdk = 23
  36. targetSdk = flutter.targetSdkVersion
  37. versionCode = flutter.versionCode
  38. versionName = flutter.versionName
  39. }
  40. signingConfigs {
  41. create("release") { // 使用 create 方法来定义签名配置
  42. storeFile = file(localProperties.getProperty("storeFile"))
  43. storePassword = localProperties.getProperty("storePassword")
  44. keyAlias = localProperties.getProperty("keyAlias")
  45. keyPassword = localProperties.getProperty("keyPassword")
  46. }
  47. }
  48. buildTypes {
  49. release {
  50. // TODO: Add your own signing config for the release build.
  51. // Signing with the debug keys for now, so `flutter run --release` works.
  52. // signingConfig = signingConfigs.getByName("debug")
  53. signingConfig = signingConfigs.getByName("release")
  54. }
  55. }
  56. }
  57. flutter {
  58. source = "../.."
  59. }