build.gradle 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. plugins {
  2. id 'com.android.application'
  3. id 'org.jetbrains.kotlin.android'
  4. id 'kotlin-android-extensions'
  5. id 'kotlin-kapt'
  6. }
  7. kapt {
  8. arguments {
  9. arg("AROUTER_MODULE_NAME", project.getName())
  10. }
  11. }
  12. //多渠道打包
  13. apply plugin: 'walle'
  14. def appId = "com.yingyangfly"
  15. android {
  16. signingConfigs {
  17. debug {
  18. storeFile file(RELEASE_STOREFILE)
  19. storePassword RELEASE_STORE_PASSWORD
  20. keyAlias RELEASE_KEY_ALIAS
  21. keyPassword RELEASE_KEY_PASSWORD
  22. }
  23. release {
  24. storeFile file(RELEASE_STOREFILE)
  25. storePassword RELEASE_STORE_PASSWORD
  26. keyAlias RELEASE_KEY_ALIAS
  27. keyPassword RELEASE_KEY_PASSWORD
  28. }
  29. }
  30. compileSdkVersion rootProject.ext.android.compileSdkVersion
  31. defaultConfig {
  32. applicationId appId
  33. minSdkVersion rootProject.ext.android.minSdkVersion
  34. targetSdkVersion rootProject.ext.android.targetSdkVersion
  35. versionCode rootProject.ext.android.versionCode
  36. versionName rootProject.ext.android.versionName
  37. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  38. vectorDrawables.useSupportLibrary = true
  39. multiDexEnabled true
  40. // 只保留指定和默认的资源
  41. resConfigs "zh"//去掉无用的国际语言
  42. ndkVersion '22.1.7171670'
  43. ndk {
  44. //选择要添加的对应 cpu 类型的 .so 库。
  45. abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
  46. // 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
  47. }
  48. }
  49. buildTypes {
  50. debug {
  51. minifyEnabled false // 打开混淆
  52. shrinkResources false // 是否清理无用资源,依赖于minifyEnabled
  53. zipAlignEnabled true // 是否启用zipAlign压缩
  54. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  55. signingConfig signingConfigs.debug
  56. debuggable true
  57. resValue "string", "app_name", "未来蓝豚认知平台dev"
  58. manifestPlaceholders = [ENVIRONMENT: "appdebug",
  59. app_icon : "@mipmap/ic_launcher", package_name: appId]
  60. }
  61. release {
  62. minifyEnabled false // 打开混淆
  63. shrinkResources false // 是否清理无用资源,依赖于minifyEnabled
  64. zipAlignEnabled true // 是否启用zipAlign压缩
  65. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  66. signingConfig signingConfigs.release
  67. debuggable true
  68. resValue "string", "app_name", "未来蓝豚认知平台"
  69. manifestPlaceholders = [ENVIRONMENT: "appdebug",
  70. app_icon : "@mipmap/ic_launcher", package_name: appId]
  71. }
  72. }
  73. compileOptions {
  74. sourceCompatibility JavaVersion.VERSION_1_8
  75. targetCompatibility JavaVersion.VERSION_1_8
  76. }
  77. kotlinOptions {
  78. jvmTarget = '1.8'
  79. }
  80. lintOptions {
  81. checkReleaseBuilds false
  82. abortOnError false
  83. }
  84. buildFeatures {
  85. dataBinding true
  86. }
  87. }
  88. dependencies {
  89. implementation project(path: ':baselib')
  90. implementation project(path: ':webview')
  91. implementation project(path: ':workbenches')
  92. implementation project(path: ':personalcenter')
  93. implementation project(path: ':livebroadcast')
  94. implementation project(path: ':login')
  95. implementation project(path: ':push')
  96. implementation project(path: ':home')
  97. implementation project(path: ':mmse')
  98. implementation project(path: ':moca')
  99. implementation project(path: ':healthconsultation')
  100. implementation project(path: ':game')
  101. implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
  102. implementation(rootProject.ext.androidx.kotlin_lib)
  103. implementation(rootProject.ext.androidx.kotlin_core)
  104. implementation(rootProject.ext.androidx.appcompat)
  105. implementation(rootProject.ext.androidx.material)
  106. implementation(rootProject.ext.androidx.constraintlayout)
  107. testApi(rootProject.ext.androidx.junit)
  108. androidTestApi(rootProject.ext.androidx.runner)
  109. androidTestApi(rootProject.ext.androidx.espresso_core)
  110. }
  111. walle {
  112. // 指定渠道包的输出路径
  113. apkOutputFolder = new File("${project.buildDir}/outputs/channels")
  114. // 定制渠道包的APK的文件名称
  115. apkFileNameFormat = '${channel}-${buildType}-${appName}-v${versionName}-${versionCode}-${buildTime}.apk'
  116. // 渠道配置文件
  117. channelFile = new File("${project.getProjectDir()}/channel")
  118. }