build.gradle 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. id "dev.flutter.flutter-gradle-plugin"
  5. }
  6. def localProperties = new Properties()
  7. def localPropertiesFile = rootProject.file('local.properties')
  8. if (localPropertiesFile.exists()) {
  9. localPropertiesFile.withReader('UTF-8') { reader ->
  10. localProperties.load(reader)
  11. }
  12. }
  13. def keystoreProperties = new Properties()
  14. def keystorePropertiesFile = rootProject.file('key.properties')
  15. if (keystorePropertiesFile.exists()) {
  16. keystorePropertiesFile.withReader('UTF-8') { reader ->
  17. keystoreProperties.load(reader)
  18. }
  19. }
  20. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  21. if (flutterVersionCode == null) {
  22. flutterVersionCode = '1'
  23. }
  24. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  25. if (flutterVersionName == null) {
  26. flutterVersionName = '1.0'
  27. }
  28. android {
  29. namespace "com.colormaprun.orienteering.app_business.app_business"
  30. compileSdkVersion flutter.compileSdkVersion
  31. // ndkVersion flutter.ndkVersion
  32. ndkVersion "25.1.8937393"
  33. compileOptions {
  34. sourceCompatibility JavaVersion.VERSION_1_8
  35. targetCompatibility JavaVersion.VERSION_1_8
  36. }
  37. kotlinOptions {
  38. jvmTarget = '1.8'
  39. }
  40. sourceSets {
  41. main.java.srcDirs += 'src/main/kotlin'
  42. }
  43. defaultConfig {
  44. applicationId "com.colormaprun.orienteering.app_business"
  45. minSdkVersion flutter.minSdkVersion
  46. targetSdkVersion flutter.targetSdkVersion
  47. versionCode flutterVersionCode.toInteger()
  48. versionName flutterVersionName
  49. }
  50. buildFeatures {
  51. buildConfig = true
  52. }
  53. signingConfigs {
  54. release {
  55. keyAlias keystoreProperties['keyAlias']
  56. keyPassword keystoreProperties['keyPassword']
  57. storeFile file(keystoreProperties['storeFile'])
  58. storePassword keystoreProperties['storePassword']
  59. }
  60. }
  61. buildTypes {
  62. release {
  63. minifyEnabled true
  64. shrinkResources true
  65. signingConfig signingConfigs.release
  66. }
  67. }
  68. flavorDimensions = ["default"]
  69. productFlavors {
  70. dev {
  71. dimension "default"
  72. resValue "string", "app_name", "dev flavor example"
  73. applicationIdSuffix ".dev"
  74. }
  75. prod {
  76. dimension "default"
  77. resValue "string", "app_name", "product flavor example"
  78. }
  79. }
  80. }
  81. flutter {
  82. source '../..'
  83. }
  84. dependencies {}