build.gradle 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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_1_8
  13. targetCompatibility = JavaVersion.VERSION_1_8
  14. }
  15. kotlinOptions {
  16. jvmTarget = JavaVersion.VERSION_1_8
  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. manifestPlaceholders = [
  35. JPUSH_PKGNAME: rootProject.ext.applicationId,
  36. JPUSH_APPKEY : "cd602bd396037438bb9ead5a", // NOTE: JPush 上注册的包名对应的 Appkey.
  37. JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
  38. ]
  39. }
  40. signingConfigs {
  41. location {
  42. storeFile file("keystore/location.jks")
  43. storePassword "location888"
  44. keyAlias "location"
  45. keyPassword "location888"
  46. }
  47. }
  48. buildTypes {
  49. debug {
  50. // Note: The debug build type must have the same signing config as the main build type.
  51. signingConfig signingConfigs.location
  52. }
  53. release {
  54. // TODO: Add your own signing config for the release build.
  55. // Signing with the debug keys for now, so `flutter run --release` works.
  56. minifyEnabled true
  57. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  58. signingConfig signingConfigs.location
  59. }
  60. }
  61. applicationVariants.configureEach { variant ->
  62. def date = new Date().format("YYMMddHHmmss")
  63. variant.outputs.configureEach {
  64. def fileName = "${defaultConfig.applicationId}" +
  65. "-v${defaultConfig.versionName}" +
  66. "-${variant.buildType.name}" +
  67. "-${date}" +
  68. ".apk"
  69. outputFileName = fileName
  70. }
  71. }
  72. }
  73. flutter {
  74. source = "../.."
  75. }