build.gradle 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. if ("fj_h5_z_3128_1" == app_device_type) {
  32. main.java.srcDirs += 'src/main/h5_3128/java'
  33. main.res.srcDirs += 'src/main/h5_3128/res'
  34. main.manifest.srcFile 'src/main/h5_3128/AndroidManifest.xml'
  35. } else if ("fj_h7_z_3128_1" == app_device_type) {
  36. main.java.srcDirs += 'src/main/h7_3128/java'
  37. main.res.srcDirs += 'src/main/h7_3128/res'
  38. main.manifest.srcFile 'src/main/h7_3128/AndroidManifest.xml'
  39. } else if (app_device_type == "fj_h10_w_yld_1") {
  40. main.java.srcDirs += 'src/main/h10_w_yld/java'
  41. main.res.srcDirs += 'src/main/h10_w_yld/res'
  42. main.manifest.srcFile 'src/main/h10_w_yld/AndroidManifest.xml'
  43. } else if (app_device_type == "fj_h7_z_3128_2") {
  44. main.java.srcDirs += 'src/main/h7_z_3128_2/java'
  45. main.res.srcDirs += 'src/main/h7_z_3128_2/res'
  46. main.manifest.srcFile 'src/main/h7_z_3128_2/AndroidManifest.xml'
  47. }
  48. }
  49. lintOptions {
  50. abortOnError false
  51. }
  52. buildTypes {
  53. release {
  54. minifyEnabled false
  55. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  56. }
  57. }
  58. compileOptions {
  59. sourceCompatibility JavaVersion.VERSION_1_8
  60. targetCompatibility JavaVersion.VERSION_1_8
  61. }
  62. }
  63. //获取编译日期
  64. String getDate() {
  65. Date date = new Date();
  66. String dates = "\""+date.format("yyyy/MM/dd", TimeZone.getTimeZone("UTC"))+"\"";
  67. return dates;
  68. }
  69. dependencies {
  70. compile fileTree(dir: 'libs', include: ['*.jar'])
  71. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  72. exclude group: 'com.android.support', module: 'support-annotations'
  73. })
  74. /**
  75. * 单元测试
  76. */
  77. testCompile 'junit:junit:4.12'
  78. /**
  79. * Android基础依赖库
  80. */
  81. compile "com.android.support:design:$support_library_version"
  82. compile "com.android.support:support-v4:$support_library_version"
  83. compile "com.android.support:cardview-v7:$support_library_version"
  84. compile "com.android.support:appcompat-v7:$support_library_version"
  85. /**
  86. * 公共库依赖
  87. */
  88. compile project(':welcome')
  89. compile project(':middleware')
  90. //janus信令
  91. compile project(':janus')
  92. /**
  93. * Dagger编译依赖
  94. */
  95. kapt 'com.google.dagger:dagger-compiler:2.7'
  96. /**
  97. * Kotlin依赖
  98. */
  99. kapt 'com.android.databinding:compiler:2.3.3'
  100. /**
  101. * 路由注解处理器
  102. */
  103. kapt "com.enation.geamtear:jrouter-compiler:$router_version"
  104. /**
  105. * constraint-layout布局依赖
  106. */
  107. compile 'com.android.support.constraint:constraint-layout:1.1.0-beta5'
  108. //compile 'com.github.anrwatchdog:anrwatchdog:1.3.0'
  109. //使用xCrash捕获异常
  110. implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.0.0'
  111. //蓝牙
  112. implementation 'com.clj.fastble:FastBleLib:2.3.4'
  113. implementation 'org.altbeacon:android-beacon-library:2.17'
  114. }
  115. /**
  116. * kawo组件化框架配置
  117. */
  118. if(componentTag){
  119. kawo {
  120. /**
  121. * Aop注解排除Jar
  122. */
  123. aspectExcludeJarFilter 'com.enation.geamtear.pay','AlipaySdk'
  124. }
  125. }