build.gradle 18 KB

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