build.gradle 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.jakewharton.butterknife'
  3. // 依赖插件脚本
  4. apply from: 'tinker-support.gradle'
  5. //apply plugin: 'com.appsee.appsee-plugin'
  6. android {
  7. compileSdkVersion androidConfigs.compileSdkVersion
  8. buildToolsVersion androidConfigs.buildToolsVersion
  9. defaultConfig {
  10. applicationId "com.sheep.jiuyan.samllsheep"
  11. minSdkVersion 18
  12. targetSdkVersion 27
  13. versionCode VERSION_CODE as int
  14. versionName VERSION_NAME
  15. multiDexEnabled true
  16. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  17. ndk {
  18. abiFilters "armeabi-v7a", 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
  19. }
  20. // jackOptions {
  21. // enabled true
  22. // }
  23. multiDexEnabled true
  24. }
  25. // compileOptions{
  26. // sourceCompatibility org.gradle.api.JavaVersion.VERSION_1_8
  27. // targetCompatibility org.gradle.api.JavaVersion.VERSION_1_8
  28. // }
  29. signingConfigs {
  30. config {
  31. keyAlias 'sheep'
  32. keyPassword 'zhaoyi2004'
  33. storeFile file('.././sign.jks')
  34. storePassword 'zhaoyi2004'
  35. v1SigningEnabled true
  36. v2SigningEnabled false
  37. }
  38. }
  39. lintOptions {
  40. abortOnError false
  41. disable 'MissingTranslation'
  42. }
  43. dexOptions {
  44. preDexLibraries = false
  45. javaMaxHeapSize "4g"
  46. }
  47. packagingOptions {
  48. exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
  49. }
  50. buildTypes {
  51. release {
  52. minifyEnabled true
  53. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  54. signingConfig signingConfigs.config
  55. }
  56. debug {
  57. signingConfig signingConfigs.config
  58. }
  59. }
  60. productFlavors.all { flavor ->
  61. flavor.manifestPlaceholders = [DUANDUAN_GRAPH : "${flavor.name}",
  62. DUANDUAN_DATASHARE : "${flavor.name}",
  63. ]
  64. }
  65. productFlavors {
  66. sheeptest {
  67. applicationId "com.sheep.jiuyan.samllsheep"
  68. manifestPlaceholders = [DUANDUAN_GRAPH : "sheeptest",
  69. DUANDUAN_DATASHARE : "sheeptest",
  70. jpush_appkey : "4fea09bdbf9661a9689ee306",
  71. appsee_app_key : "1fd86378cdcf4bef8ff97ce63cdb86fb",
  72. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  73. ]
  74. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptest"'
  75. buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptest"'
  76. buildConfigField "String", "app_name", '"小绵羊测试"'
  77. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  78. buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
  79. signingConfig signingConfigs.config
  80. }
  81. sheeptestjiguang {
  82. applicationId "com.sheep.jiuyan.samllsheep.test"
  83. manifestPlaceholders = [DUANDUAN_GRAPH : "sheeptestjiguang",
  84. DUANDUAN_DATASHARE : "sheeptestjiguang",
  85. jpush_appkey : "4fea09bdbf9661a9689ee306",
  86. appsee_app_key : "1fd86378cdcf4bef8ff97ce63cdb86fb",
  87. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  88. ]
  89. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptestjiguang"'
  90. buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptestjiguang"'
  91. buildConfigField "String", "app_name", '"小绵羊测试"'
  92. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  93. buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
  94. signingConfig signingConfigs.config
  95. }
  96. sheep {
  97. applicationId "com.sheep.jiuyan.samllsheep"
  98. manifestPlaceholders = [DUANDUAN_GRAPH : "sheep",
  99. DUANDUAN_DATASHARE : "sheep",
  100. jpush_appkey : "28b74d520261c6f78e3e0921",
  101. appsee_app_key : "55ec0910667246d48c4c1dbdf266ff68",
  102. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  103. ]
  104. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheep"'
  105. buildConfigField "String", "DUANDUAN_GRAPH", '"sheep"'
  106. buildConfigField "String", "app_name", '"小绵羊"'
  107. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  108. buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
  109. signingConfig signingConfigs.config
  110. }
  111. }
  112. }
  113. repositories {
  114. flatDir {
  115. dirs 'libs'
  116. }
  117. google()
  118. }
  119. dependencies {
  120. compile 'com.android.support:design:27.1.0'
  121. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  122. testCompile 'junit:junit:4.12'
  123. compile 'com.google.code.gson:gson:2.8.2'
  124. compile('com.jcodecraeer:xrecyclerview:1.5.2') {
  125. // compile 'com.shark:screencapture:1.0.0'
  126. exclude group: 'com.android.support', module: 'design'
  127. }
  128. compile 'com.squareup.okhttp3:okhttp:3.10.0'
  129. compile 'org.greenrobot:eventbus:3.1.1'
  130. compile 'com.zhy:base-adapter:3.0.3'
  131. // compile 'com.liulishuo.filedownloader:library:1.6.9'
  132. compile 'com.tencent.bugly:crashreport_upgrade:1.3.5'
  133. // 指定tinker依赖版本(注:应用升级1.3.5版本起,不再内置tinker)
  134. compile 'com.tencent.tinker:tinker-android-lib:1.9.6'
  135. //其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
  136. compile 'com.tencent.bugly:nativecrashreport:3.3.1'
  137. //其中latest.release指代最
  138. // compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
  139. debugCompile('com.readystatesoftware.chuck:library:1.1.0') {
  140. exclude group: 'com.android.support', module: 'design'
  141. }
  142. // compile 'de.hdodenhof:circleimageview:2.2.0'
  143. releaseCompile('com.readystatesoftware.chuck:library-no-op:1.1.0') {
  144. exclude group: 'com.android.support', module: 'design'
  145. }
  146. compile 'org.xutils:xutils:3.5.0'
  147. compile 'com.mylhyl:acp:1.1.7'
  148. // compile 'cn.yipianfengye.android:zxing-library:2.2'
  149. compile 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
  150. debugCompile 'com.android.support:multidex:1.0.1'
  151. //不要修改这里,相信我
  152. releaseCompile 'com.android.support:multidex:1.0.3'
  153. compile(name: 'com.kfzs.safe', ext: 'aar')
  154. //butterknife
  155. compile 'com.jakewharton:butterknife:8.8.1'
  156. annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
  157. //dagger2
  158. // compile 'com.google.dagger:dagger:+'
  159. // compile 'com.google.dagger:dagger-compiler:+'
  160. provided 'org.glassfish:javax.annotation:10.0-b28'
  161. compile 'com.google.dagger:dagger:2.12'
  162. annotationProcessor 'com.google.dagger:dagger-compiler:2.12'
  163. //retrofit
  164. compile 'com.squareup.retrofit2:retrofit:2.4.0'
  165. compile 'com.squareup.retrofit2:converter-gson:2.4.0'
  166. compile 'com.squareup.okhttp3:logging-interceptor:3.10.0'
  167. // compile 'com.squareup.retrofit2:adapter-rxjava2:+'
  168. compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
  169. //rxjava
  170. compile 'io.reactivex.rxjava2:rxandroid:2.0.2'
  171. compile 'io.reactivex.rxjava2:rxjava:2.1.12'
  172. //获取动态权限三方库
  173. compile 'pub.devrel:easypermissions:1.2.0'
  174. compile 'net.danlew:android.joda:2.9.3'
  175. compile 'com.orhanobut:logger:1.15'
  176. //友盟
  177. compile 'com.umeng.sdk:common:1.5.3'
  178. //compile 'com.umeng.sdk:analytics:latest.integration'
  179. //fast json
  180. compile 'com.alibaba:fastjson:1.2.47'
  181. //添加半袋米相关
  182. compile(name: 'appstoreutils', ext: 'aar')
  183. compile project(':view')
  184. // compile(name: 'view-release', ext: 'aar')
  185. compile 'com.flipboard:bottomsheet-core:1.5.3'
  186. compile 'com.flipboard:bottomsheet-commons:1.5.3'
  187. compile 'com.google.protobuf:protobuf-java:3.2.0'
  188. compile files('libs/open_sdk_r5923_lite.jar')
  189. compile files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
  190. compile files('libs/umeng_social_tool.jar')
  191. compile files('libs/umeng_social_shareboard.jar')
  192. compile files('libs/umeng_social_net.jar')
  193. compile files('libs/umeng_social_api.jar')
  194. compile files('libs/umeng_shareboard_widget.jar')
  195. compile files('libs/SocialSDK_WeiXin_Full.jar')
  196. compile files('libs/SocialSDK_QQ_Full.jar')
  197. compile 'com.zhy:okhttputils:2.6.2'
  198. // compile 'com.kf.framework:kf-utils:latest.integration@aar'
  199. compile 'com.kf.framework:kf-utils:1.4.5@aar'
  200. // compile 'com.kf.framework:volleyplus:latest.integration@aar'
  201. compile 'com.kf.framework:volleyplus:1.4.5@aar'
  202. compile 'com.android.support:support-annotations:27.1.0'
  203. compile 'com.android.support:recyclerview-v7:27.1.0'
  204. compile project(':datashare')
  205. compile files('libs/jackson-core-2.2.1.jar')
  206. compile files('libs/jackson-dataformat-xml-2.1.2.jar')
  207. compile 'io.reactivex:rxandroid:1.2.1'
  208. compile 'com.github.ithedan:TextViewDrawable:v1.0'
  209. // compile 'com.github.zhangkexpz:LayoutScroll:v1.0'
  210. compile 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
  211. compile 'com.github.bumptech.glide:glide:4.1.1'
  212. // compile 'com.github.yalantis:ucrop:2.2.1-native'
  213. // compile 'com.google.zxing:core:3.3.0'
  214. compile project(':ucrop')
  215. compile project(':kfzslibrary')
  216. compile('com.arialyy.aria:aria-core:3.3.16') {
  217. exclude group: 'com.android.support'
  218. }
  219. // compile project(':Aria')
  220. annotationProcessor 'com.arialyy.aria:aria-compiler:3.3.16'
  221. compile 'com.sunfusheng:marqueeview:1.3.3'
  222. compile 'com.github.nanchen2251:CompressHelper:1.0.5'
  223. compile files('libs/alipaySdk-20170922.jar')
  224. //极光
  225. compile files('libs/jcore-android-1.2.0.jar')
  226. compile files('libs/jpush-android-3.1.2.jar')
  227. compile 'com.appsee:appsee-android:+'
  228. }
  229. static def releaseTime() {
  230. return new Date().format("MMddHHmm", TimeZone.getDefault())
  231. }
  232. //在apk文件后边生成版本号信息
  233. android.applicationVariants.all {
  234. variant ->
  235. variant.outputs.each {
  236. output ->
  237. if(buildType.name == "release") {
  238. if (productFlavors[0].name == "sheep") {
  239. // output.outputFile = new File(output.outputFile.parent, productFlavors[0].name + "_" + buildType.name + "_v" + android.defaultConfig.versionName + "_" + android.defaultConfig.versionCode + "-${releaseTime()}.apk")
  240. } else {
  241. output.outputFile = new File(output.outputFile.parent, productFlavors[0].name + "_" + buildType.name +".apk")
  242. }
  243. }
  244. }
  245. }