build.gradle 11 KB

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