build.gradle 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.jakewharton.butterknife'
  3. apply plugin: 'org.greenrobot.greendao'
  4. apply plugin: 'com.didi.virtualapk.host'
  5. //apply plugin: 'realm-android'//Realm数据库
  6. android {
  7. compileSdkVersion ANDROID_COMPILE_SDK_VERSION as int
  8. buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
  9. defaultConfig {
  10. applicationId "com.sheep.jiuyan.samllsheep"
  11. minSdkVersion ANDROID_MIN_SDK_VERSION as int
  12. targetSdkVersion ANDORID_TARGET_SDK_VERSION as int
  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. flavorDimensions "versionCode"
  25. }
  26. greendao {
  27. schemaVersion 15
  28. targetGenDir 'src/main/java'
  29. }
  30. signingConfigs {
  31. config {
  32. keyAlias 'sheep'
  33. keyPassword 'zhaoyi2004'
  34. storeFile file('.././sign.jks')
  35. storePassword 'zhaoyi2004'
  36. v1SigningEnabled true
  37. v2SigningEnabled false
  38. }
  39. }
  40. lintOptions {
  41. abortOnError false
  42. disable 'MissingTranslation'
  43. }
  44. dexOptions {
  45. preDexLibraries = false
  46. javaMaxHeapSize "4g"
  47. }
  48. packagingOptions {
  49. exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
  50. }
  51. buildTypes {
  52. release {
  53. minifyEnabled true
  54. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  55. signingConfig signingConfigs.config
  56. }
  57. debug {
  58. signingConfig signingConfigs.config
  59. }
  60. }
  61. productFlavors.all { flavor ->
  62. flavor.manifestPlaceholders = [DUANDUAN_GRAPH : "${flavor.name}",
  63. DUANDUAN_DATASHARE: "${flavor.name}",
  64. ]
  65. }
  66. productFlavors {
  67. developSheeptest {
  68. applicationId "com.sheep.jiuyan.samllsheep"
  69. manifestPlaceholders = [DUANDUAN_GRAPH : "sheeptest",
  70. DUANDUAN_DATASHARE: "sheeptest",
  71. jpush_appkey : "627ffad0b1cdf701d15e027a",
  72. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  73. ]
  74. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptest"'
  75. buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptest"'
  76. resValue "string", "app_name", "小绵羊测试"
  77. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  78. signingConfig signingConfigs.config
  79. }
  80. sheeptestjiguang {
  81. applicationId "com.sheep.jiuyan.samllsheep.test"
  82. manifestPlaceholders = [DUANDUAN_GRAPH : "sheeptestjiguang",
  83. DUANDUAN_DATASHARE: "sheeptestjiguang",
  84. jpush_appkey : "627ffad0b1cdf701d15e027a",
  85. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  86. ]
  87. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptestjiguang"'
  88. buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptestjiguang"'
  89. resValue "string", "app_name", "小绵羊极光测试"
  90. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  91. signingConfig signingConfigs.config
  92. }
  93. sheep {
  94. applicationId "com.sheep.jiuyan.samllsheep"
  95. manifestPlaceholders = [DUANDUAN_GRAPH : "sheep",
  96. DUANDUAN_DATASHARE: "sheep",
  97. jpush_appkey : "28b74d520261c6f78e3e0921",
  98. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  99. ]
  100. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheep"'
  101. buildConfigField "String", "DUANDUAN_GRAPH", '"sheep"'
  102. resValue "string", "app_name", "小绵羊"
  103. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  104. signingConfig signingConfigs.config
  105. }
  106. }
  107. sourceSets {
  108. main() {
  109. jniLibs.srcDirs = ['src/main/libs']
  110. jni.srcDirs = [] //屏蔽掉默认的jni编译生成过程
  111. }
  112. }
  113. compileOptions {
  114. sourceCompatibility JavaVersion.VERSION_1_8
  115. targetCompatibility JavaVersion.VERSION_1_8
  116. }
  117. }
  118. repositories {
  119. flatDir {
  120. dirs 'libs'
  121. }
  122. google()
  123. }
  124. configurations.all {
  125. resolutionStrategy.eachDependency { DependencyResolveDetails details ->
  126. def requested = details.requested
  127. if (requested.group == 'com.android.support') {
  128. if (!requested.name.startsWith("multidex")) {
  129. details.useVersion "$supportLibVersion"
  130. }
  131. }
  132. }
  133. }
  134. dependencies {
  135. implementation 'com.android.support:support-v4:28.+'
  136. debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
  137. releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
  138. // Optional, if you use support library fragments:
  139. debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.2'
  140. //noinspection GradleCompatible
  141. implementation "com.android.support:cardview-v7:$supportLibVersion"
  142. implementation("com.android.support:design:$supportLibVersion") {
  143. exclude group: 'com.android.support', module: 'support-annotations'
  144. exclude group: 'com.android.support', module: 'support-compat'
  145. exclude group: 'com.android.support', module: 'support-core-ui'
  146. exclude group: 'com.android.support', module: 'support-core-utils'
  147. exclude group: 'com.android.support', module: 'support-fragment'
  148. exclude group: 'com.android.support', module: 'transition'
  149. exclude group: 'com.android.support', module: 'appcompat-v7'
  150. exclude group: 'com.android.support', module: 'cardview-v7'
  151. exclude group: 'com.android.support', module: 'recyclerview-v7'
  152. }
  153. implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  154. testImplementation 'junit:junit:4.12'
  155. // implementation 'com.google.code.gson:gson:2.8.2'
  156. // implementation 'com.shark:screencapture:1.0.0'
  157. implementation('com.jcodecraeer:xrecyclerview:1.5.9') {
  158. exclude group: 'com.android.support', module: 'design'
  159. exclude group: 'com.android.support', module: 'recyclerview'
  160. exclude group: 'com.android.support', module: 'appcompat'
  161. }
  162. implementation 'com.squareup.okhttp3:okhttp:3.11.0'
  163. implementation 'org.greenrobot:eventbus:3.1.1'
  164. // implementation 'com.zhy:base-adapter:3.0.3'
  165. // implementation 'com.liulishuo.filedownloader:library:1.6.9'
  166. implementation 'com.tencent.bugly:crashreport_upgrade:1.3.5'
  167. //其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
  168. implementation 'com.tencent.bugly:nativecrashreport:3.3.1'
  169. //其中latest.release指代最
  170. implementation 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:5.1.6'
  171. debugImplementation('com.readystatesoftware.chuck:library:1.1.0') {
  172. exclude group: 'com.android.support', module: 'design'
  173. exclude group: 'com.google.code.gson', module: 'gson'
  174. exclude group: 'com.squareup.okhttp3', module: 'okhttp'
  175. exclude group: 'nl.qbusict', module: 'cupboard'
  176. }
  177. // implementation 'de.hdodenhof:circleimageview:2.2.0'
  178. releaseImplementation('com.readystatesoftware.chuck:library-no-op:1.1.0') {
  179. exclude group: 'com.android.support', module: 'design'
  180. exclude group: 'com.squareup.okhttp3', module: 'okhttp'
  181. }
  182. implementation 'org.xutils:xutils:3.5.0'
  183. // implementation 'com.mylhyl:acp:1.1.7'
  184. implementation('cn.yipianfengye.android:zxing-library:2.2') {
  185. exclude group: 'com.android.support', module: 'appcompat-v7'
  186. exclude group: 'com.android.support', module: 'support-v4'
  187. }
  188. // implementation 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
  189. debugImplementation 'com.android.support:multidex:1.0.1'
  190. //不要修改这里,相信我
  191. releaseImplementation 'com.android.support:multidex:1.0.3'
  192. implementation(name: 'com.kfzs.safe-201809211354', ext: 'aar')
  193. //butterknife
  194. implementation('com.jakewharton:butterknife:8.8.1') {
  195. exclude group: 'com.android.support', module: 'support-annotations'
  196. exclude group: 'com.android.support', module: 'support-compat'
  197. // exclude group: 'com.jakewharton', module: 'butterknife-annotations'
  198. }
  199. annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
  200. //dagger2
  201. // implementation 'com.google.dagger:dagger:+'
  202. // implementation 'com.google.dagger:dagger-compiler:+'
  203. compileOnly 'org.glassfish:javax.annotation:10.0-b28'
  204. //javax.annotation', module: 'jsr250-api
  205. implementation 'com.google.dagger:dagger:2.12'
  206. //javax.inject', module: 'javax.inject
  207. annotationProcessor 'com.google.dagger:dagger-compiler:2.12'
  208. //retrofit
  209. implementation('com.squareup.retrofit2:retrofit:2.4.0') {
  210. exclude group: 'com.google.android', module: 'android'
  211. exclude group: 'com.squareup.okhttp3', module: 'okhttp'
  212. exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
  213. }
  214. // implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
  215. implementation('org.ligboy.retrofit2:converter-fastjson-android:2.1.0') {
  216. exclude group: 'com.alibaba', module: 'fastjson'
  217. exclude group: 'com.squareup.retrofit2', module: 'retrofit'
  218. }
  219. // implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
  220. // implementation 'com.squareup.retrofit2:adapter-rxjava2:+'
  221. // implementation ('com.squareup.retrofit2:adapter-rxjava:2.1.0') {
  222. // exclude group: 'com.squareup.retrofit2', module: 'retrofit'
  223. // }
  224. implementation('com.squareup.retrofit2:adapter-rxjava2:2.5.0') {
  225. exclude group: 'com.squareup.retrofit2', module: 'retrofit'
  226. exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
  227. }
  228. //rxjava
  229. implementation('io.reactivex.rxjava2:rxandroid:2.1.0') {
  230. exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
  231. }
  232. implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
  233. //获取动态权限三方库
  234. implementation('pub.devrel:easypermissions:1.2.0') {
  235. exclude group: 'com.android.support', module: 'appcompat-v7'
  236. exclude group: 'com.android.support', module: 'support-compat'
  237. exclude group: 'com.android.support', module: 'support-fragment'
  238. }
  239. // implementation 'net.danlew:android.joda:2.9.3'
  240. // implementation 'com.orhanobut:logger:1.15'
  241. //友盟
  242. implementation 'com.umeng.sdk:common:1.5.3'
  243. //implementation 'com.umeng.sdk:analytics:latest.integration'
  244. //添加半袋米相关
  245. implementation(name: 'appstoreutils-201810101432', ext: 'aar')
  246. implementation project(':view')
  247. // implementation(name: 'view-release', ext: 'aar')
  248. // implementation 'com.flipboard:bottomsheet-core:1.5.3'
  249. // implementation 'com.flipboard:bottomsheet-commons:1.5.3'
  250. implementation files('libs/open_sdk_r5923_lite.jar')
  251. // implementation files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
  252. implementation files('libs/umeng_social_tool.jar')
  253. implementation files('libs/umeng_social_shareboard.jar')
  254. implementation files('libs/umeng_social_net.jar')
  255. implementation files('libs/umeng_social_api.jar')
  256. implementation files('libs/umeng_shareboard_widget.jar')
  257. implementation files('libs/SocialSDK_WeiXin_Full.jar')
  258. implementation files('libs/SocialSDK_QQ_Full.jar')
  259. implementation('com.zhy:okhttputils:2.6.2') {
  260. exclude group: 'com.squareup.okhttp3', module: 'okhttp'
  261. }
  262. // implementation 'com.kf.framework:kf-utils:latest.integration@aar'
  263. // implementation 'com.kf.framework:kf-utils:1.4.5@aar'
  264. // implementation 'com.kf.framework:volleyplus:latest.integration@aar'
  265. // implementation 'com.kf.framework:volleyplus:1.4.5@aar'
  266. implementation "com.android.support:support-annotations:$supportLibVersion"
  267. implementation("com.android.support:recyclerview-v7:$supportLibVersion") {
  268. exclude group: 'com.android.support', module: 'support-annotations'
  269. exclude group: 'com.android.support', module: 'support-compat'
  270. exclude group: 'com.android.support', module: 'support-core-ui'
  271. }
  272. // implementation project(':datashare')
  273. // implementation files('libs/jackson-core-2.2.1.jar')
  274. // implementation files('libs/jackson-dataformat-xml-2.1.2.jar')
  275. // implementation 'io.reactivex:rxandroid:1.2.1'
  276. implementation('com.github.ithedan:TextViewDrawable:v1.0') {
  277. exclude group: 'com.android.support', module: 'appcompat-v7'
  278. }
  279. // implementation 'com.github.zhangkexpz:LayoutScroll:v1.0'
  280. // implementation 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
  281. implementation(name: 'PhotoPicker-release-201810081154', ext: 'aar')
  282. implementation('com.github.bumptech.glide:glide:4.1.1') {
  283. exclude group: 'com.android.support', module: 'support-fragment'
  284. // exclude group: 'com.github.bumptech.glide', module: 'gifdecoder'
  285. // exclude group: 'com.github.bumptech.glide', module: 'disklrucache'
  286. // exclude group: 'com.github.bumptech.glide', module: 'annotations'
  287. }
  288. annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1'
  289. // implementation 'com.github.yalantis:ucrop:2.2.1-native'
  290. // implementation 'com.google.zxing:core:3.3.0'
  291. implementation project(':ucrop')
  292. implementation('com.sunfusheng:marqueeview:1.3.3') {
  293. exclude group: 'com.android.support', module: 'appcompat-v7'
  294. }
  295. implementation files('libs/alipaySdk-20170922.jar')
  296. //极光
  297. implementation files('libs/jcore-android-1.2.0.jar')
  298. implementation files('libs/jpush-android-3.1.2.jar')
  299. //定位
  300. implementation files('libs/BaiduLBS_Android.jar')
  301. //幂动科技
  302. implementation files('libs/mdsdk_1123_1.2.1.12.jar')
  303. //轮播图
  304. implementation 'com.youth.banner:banner:1.4.10'
  305. //最新版本
  306. //loading
  307. implementation 'com.github.ybq:Android-SpinKit:1.1.0'
  308. // implementation 'com.github.nanchen2251:CompressHelper:1.0.5'
  309. // implementation(name: 'compresshelper-release', ext: 'aar')
  310. implementation files('libs/compresshelper-release.jar')
  311. implementation('com.haibin:calendarview:3.4.8') {
  312. exclude group: 'com.android.support', module: 'appcompat-v7'
  313. exclude group: 'com.android.support', module: 'recyclerview-v7'
  314. }
  315. implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-14'
  316. implementation 'org.greenrobot:greendao:3.2.2'
  317. //org.greenrobot', module: 'greendao-api
  318. //okDownload
  319. // core
  320. implementation 'com.liulishuo.okdownload:okdownload:1.0.5'
  321. // provide sqlite to store breakpoints
  322. implementation 'com.liulishuo.okdownload:sqlite:1.0.5'
  323. // provide okhttp to connect to backend
  324. implementation 'com.liulishuo.okdownload:okhttp:1.0.5'
  325. implementation('com.trello.rxlifecycle2:rxlifecycle-components:2.2.2') {
  326. exclude group: 'com.android.support', module: 'appcompat-v7'
  327. // com.trello.rxlifecycle2', module: 'rxlifecycle-android
  328. exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
  329. }
  330. //
  331. // implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
  332. //有米科技
  333. implementation(name: 'YoumiSdk_v8.3.0_2018-09-20', ext: 'aar')
  334. implementation project(':WaterWaveProgress')
  335. //AndroidVideoCache 网络视频缓存 https://github.com/danikula/AndroidVideoCache
  336. implementation 'com.danikula:videocache:2.7.1'
  337. //视频图片选择
  338. // implementation ('cn.finalteam.rxgalleryfinal:library:1.1.3') {
  339. // exclude group: 'com.android.support', module: 'appcompat-v7'
  340. // exclude group: 'io.reactivex.rxjava2', module: 'rxandroid'
  341. // exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
  342. // exclude group: 'com.yalantis', module: 'ucrop'
  343. // exclude group: 'com.android.support', module: 'recyclerview-v7'
  344. // }
  345. // implementation "com.android.support:exifinterface:$supportLibVersion"
  346. // implementation project(':RxGalleryFinal')
  347. implementation "com.android.support:exifinterface:$supportLibVersion"
  348. implementation('com.qiniu:qiniu-android-sdk:7.3.13') {
  349. exclude group: 'com.squareup.okhttp3', module: 'okhttp'
  350. }
  351. implementation project(':media_share_lib')
  352. implementation 'com.didi.virtualapk:core:0.9.8'
  353. //fast json
  354. implementation 'com.alibaba:fastjson:1.2.52'
  355. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
  356. // implementation 'com.github.yangjie10930:EpMedia:v0.9.5'
  357. }
  358. static def releaseTime() {
  359. return new Date().format("MMddHHmm", TimeZone.getDefault())
  360. }
  361. //在apk文件后边生成版本号信息
  362. android.applicationVariants.all {
  363. variant ->
  364. variant.outputs.all {
  365. output ->
  366. // if (buildType.name == "release") {
  367. outputFileName = "${productFlavors[0].name}_${buildType.name}_v${versionName}_${versionCode}-${releaseTime()}.apk"
  368. // }
  369. }
  370. }