基础库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 2.8 KiB

4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. def localProperties = new Properties()
  2. def localPropertiesFile = rootProject.file('local.properties')
  3. if (localPropertiesFile.exists()) {
  4. localPropertiesFile.withReader('UTF-8') { reader ->
  5. localProperties.load(reader)
  6. }
  7. }
  8. def flutterRoot = localProperties.getProperty('flutter.sdk')
  9. if (flutterRoot == null) {
  10. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  11. }
  12. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  13. if (flutterVersionCode == null) {
  14. flutterVersionCode = '1'
  15. }
  16. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  17. if (flutterVersionName == null) {
  18. flutterVersionName = '1.0'
  19. }
  20. apply plugin: 'com.android.application'
  21. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  22. // 导入MobSDK
  23. apply plugin: 'com.mob.sdk'
  24. MobSDK {
  25. appKey "30dc33054b635"
  26. appSecret "396e98c293130c9976fb7428b6b434d6"
  27. SecVerify {}
  28. SMSSDK {}
  29. }
  30. android {
  31. compileSdkVersion 28
  32. lintOptions {
  33. disable 'InvalidPackage'
  34. }
  35. defaultConfig {
  36. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  37. applicationId "cn.zhios.zhiying"
  38. minSdkVersion 19
  39. targetSdkVersion 28
  40. aaptOptions.cruncherEnabled = false
  41. aaptOptions.useNewCruncher = false
  42. multiDexEnabled true
  43. versionCode flutterVersionCode.toInteger()
  44. versionName flutterVersionName
  45. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  46. }
  47. signingConfigs{
  48. release {
  49. storeFile file("zhiying.jks")
  50. storePassword "zhioscom"
  51. keyAlias "zysh"
  52. keyPassword "zhioscom"
  53. v1SigningEnabled true
  54. v2SigningEnabled true
  55. }
  56. }
  57. flavorDimensions "app"
  58. buildTypes {
  59. release {
  60. minifyEnabled true
  61. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
  62. signingConfig signingConfigs.release
  63. }
  64. debug {
  65. minifyEnabled false
  66. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
  67. signingConfig signingConfigs.release
  68. }
  69. }
  70. dexOptions {
  71. //最大堆内存
  72. javaMaxHeapSize "4g"//4g
  73. //使用增量模式构建
  74. incremental true
  75. //是否支持大工程模式
  76. jumboMode = true
  77. //预编译
  78. preDexLibraries = false
  79. //线程数
  80. threadCount = 8
  81. }
  82. }
  83. flutter {
  84. source '../..'
  85. }
  86. dependencies {
  87. testImplementation 'junit:junit:4.12'
  88. androidTestImplementation 'androidx.test:runner:1.1.1'
  89. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  90. }