build.gradle 19 KB

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