build.gradle 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. if (componentTag){
  2. apply plugin: 'com.android.application'
  3. apply plugin: 'com.enation.javashop.aspectjrt'
  4. }else{
  5. apply plugin: 'com.android.library'
  6. }
  7. apply plugin: 'kotlin-android'
  8. apply plugin: 'kotlin-android-extensions'
  9. apply plugin: 'kotlin-kapt'
  10. kapt {
  11. arguments {
  12. arg("moduleName", project.getName())
  13. }
  14. }
  15. android {
  16. compileSdkVersion target_sdk_version
  17. buildToolsVersion build_tools_version
  18. defaultConfig {
  19. if (componentTag){
  20. applicationId "com.wdkl.ncs.android.component.welcome"
  21. multiDexEnabled true
  22. }
  23. minSdkVersion min_sdk_version
  24. targetSdkVersion target_sdk_version
  25. versionCode app_version_code
  26. versionName app_version
  27. dataBinding {
  28. enabled = true
  29. }
  30. buildConfigField 'String', 'isandroid_bed', "\"${project.rootProject.ext.android_bed}\""
  31. buildConfigField 'String', 'device_type', "\"${project.rootProject.ext.device_type}\""
  32. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  33. }
  34. lintOptions {
  35. abortOnError false
  36. }
  37. buildTypes {
  38. release {
  39. minifyEnabled false
  40. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  41. }
  42. }
  43. sourceSets {
  44. main.java.srcDirs += 'src/main/code'
  45. if(componentTag){
  46. main.manifest.srcFile 'src/main/ApkBuildDir/AndroidManifest.xml'
  47. }else{
  48. main.manifest.srcFile 'src/main/AndroidManifest.xml'
  49. main.java {
  50. exclude 'apkbuild/**'
  51. }
  52. }
  53. }
  54. compileOptions {
  55. sourceCompatibility JavaVersion.VERSION_1_8
  56. targetCompatibility JavaVersion.VERSION_1_8
  57. }
  58. }
  59. dependencies {
  60. compile fileTree(include: ['*.jar'], dir: 'libs')
  61. /**
  62. * constraint-layout布局依赖
  63. */
  64. implementation("androidx.constraintlayout:constraintlayout:2.1.4")
  65. /**
  66. * 单元测试
  67. */
  68. testCompile 'junit:junit:4.12'
  69. /**
  70. * 公共库依赖
  71. */
  72. compile project(':middleware')
  73. compile project(':resource')
  74. /**
  75. * Dagger编译依赖
  76. */
  77. kapt 'com.google.dagger:dagger-compiler:2.7'
  78. /**
  79. * 路由注解处理器
  80. */
  81. kapt "com.enation.geamtear:jrouter-compiler:$router_version"
  82. }
  83. /**
  84. * kawo组件化框架配置
  85. */
  86. if(componentTag){
  87. kawo {
  88. /**
  89. * Aop注解排除Jar
  90. */
  91. aspectExcludeJarFilter 'com.enation.geamtear.pay','AlipaySdk'
  92. }
  93. }