build.gradle 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. def localProperties = new Properties()
  8. def localPropertiesFile = rootProject.file("local.properties")
  9. if (localPropertiesFile.exists()) {
  10. localPropertiesFile.withReader("UTF-8") { reader ->
  11. localProperties.load(reader)
  12. }
  13. }
  14. def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
  15. if (flutterVersionCode == null) {
  16. flutterVersionCode = "1"
  17. }
  18. def flutterVersionName = localProperties.getProperty("flutter.versionName")
  19. if (flutterVersionName == null) {
  20. flutterVersionName = "1.0"
  21. }
  22. android {
  23. namespace = "com.atmob.elec_asst"
  24. compileSdk = rootProject.ext.compileSdkVersion
  25. ndkVersion = flutter.ndkVersion
  26. compileOptions {
  27. sourceCompatibility = JavaVersion.VERSION_1_8
  28. targetCompatibility = JavaVersion.VERSION_1_8
  29. }
  30. defaultConfig {
  31. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  32. applicationId = rootProject.ext.applicationId
  33. // You can update the following values to match your application needs.
  34. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
  35. minSdk = rootProject.ext.minSdkVersion
  36. targetSdk = rootProject.ext.targetSdkVersion
  37. versionCode = flutterVersionCode.toInteger()
  38. versionName = flutterVersionName
  39. ndk {
  40. //noinspection ChromeOsAbiSupport
  41. abiFilters "arm64-v8a"
  42. }
  43. }
  44. signingConfigs {
  45. ting {
  46. storeFile file("keystore/ting.jks")
  47. storePassword "ting888"
  48. keyAlias "ting"
  49. keyPassword "ting888"
  50. }
  51. assistant {
  52. storeFile file("keystore/assistant.jks")
  53. storePassword "assistant888"
  54. keyAlias "assistant"
  55. keyPassword "assistant888"
  56. }
  57. ling {
  58. storeFile file("keystore/ling.jks")
  59. storePassword "ling888"
  60. keyAlias "ling"
  61. keyPassword "ling888"
  62. }
  63. juan {
  64. storeFile file("keystore/juan.jks")
  65. storePassword "juan888"
  66. keyAlias "juan"
  67. keyPassword "juan888"
  68. }
  69. you {
  70. storeFile file("keystore/you.jks")
  71. storePassword "you888"
  72. keyAlias "you"
  73. keyPassword "you888"
  74. }
  75. }
  76. buildTypes {
  77. debug {
  78. // Note: The debug build type must have the same signing config as the main build type.
  79. signingConfig signingConfigs.assistant
  80. }
  81. release {
  82. // TODO: Add your own signing config for the release build.
  83. // Signing with the debug keys for now, so `flutter run --release` works.
  84. minifyEnabled true
  85. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  86. signingConfig signingConfigs.assistant
  87. }
  88. }
  89. buildFeatures {
  90. viewBinding true
  91. dataBinding true
  92. }
  93. applicationVariants.configureEach { variant ->
  94. def date = new Date().format("YYMMddHHmmss")
  95. variant.outputs.configureEach {
  96. def fileName = "${defaultConfig.applicationId}" +
  97. "-v${defaultConfig.versionName}" +
  98. "-${variant.buildType.name}" +
  99. "-${date}" +
  100. ".apk"
  101. outputFileName = fileName
  102. }
  103. }
  104. }
  105. dependencies {
  106. //AppCompat
  107. implementation "androidx.appcompat:appcompat:$rootProject.ext.appcompat_version"
  108. //ConstraintLayout
  109. implementation "androidx.constraintlayout:constraintlayout:$rootProject.ext.constraintlayout_version"
  110. //immersionbar
  111. implementation "com.geyifeng.immersionbar:immersionbar:$rootProject.ext.immersionbar_version"
  112. //oaid
  113. implementation 'extension.oaid:oaid:2.3.0'
  114. //友盟统计
  115. implementation 'com.umeng.umsdk:common:9.6.7'
  116. implementation 'com.umeng.umsdk:asms:1.8.0'
  117. implementation 'com.umeng.umsdk:apm:1.9.4'
  118. //渠道包信息读取
  119. implementation "extra.pack:channel:1.1.0-SNAPSHOT"
  120. }
  121. flutter {
  122. source = "../.."
  123. }