build.gradle 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.getkeepsafe.dexcount'
  3. apply plugin: 'me.tatarka.retrolambda'
  4. android {
  5. compileOptions {
  6. sourceCompatibility JavaVersion.VERSION_1_8
  7. targetCompatibility JavaVersion.VERSION_1_8
  8. }
  9. signingConfigs {
  10. config {
  11. storeFile file('C:/sigin/applicationsignname[20150409]')
  12. storePassword '13237658359'
  13. keyAlias 'jie-20150409'
  14. keyPassword '13237658359'
  15. }
  16. }
  17. compileSdkVersion rootProject.ext.android.compileSdkVersion
  18. buildToolsVersion rootProject.ext.android.buildToolsVersion
  19. defaultConfig {
  20. applicationId project.applicationId
  21. minSdkVersion rootProject.ext.android.minSdkVersion
  22. targetSdkVersion rootProject.ext.android.targetSdkVersion
  23. versionCode rootProject.ext.android.versionCode
  24. versionName rootProject.ext.android.versionName
  25. multiDexEnabled true
  26. signingConfig signingConfigs.config
  27. // 默认是umeng的渠道
  28. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  29. manifestPlaceholders = [UMENG_CHANNEL_VALUE: "umeng"]
  30. ndk {
  31. abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
  32. }
  33. }
  34. useLibrary 'org.apache.http.legacy'
  35. lintOptions {
  36. abortOnError false
  37. }
  38. packagingOptions {
  39. exclude 'META-INF/LICENSE.txt'
  40. exclude 'META-INF/NOTICE.txt'
  41. }
  42. buildTypes {
  43. release {
  44. minifyEnabled false
  45. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
  46. signingConfig signingConfigs.config
  47. }
  48. debug {
  49. signingConfig signingConfigs.config
  50. }
  51. }
  52. productFlavors { // Gradle 多渠道打包
  53. baidu {}
  54. wandoujia {}
  55. xiaomi {}
  56. tencent {}
  57. taobao {}
  58. }
  59. productFlavors.all {
  60. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
  61. }
  62. //给apk添加对应的版本号:这里暂时注释但保留
  63. // applicationVariants.all { variant ->
  64. // variant.outputs.each { output ->
  65. // def outputFile = output.outputFile
  66. // if (outputFile != null && outputFile.name.endsWith('.apk')) {
  67. // def fileName = outputFile.name.replace(".apk", "-${defaultConfig.versionName}.apk")
  68. // output.outputFile = new File(outputFile.parent, fileName)
  69. // }
  70. // }
  71. // }
  72. }
  73. dependencies {
  74. compile fileTree(include: ['*.jar'], dir: 'libs')
  75. //依赖库
  76. testCompile deps.junit
  77. compile deps.appcompatV7
  78. compile deps.cardviewV7
  79. compile deps.design
  80. compile deps.multidex
  81. compile deps.fastjson
  82. compile(deps.stetho) {
  83. force = true
  84. }
  85. compile deps.circleimageview
  86. compile deps.jodatime
  87. compile deps.systembartint
  88. compile deps.photoView
  89. compile deps.tagGroup
  90. compile deps.analytics
  91. compile deps.activityOnCrash
  92. compile deps.stickyListHeaders
  93. compile deps.stickyGridHeaders
  94. compile deps.materialDialogs
  95. androidTestCompile deps.leakcanaryNp
  96. debugCompile deps.leakcanary
  97. releaseCompile deps.leakcanaryNp
  98. //project
  99. compile project(':pullToRefershLibraryMy')
  100. compile project(':MPAndroidChart')
  101. compile project(':libedittextformlibrary')
  102. compile project(':libfloatingactionbutton')
  103. compile project(':libbdupdatesdk')
  104. compile project(':library-swipemenu_lv')
  105. compile project(':library-viewpager-indicator')
  106. compile project(':lib-zxing')
  107. compile project(':library-refreshlayout')
  108. compile 'com.squareup.okhttp3:okhttp:3.8.1'
  109. compile project(':android-pdf-viewer')
  110. }
  111. buildscript {
  112. repositories {
  113. mavenCentral()
  114. }
  115. dependencies {
  116. classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.4'
  117. }
  118. }
  119. dexcount {
  120. format = "json"
  121. includeClasses = false
  122. includeFieldCount = true
  123. includeTotalMethodCount = false
  124. orderByMethodCount = false
  125. verbose = false
  126. maxTreeDepth = Integer.MAX_VALUE
  127. teamCityIntegration = false
  128. enableForInstantRun = false
  129. }