build.gradle 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.jakewharton.butterknife'
  3. android {
  4. compileSdkVersion androidConfigs.compileSdkVersion
  5. buildToolsVersion androidConfigs.buildToolsVersion
  6. defaultConfig {
  7. applicationId "com.sheep.jiuyan.samllsheep"
  8. minSdkVersion 18
  9. targetSdkVersion 27
  10. versionCode VERSION_CODE as int
  11. versionName VERSION_NAME
  12. multiDexEnabled true
  13. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  14. ndk {
  15. abiFilters "armeabi-v7a", 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
  16. }
  17. // jackOptions {
  18. // enabled true
  19. // }
  20. multiDexEnabled true
  21. }
  22. // compileOptions{
  23. // sourceCompatibility org.gradle.api.JavaVersion.VERSION_1_8
  24. // targetCompatibility org.gradle.api.JavaVersion.VERSION_1_8
  25. // }
  26. signingConfigs {
  27. config {
  28. keyAlias 'sheep'
  29. keyPassword 'zhaoyi2004'
  30. storeFile file('.././sign.jks')
  31. storePassword 'zhaoyi2004'
  32. v1SigningEnabled true
  33. v2SigningEnabled false
  34. }
  35. }
  36. lintOptions {
  37. abortOnError false
  38. disable 'MissingTranslation'
  39. }
  40. dexOptions {
  41. preDexLibraries = false
  42. javaMaxHeapSize "4g"
  43. }
  44. packagingOptions {
  45. exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
  46. }
  47. buildTypes {
  48. release {
  49. minifyEnabled true
  50. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  51. signingConfig signingConfigs.config
  52. }
  53. debug {
  54. signingConfig signingConfigs.config
  55. }
  56. }
  57. productFlavors.all { flavor ->
  58. flavor.manifestPlaceholders = [DUANDUAN_GRAPH : "${flavor.name}",
  59. DUANDUAN_DATASHARE : "${flavor.name}",
  60. ]
  61. }
  62. productFlavors {
  63. developSheeptest {
  64. applicationId "com.sheep.jiuyan.samllsheep"
  65. manifestPlaceholders = [DUANDUAN_GRAPH : "sheeptest",
  66. DUANDUAN_DATASHARE : "sheeptest",
  67. jpush_appkey : "4fea09bdbf9661a9689ee306",
  68. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  69. ]
  70. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptest"'
  71. buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptest"'
  72. buildConfigField "String", "app_name", '"小绵羊测试"'
  73. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  74. buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
  75. signingConfig signingConfigs.config
  76. }
  77. sheeptestjiguang {
  78. applicationId "com.sheep.jiuyan.samllsheep.test"
  79. manifestPlaceholders = [DUANDUAN_GRAPH : "sheeptestjiguang",
  80. DUANDUAN_DATASHARE : "sheeptestjiguang",
  81. jpush_appkey : "4fea09bdbf9661a9689ee306",
  82. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  83. ]
  84. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptestjiguang"'
  85. buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptestjiguang"'
  86. buildConfigField "String", "app_name", '"小绵羊测试"'
  87. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  88. buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
  89. signingConfig signingConfigs.config
  90. }
  91. sheep {
  92. applicationId "com.sheep.jiuyan.samllsheep"
  93. manifestPlaceholders = [DUANDUAN_GRAPH : "sheep",
  94. DUANDUAN_DATASHARE : "sheep",
  95. jpush_appkey : "28b74d520261c6f78e3e0921",
  96. umeng_app_key : "5ab0a1da8f4a9d742900035f"
  97. ]
  98. buildConfigField "String", "DUANDUAN_DATASHARE", '"sheep"'
  99. buildConfigField "String", "DUANDUAN_GRAPH", '"sheep"'
  100. buildConfigField "String", "app_name", '"小绵羊"'
  101. buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
  102. buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
  103. signingConfig signingConfigs.config
  104. }
  105. }
  106. sourceSets {
  107. main() {
  108. jniLibs.srcDirs = ['src/main/libs']
  109. jni.srcDirs = [] //屏蔽掉默认的jni编译生成过程
  110. }
  111. }
  112. }
  113. repositories {
  114. flatDir {
  115. dirs 'libs'
  116. }
  117. google()
  118. }
  119. dependencies {
  120. compile "com.android.support:design:$supportLibVersion"
  121. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  122. testCompile 'junit:junit:4.12'
  123. compile 'com.google.code.gson:gson:2.8.2'
  124. compile('com.jcodecraeer:xrecyclerview:1.5.2') {
  125. // compile 'com.shark:screencapture:1.0.0'
  126. exclude group: 'com.android.support', module: 'design'
  127. }
  128. compile 'com.squareup.okhttp3:okhttp:3.10.0'
  129. compile 'org.greenrobot:eventbus:3.1.1'
  130. compile 'com.zhy:base-adapter:3.0.3'
  131. // compile 'com.liulishuo.filedownloader:library:1.6.9'
  132. compile 'com.tencent.bugly:crashreport_upgrade:1.3.4'
  133. //其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
  134. compile 'com.tencent.bugly:nativecrashreport:3.3.1'
  135. //其中latest.release指代最
  136. // compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
  137. debugCompile('com.readystatesoftware.chuck:library:1.1.0') {
  138. exclude group: 'com.android.support', module: 'design'
  139. }
  140. // compile 'de.hdodenhof:circleimageview:2.2.0'
  141. releaseCompile('com.readystatesoftware.chuck:library-no-op:1.1.0') {
  142. exclude group: 'com.android.support', module: 'design'
  143. }
  144. compile 'org.xutils:xutils:3.5.0'
  145. compile 'com.mylhyl:acp:1.1.7'
  146. compile 'cn.yipianfengye.android:zxing-library:2.2'
  147. compile 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
  148. debugCompile 'com.android.support:multidex:1.0.1'
  149. //不要修改这里,相信我
  150. releaseCompile 'com.android.support:multidex:1.0.3'
  151. compile(name: 'com.kfzs.safe', ext: 'aar')
  152. //butterknife
  153. compile 'com.jakewharton:butterknife:8.8.1'
  154. annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
  155. //dagger2
  156. // compile 'com.google.dagger:dagger:+'
  157. // compile 'com.google.dagger:dagger-compiler:+'
  158. provided 'org.glassfish:javax.annotation:10.0-b28'
  159. compile 'com.google.dagger:dagger:2.12'
  160. annotationProcessor 'com.google.dagger:dagger-compiler:2.12'
  161. //retrofit
  162. compile 'com.squareup.retrofit2:retrofit:2.4.0'
  163. compile 'com.squareup.retrofit2:converter-gson:2.4.0'
  164. compile 'com.squareup.okhttp3:logging-interceptor:3.10.0'
  165. // compile 'com.squareup.retrofit2:adapter-rxjava2:+'
  166. compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
  167. //rxjava
  168. compile 'io.reactivex.rxjava2:rxandroid:2.0.2'
  169. compile 'io.reactivex.rxjava2:rxjava:2.1.12'
  170. //获取动态权限三方库
  171. compile 'pub.devrel:easypermissions:1.2.0'
  172. compile 'net.danlew:android.joda:2.9.3'
  173. compile 'com.orhanobut:logger:1.15'
  174. //友盟
  175. compile 'com.umeng.sdk:common:1.5.3'
  176. //compile 'com.umeng.sdk:analytics:latest.integration'
  177. //fast json
  178. compile 'com.alibaba:fastjson:1.2.47'
  179. //添加半袋米相关
  180. compile(name: 'appstoreutils', ext: 'aar')
  181. compile project(':view')
  182. // compile(name: 'view-release', ext: 'aar')
  183. compile 'com.flipboard:bottomsheet-core:1.5.3'
  184. compile 'com.flipboard:bottomsheet-commons:1.5.3'
  185. compile 'com.google.protobuf:protobuf-java:3.2.0'
  186. compile files('libs/open_sdk_r5923_lite.jar')
  187. compile files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
  188. compile files('libs/umeng_social_tool.jar')
  189. compile files('libs/umeng_social_shareboard.jar')
  190. compile files('libs/umeng_social_net.jar')
  191. compile files('libs/umeng_social_api.jar')
  192. compile files('libs/umeng_shareboard_widget.jar')
  193. compile files('libs/SocialSDK_WeiXin_Full.jar')
  194. compile files('libs/SocialSDK_QQ_Full.jar')
  195. compile 'com.zhy:okhttputils:2.6.2'
  196. // compile 'com.kf.framework:kf-utils:latest.integration@aar'
  197. compile 'com.kf.framework:kf-utils:1.4.5@aar'
  198. // compile 'com.kf.framework:volleyplus:latest.integration@aar'
  199. compile 'com.kf.framework:volleyplus:1.4.5@aar'
  200. compile "com.android.support:support-annotations:$supportLibVersion"
  201. compile "com.android.support:recyclerview-v7:$supportLibVersion"
  202. compile project(':datashare')
  203. compile files('libs/jackson-core-2.2.1.jar')
  204. compile files('libs/jackson-dataformat-xml-2.1.2.jar')
  205. compile 'io.reactivex:rxandroid:1.2.1'
  206. compile 'com.github.ithedan:TextViewDrawable:v1.0'
  207. // compile 'com.github.zhangkexpz:LayoutScroll:v1.0'
  208. // compile 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
  209. compile(name: 'PhotoPicker-release', ext: 'aar')
  210. compile 'com.github.bumptech.glide:glide:4.1.1'
  211. // compile 'com.github.yalantis:ucrop:2.2.1-native'
  212. // compile 'com.google.zxing:core:3.3.0'
  213. compile project(':ucrop')
  214. compile('com.arialyy.aria:aria-core:3.3.16') {
  215. exclude group: 'com.android.support'
  216. }
  217. // compile project(':Aria')
  218. annotationProcessor 'com.arialyy.aria:aria-compiler:3.3.16'
  219. compile 'com.sunfusheng:marqueeview:1.3.3'
  220. compile files('libs/alipaySdk-20170922.jar')
  221. //极光
  222. compile files('libs/jcore-android-1.2.0.jar')
  223. compile files('libs/jpush-android-3.1.2.jar')
  224. //定位
  225. compile files('libs/BaiduLBS_Android.jar')
  226. //幂动科技
  227. compile files('libs/mdsdk.jar')
  228. //轮播图
  229. compile 'com.youth.banner:banner:1.4.10' //最新版本
  230. //loading
  231. compile 'com.github.ybq:Android-SpinKit:1.1.0'
  232. // compile 'com.github.nanchen2251:CompressHelper:1.0.5'
  233. // compile(name: 'compresshelper-release', ext: 'aar')
  234. compile files('libs/compresshelper-release.jar')
  235. }
  236. static def releaseTime() {
  237. return new Date().format("MMddHHmm", TimeZone.getDefault())
  238. }
  239. //在apk文件后边生成版本号信息
  240. android.applicationVariants.all {
  241. variant ->
  242. variant.outputs.each {
  243. output ->
  244. if(buildType.name == "release") {
  245. output.outputFile = new File(output.outputFile.parent, productFlavors[0].name + "_" + buildType.name + "_v" + android.defaultConfig.versionName + "_" + android.defaultConfig.versionCode + "-${releaseTime()}.apk")
  246. }
  247. }
  248. }