build.gradle 16 KB

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