build.gradle 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. minSdkVersion min_sdk_version
  20. targetSdkVersion target_sdk_version
  21. versionCode app_version_code
  22. versionName app_version
  23. multiDexEnabled true
  24. dataBinding {
  25. enabled = true
  26. }
  27. buildConfigField "String", "BUILD_TIME", getDate()
  28. }
  29. sourceSets {
  30. println 'config app_device_type ===== ' + app_device_type
  31. main.java.srcDirs += 'src/main/common/java'
  32. main.res.srcDirs += 'src/main/common/res'
  33. if ("zj_h10_z_3128_1" == app_device_type) {
  34. main.java.srcDirs += 'src/main/h10_z3128_1h/java'
  35. main.res.srcDirs += 'src/main/h10_z3128_1h/res'
  36. main.manifest.srcFile 'src/main/h10_z3128_1h/AndroidManifest.xml'
  37. } else if (app_device_type == "zj_h10_w_ke_1") {
  38. main.java.srcDirs += 'src/main/h10_wke_1h/java'
  39. main.res.srcDirs += 'src/main/h10_wke_1h/res'
  40. main.manifest.srcFile 'src/main/h10_wke_1h/AndroidManifest.xml'
  41. }
  42. }
  43. lintOptions {
  44. abortOnError false
  45. }
  46. buildTypes {
  47. release {
  48. minifyEnabled false
  49. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  50. }
  51. }
  52. }
  53. //获取编译日期
  54. static String getDate() {
  55. Date date = new Date()
  56. String dates = "\""+date.format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))+"\""
  57. return dates
  58. }
  59. dependencies {
  60. compile fileTree(dir: 'libs', include: ['*.jar'])
  61. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  62. exclude group: 'com.android.support', module: 'support-annotations'
  63. })
  64. /**
  65. * 单元测试
  66. */
  67. testCompile 'junit:junit:4.12'
  68. /**
  69. * Android基础依赖库
  70. */
  71. compile "com.android.support:design:$support_library_version"
  72. compile "com.android.support:support-v4:$support_library_version"
  73. compile "com.android.support:cardview-v7:$support_library_version"
  74. compile "com.android.support:appcompat-v7:$support_library_version"
  75. /**
  76. * 公共库依赖
  77. */
  78. compile project(':middleware')
  79. if(componentTag){
  80. debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
  81. releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
  82. testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
  83. }
  84. /**
  85. * Dagger编译依赖
  86. */
  87. kapt 'com.google.dagger:dagger-compiler:2.7'
  88. /**
  89. * Kotlin依赖
  90. */
  91. kapt 'com.android.databinding:compiler:2.3.3'
  92. /**
  93. * 路由注解处理器
  94. */
  95. kapt "com.enation.geamtear:jrouter-compiler:$router_version"
  96. /**
  97. * constraint-layout布局依赖
  98. */
  99. compile 'com.android.support.constraint:constraint-layout:1.1.0-beta5'
  100. //compile 'com.github.anrwatchdog:anrwatchdog:1.3.0'
  101. //使用xCrash捕获异常
  102. implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.0.0'
  103. //janus信令
  104. compile project(':janus')
  105. //linphone sip
  106. //implementation "org.linphone:linphone-sdk-android:5.2.10"
  107. //串口
  108. compile project(':nurseMainLib')
  109. compile project(':listenvision')
  110. //广播喊话组件
  111. compile project(':gstream')
  112. }
  113. /**
  114. * kawo组件化框架配置
  115. */
  116. if(componentTag){
  117. kawo {
  118. /**
  119. * Aop注解排除Jar
  120. */
  121. aspectExcludeJarFilter 'com.enation.geamtear.pay','AlipaySdk'
  122. }
  123. }