build.gradle 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 = flutter.ndkVersion
  11. compileOptions {
  12. sourceCompatibility = JavaVersion.VERSION_1_8
  13. targetCompatibility = JavaVersion.VERSION_1_8
  14. }
  15. kotlinOptions {
  16. jvmTarget = JavaVersion.VERSION_1_8
  17. }
  18. defaultConfig {
  19. applicationId = rootProject.ext.applicationId
  20. minSdk = rootProject.ext.minSdkVersion
  21. targetSdk = rootProject.ext.targetSdkVersion
  22. versionCode = flutter.versionCode
  23. versionName = flutter.versionName
  24. ndk {
  25. //noinspection ChromeOsAbiSupport
  26. // abiFilters "arm64-v8a"
  27. }
  28. }
  29. signingConfigs {
  30. location {
  31. storeFile file("keystore/location.jks")
  32. storePassword "location888"
  33. keyAlias "location"
  34. keyPassword "location888"
  35. }
  36. }
  37. buildTypes {
  38. debug {
  39. // Note: The debug build type must have the same signing config as the main build type.
  40. signingConfig signingConfigs.location
  41. }
  42. release {
  43. // TODO: Add your own signing config for the release build.
  44. // Signing with the debug keys for now, so `flutter run --release` works.
  45. minifyEnabled true
  46. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  47. signingConfig signingConfigs.location
  48. }
  49. }
  50. applicationVariants.configureEach { variant ->
  51. def date = new Date().format("YYMMddHHmmss")
  52. variant.outputs.configureEach {
  53. def fileName = "${defaultConfig.applicationId}" +
  54. "-v${defaultConfig.versionName}" +
  55. "-${variant.buildType.name}" +
  56. "-${date}" +
  57. ".apk"
  58. outputFileName = fileName
  59. }
  60. }
  61. }
  62. flutter {
  63. source = "../.."
  64. }