build.gradle 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  31. }
  32. lintOptions {
  33. abortOnError false
  34. }
  35. buildTypes {
  36. release {
  37. minifyEnabled false
  38. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  39. }
  40. }
  41. sourceSets {
  42. main.java.srcDirs += 'src/main/code'
  43. main.manifest.srcFile 'src/main/AndroidManifest.xml'
  44. }
  45. compileOptions {
  46. sourceCompatibility JavaVersion.VERSION_1_8
  47. targetCompatibility JavaVersion.VERSION_1_8
  48. }
  49. }
  50. dependencies {
  51. compile fileTree(include: ['*.jar'], dir: 'libs')
  52. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  53. exclude group: 'com.android.support', module: 'support-annotations'
  54. })
  55. /**
  56. * 单元测试
  57. */
  58. testCompile 'junit:junit:4.12'
  59. /**
  60. * Android基础依赖库
  61. */
  62. compile "com.android.support:design:$support_library_version"
  63. compile "com.android.support:support-v4:$support_library_version"
  64. compile "com.android.support:cardview-v7:$support_library_version"
  65. /**
  66. * 公共库依赖
  67. */
  68. compile project(':middleware')
  69. /**
  70. * 内存泄漏监控
  71. */
  72. if(componentTag){
  73. debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
  74. releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
  75. testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
  76. }
  77. /**
  78. * Dagger编译依赖
  79. */
  80. kapt 'com.google.dagger:dagger-compiler:2.7'
  81. /**
  82. * Kotlin依赖
  83. */
  84. kapt 'com.android.databinding:compiler:2.3.3'
  85. /**
  86. * 路由注解处理器
  87. */
  88. kapt "com.enation.geamtear:jrouter-compiler:$router_version"
  89. }
  90. /**
  91. * kawo组件化框架配置
  92. */
  93. if(componentTag){
  94. kawo {
  95. /**
  96. * Aop注解排除Jar
  97. */
  98. aspectExcludeJarFilter 'com.enation.geamtear.pay','AlipaySdk'
  99. }
  100. }