build.gradle 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. id "kotlin-kapt"
  5. id "dev.flutter.flutter-gradle-plugin"
  6. }
  7. def keystoreProperties = new Properties()
  8. def keystorePropertiesFile = rootProject.file('key.properties')
  9. if (keystorePropertiesFile.exists()) {
  10. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  11. }
  12. def localProperties = new Properties()
  13. def localPropertiesFile = rootProject.file('local.properties')
  14. if (localPropertiesFile.exists()) {
  15. localPropertiesFile.withReader('UTF-8') { reader ->
  16. localProperties.load(reader)
  17. }
  18. }
  19. def flutterRoot = localProperties.getProperty('flutter.sdk')
  20. if (flutterRoot == null) {
  21. throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  22. }
  23. android {
  24. namespace 'com.guadou.yyemployer'
  25. compileSdk 35
  26. compileOptions {
  27. sourceCompatibility JavaVersion.VERSION_17
  28. targetCompatibility JavaVersion.VERSION_17
  29. }
  30. kotlinOptions {
  31. jvmTarget = JavaVersion.VERSION_17
  32. }
  33. sourceSets {
  34. main.java.srcDirs += 'src/main/kotlin'
  35. }
  36. lintOptions {
  37. checkReleaseBuilds false
  38. }
  39. defaultConfig {
  40. applicationId "com.guadou.yyemployer"
  41. minSdkVersion 21
  42. targetSdkVersion 35
  43. versionCode 306
  44. versionName "3.0.6"
  45. multiDexEnabled true
  46. ndk {
  47. //选择要添加的对应 cpu 类型的 .so 库。
  48. // abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
  49. abiFilters 'armeabi-v7a', 'arm64-v8a'
  50. // abiFilters 'armeabi-v7a'
  51. // abiFilters 'arm64-v8a'
  52. }
  53. manifestPlaceholders = [
  54. JPUSH_PKGNAME : applicationId,
  55. JPUSH_APPKEY : "1234567890",
  56. JPUSH_CHANNEL : "developer-default",
  57. queryAllPackages: ""
  58. ]
  59. }
  60. //配置keystore签名
  61. signingConfigs {
  62. release {
  63. keyAlias keystoreProperties['keyAlias']
  64. keyPassword keystoreProperties['keyPassword']
  65. storeFile file(keystoreProperties['storeFile'])
  66. storePassword keystoreProperties['storePassword']
  67. }
  68. debug {
  69. }
  70. }
  71. buildTypes {
  72. release {
  73. signingConfig signingConfigs.release
  74. //默认系统混淆
  75. minifyEnabled true
  76. //是否可调试
  77. debuggable false
  78. //Zipalign优化
  79. zipAlignEnabled true
  80. //移除无用的resource文件
  81. shrinkResources true
  82. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  83. }
  84. debug {
  85. signingConfig signingConfigs.release
  86. //是否可调试
  87. debuggable true
  88. }
  89. }
  90. }
  91. flutter {
  92. source '../..'
  93. }
  94. dependencies {
  95. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.0"
  96. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0"
  97. implementation 'com.github.bumptech.glide:glide:4.11.0'
  98. kapt 'com.github.bumptech.glide:compiler:4.11.0'
  99. implementation 'androidx.appcompat:appcompat:1.6.1' //加入AndroidX依赖
  100. implementation 'com.android.support:multidex:1.0.3'
  101. // implementation 'androidx.core:core-splashscreen:1.0.0' //启动12兼容
  102. }