build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
  5. id "dev.flutter.flutter-gradle-plugin"
  6. }
  7. android {
  8. namespace = "com.trace.location"
  9. compileSdk = rootProject.ext.compileSdkVersion
  10. ndkVersion = rootProject.ext.ndkVersion
  11. compileOptions {
  12. sourceCompatibility = JavaVersion.VERSION_11
  13. targetCompatibility = JavaVersion.VERSION_11
  14. }
  15. kotlinOptions {
  16. jvmTarget = JavaVersion.VERSION_11
  17. }
  18. configurations.configureEach {
  19. resolutionStrategy {
  20. // don't cache changing modules at all
  21. cacheChangingModulesFor 10, 'seconds'
  22. }
  23. }
  24. defaultConfig {
  25. applicationId = rootProject.ext.applicationId
  26. minSdk = rootProject.ext.minSdkVersion
  27. targetSdk = rootProject.ext.targetSdkVersion
  28. versionCode = flutter.versionCode
  29. versionName = flutter.versionName
  30. ndk {
  31. //noinspection ChromeOsAbiSupport
  32. abiFilters "arm64-v8a"
  33. }
  34. }
  35. signingConfigs {
  36. location {
  37. storeFile file("keystore/location.jks")
  38. storePassword "location888"
  39. keyAlias "location"
  40. keyPassword "location888"
  41. }
  42. }
  43. buildTypes {
  44. debug {
  45. // Note: The debug build type must have the same signing config as the main build type.
  46. signingConfig signingConfigs.location
  47. }
  48. release {
  49. // TODO: Add your own signing config for the release build.
  50. // Signing with the debug keys for now, so `flutter run --release` works.
  51. minifyEnabled true
  52. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  53. signingConfig signingConfigs.location
  54. }
  55. }
  56. applicationVariants.configureEach { variant ->
  57. def date = new Date().format("YYMMddHHmmss")
  58. variant.outputs.configureEach {
  59. def fileName = "${defaultConfig.applicationId}" +
  60. "-v${defaultConfig.versionName}" +
  61. "-${variant.buildType.name}" +
  62. "-${date}" +
  63. ".apk"
  64. outputFileName = fileName
  65. }
  66. }
  67. }
  68. flutter {
  69. source = "../.."
  70. }