build.gradle 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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 androidConfigs.compileSdkVersion
  7. buildToolsVersion androidConfigs.buildToolsVersion
  8. defaultConfig {
  9. applicationId "com.sheep.jiuyan.samllsheep"
  10. minSdkVersion 18
  11. targetSdkVersion 27
  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. }
  24. greendao {
  25. schemaVersion 10
  26. targetGenDir 'src/main/java'
  27. }
  28. // compileOptions{
  29. // sourceCompatibility org.gradle.api.JavaVersion.VERSION_1_8
  30. // targetCompatibility org.gradle.api.JavaVersion.VERSION_1_8
  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 : "4fea09bdbf9661a9689ee306",
  74. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  75. ]
  76. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptest"'
  77. buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptest"'
  78. buildConfigField "String", "app_name", '"小绵羊测试"'
  79. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  80. buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
  81. signingConfig signingConfigs.config
  82. }
  83. // sheeptestjiguang {
  84. // applicationId "com.sheep.jiuyan.samllsheep.test"
  85. // manifestPlaceholders = [DUANDUAN_GRAPH : "sheeptestjiguang",
  86. // DUANDUAN_DATASHARE: "sheeptestjiguang",
  87. // jpush_appkey : "4fea09bdbf9661a9689ee306",
  88. // umeng_app_key : "5ab0a1da8f4a9d742900035f"
  89. // ]
  90. // buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptestjiguang"'
  91. // buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptestjiguang"'
  92. // buildConfigField "String", "app_name", '"小绵羊测试"'
  93. // buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  94. // buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
  95. // signingConfig signingConfigs.config
  96. // }
  97. sheep {
  98. applicationId "com.sheep.jiuyan.samllsheep"
  99. manifestPlaceholders = [DUANDUAN_GRAPH : "sheep",
  100. DUANDUAN_DATASHARE: "sheep",
  101. jpush_appkey : "28b74d520261c6f78e3e0921",
  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. sourceSets {
  113. main() {
  114. jniLibs.srcDirs = ['src/main/libs']
  115. jni.srcDirs = [] //屏蔽掉默认的jni编译生成过程
  116. }
  117. }
  118. }
  119. repositories {
  120. flatDir {
  121. dirs 'libs'
  122. }
  123. google()
  124. }
  125. dependencies {
  126. //noinspection GradleCompatible
  127. compile 'com.android.support:cardview-v7:28.0.0-rc01'
  128. compile "com.android.support:design:$supportLibVersion"
  129. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  130. testCompile 'junit:junit:4.12'
  131. compile 'com.google.code.gson:gson:2.8.2'
  132. compile('com.jcodecraeer:xrecyclerview:1.5.9') {
  133. // compile 'com.shark:screencapture:1.0.0'
  134. exclude group: 'com.android.support', module: 'design'
  135. }
  136. compile 'com.squareup.okhttp3:okhttp:3.10.0'
  137. compile 'org.greenrobot:eventbus:3.1.1'
  138. compile 'com.zhy:base-adapter:3.0.3'
  139. // compile 'com.liulishuo.filedownloader:library:1.6.9'
  140. compile 'com.tencent.bugly:crashreport_upgrade:1.3.4'
  141. //其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
  142. compile 'com.tencent.bugly:nativecrashreport:3.3.1'
  143. //其中latest.release指代最
  144. // compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
  145. debugCompile('com.readystatesoftware.chuck:library:1.1.0') {
  146. exclude group: 'com.android.support', module: 'design'
  147. }
  148. // compile 'de.hdodenhof:circleimageview:2.2.0'
  149. releaseCompile('com.readystatesoftware.chuck:library-no-op:1.1.0') {
  150. exclude group: 'com.android.support', module: 'design'
  151. }
  152. compile 'org.xutils:xutils:3.5.0'
  153. compile 'com.mylhyl:acp:1.1.7'
  154. compile 'cn.yipianfengye.android:zxing-library:2.2'
  155. compile 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
  156. debugCompile 'com.android.support:multidex:1.0.1'
  157. //不要修改这里,相信我
  158. releaseCompile 'com.android.support:multidex:1.0.3'
  159. compile(name: 'com.kfzs.safe', ext: 'aar')
  160. //butterknife
  161. compile 'com.jakewharton:butterknife:8.8.1'
  162. annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
  163. //dagger2
  164. // compile 'com.google.dagger:dagger:+'
  165. // compile 'com.google.dagger:dagger-compiler:+'
  166. provided 'org.glassfish:javax.annotation:10.0-b28'
  167. compile 'com.google.dagger:dagger:2.12'
  168. annotationProcessor 'com.google.dagger:dagger-compiler:2.12'
  169. //retrofit
  170. compile 'com.squareup.retrofit2:retrofit:2.4.0'
  171. compile 'com.squareup.retrofit2:converter-gson:2.4.0'
  172. compile 'com.squareup.okhttp3:logging-interceptor:3.10.0'
  173. // compile 'com.squareup.retrofit2:adapter-rxjava2:+'
  174. compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
  175. //rxjava
  176. compile 'io.reactivex.rxjava2:rxandroid:2.0.2'
  177. compile 'io.reactivex.rxjava2:rxjava:2.1.12'
  178. //获取动态权限三方库
  179. compile 'pub.devrel:easypermissions:1.2.0'
  180. compile 'net.danlew:android.joda:2.9.3'
  181. compile 'com.orhanobut:logger:1.15'
  182. //友盟
  183. compile 'com.umeng.sdk:common:1.5.3'
  184. //compile 'com.umeng.sdk:analytics:latest.integration'
  185. //fast json
  186. compile 'com.alibaba:fastjson:1.2.47'
  187. //添加半袋米相关
  188. compile(name: 'appstoreutils', ext: 'aar')
  189. compile project(':view')
  190. // compile(name: 'view-release', ext: 'aar')
  191. compile 'com.flipboard:bottomsheet-core:1.5.3'
  192. compile 'com.flipboard:bottomsheet-commons:1.5.3'
  193. compile 'com.google.protobuf:protobuf-java:3.2.0'
  194. compile files('libs/open_sdk_r5923_lite.jar')
  195. compile files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
  196. compile files('libs/umeng_social_tool.jar')
  197. compile files('libs/umeng_social_shareboard.jar')
  198. compile files('libs/umeng_social_net.jar')
  199. compile files('libs/umeng_social_api.jar')
  200. compile files('libs/umeng_shareboard_widget.jar')
  201. compile files('libs/SocialSDK_WeiXin_Full.jar')
  202. compile files('libs/SocialSDK_QQ_Full.jar')
  203. compile 'com.zhy:okhttputils:2.6.2'
  204. // compile 'com.kf.framework:kf-utils:latest.integration@aar'
  205. compile 'com.kf.framework:kf-utils:1.4.5@aar'
  206. // compile 'com.kf.framework:volleyplus:latest.integration@aar'
  207. compile 'com.kf.framework:volleyplus:1.4.5@aar'
  208. compile "com.android.support:support-annotations:$supportLibVersion"
  209. compile "com.android.support:recyclerview-v7:$supportLibVersion"
  210. // compile project(':datashare')
  211. compile files('libs/jackson-core-2.2.1.jar')
  212. compile files('libs/jackson-dataformat-xml-2.1.2.jar')
  213. compile 'io.reactivex:rxandroid:1.2.1'
  214. compile 'com.github.ithedan:TextViewDrawable:v1.0'
  215. // compile 'com.github.zhangkexpz:LayoutScroll:v1.0'
  216. // compile 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
  217. compile(name: 'PhotoPicker-release', ext: 'aar')
  218. compile 'com.github.bumptech.glide:glide:4.1.1'
  219. // compile 'com.github.yalantis:ucrop:2.2.1-native'
  220. // compile 'com.google.zxing:core:3.3.0'
  221. compile project(':ucrop')
  222. compile('com.arialyy.aria:aria-core:3.3.16') {
  223. exclude group: 'com.android.support'
  224. }
  225. // compile project(':Aria')
  226. annotationProcessor 'com.arialyy.aria:aria-compiler:3.3.16'
  227. compile 'com.sunfusheng:marqueeview:1.3.3'
  228. compile files('libs/alipaySdk-20170922.jar')
  229. //极光
  230. compile files('libs/jcore-android-1.2.0.jar')
  231. compile files('libs/jpush-android-3.1.2.jar')
  232. //定位
  233. compile files('libs/BaiduLBS_Android.jar')
  234. //幂动科技
  235. compile files('libs/mdsdk.jar')
  236. //轮播图
  237. compile 'com.youth.banner:banner:1.4.10' //最新版本
  238. //loading
  239. compile 'com.github.ybq:Android-SpinKit:1.1.0'
  240. // compile 'com.github.nanchen2251:CompressHelper:1.0.5'
  241. // compile(name: 'compresshelper-release', ext: 'aar')
  242. compile files('libs/compresshelper-release.jar')
  243. compile 'com.haibin:calendarview:3.4.4'
  244. compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-14'
  245. compile 'org.greenrobot:greendao:3.2.2'
  246. }
  247. static def releaseTime() {
  248. return new Date().format("MMddHHmm", TimeZone.getDefault())
  249. }
  250. //在apk文件后边生成版本号信息
  251. android.applicationVariants.all {
  252. variant ->
  253. variant.outputs.each {
  254. output ->
  255. if (buildType.name == "release") {
  256. output.outputFile = new File(output.outputFile.parent, productFlavors[0].name + "_" + buildType.name + "_v" + android.defaultConfig.versionName + "_" + android.defaultConfig.versionCode + "-${releaseTime()}.apk")
  257. }
  258. }
  259. }