基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 8.7 KiB

4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. // 添加插件
  2. def localProperties = new Properties()
  3. def localPropertiesFile = rootProject.file('local.properties')
  4. if (localPropertiesFile.exists()) {
  5. localPropertiesFile.withReader('UTF-8') { reader ->
  6. localProperties.load(reader)
  7. }
  8. }
  9. def flutterRoot = localProperties.getProperty('flutter.sdk')
  10. if (flutterRoot == null) {
  11. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  12. }
  13. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  14. if (flutterVersionCode == null) {
  15. flutterVersionCode = '1'
  16. }
  17. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  18. if (flutterVersionName == null) {
  19. flutterVersionName = '1.0'
  20. }
  21. // 获取当前时间(年月日)
  22. def releaseTime() {
  23. return new Date().format("YYYYMMdd", TimeZone.getTimeZone("UTC"))
  24. }
  25. apply plugin: 'com.android.application'
  26. apply plugin: 'com.mob.sdk'
  27. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  28. android {
  29. compileSdkVersion 28
  30. lintOptions {
  31. disable 'InvalidPackage'
  32. }
  33. // 默认配置
  34. defaultConfig {
  35. applicationId "cn.zhios.zhiying"
  36. minSdkVersion 21
  37. targetSdkVersion 28
  38. versionCode 1
  39. versionName "1.0"
  40. aaptOptions.cruncherEnabled = false
  41. aaptOptions.useNewCruncher = false
  42. multiDexEnabled true
  43. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  44. ndk {
  45. //选择要添加的对应cpu类型的.so库。
  46. abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'
  47. }
  48. }
  49. buildTypes {
  50. debug {
  51. buildConfigField "boolean", "LOG_DEBUG", "true"
  52. minifyEnabled false
  53. zipAlignEnabled true
  54. shrinkResources false
  55. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  56. }
  57. release {
  58. buildConfigField "boolean", "LOG_DEBUG", "false"
  59. minifyEnabled false
  60. shrinkResources false
  61. zipAlignEnabled true
  62. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  63. }
  64. }
  65. dexOptions {
  66. //最大堆内存
  67. javaMaxHeapSize "4g"//4g
  68. //使用增量模式构建
  69. incremental true
  70. //是否支持大工程模式
  71. jumboMode = true
  72. //预编译
  73. preDexLibraries = false
  74. //线程数
  75. threadCount = 8
  76. }
  77. // // 签名配置
  78. // signingConfigs {
  79. // // 智夜生活
  80. // zhiying {
  81. // storeFile file('zhiying.jks')
  82. // storePassword 'zhioscom'
  83. // keyAlias 'zysh'
  84. // keyPassword 'zhioscom'
  85. // v1SigningEnabled true
  86. // v2SigningEnabled true
  87. // }
  88. //
  89. // }
  90. //
  91. // flavorDimensions "app"
  92. //
  93. //
  94. // // 应用信息配置
  95. // productFlavors {
  96. // // 智夜生活
  97. // zhiying {
  98. // applicationId "cn.zhios.zhiying"
  99. // versionCode 3
  100. // dimension "app"
  101. // versionName '1.0.3'
  102. // // 签名信息
  103. // signingConfig signingConfigs.zhiying
  104. // }
  105. // }
  106. //
  107. // // 打包脚本
  108. // android.applicationVariants.all { variant ->
  109. // if (variant.buildType.name != "debug") {
  110. // variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk")
  111. // }
  112. //
  113. // variant.outputs.all { output ->
  114. // def outputFile = output.outputFile
  115. // if (outputFile != null && outputFile.name.endsWith('.apk')) {
  116. // //这里修改apk文件名
  117. // def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
  118. // outputFileName = fileName
  119. // }
  120. // }
  121. // }
  122. configurations.all {
  123. resolutionStrategy.eachDependency { DependencyResolveDetails details ->
  124. def requested = details.requested
  125. if (requested.group == 'com.android.support') {
  126. if (!requested.name.startsWith("multidex")) {
  127. details.useVersion '28.0.3'
  128. }
  129. }
  130. resolutionStrategy.force 'com.android.support:support-v4:28.0.0'
  131. }
  132. }
  133. }
  134. flutter {
  135. source '../..'
  136. }
  137. dependencies {
  138. implementation 'androidx.appcompat:appcompat:1.2.0'
  139. implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
  140. testImplementation 'junit:junit:4.12'
  141. androidTestImplementation 'androidx.test:runner:1.1.1'
  142. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  143. //登陆
  144. implementation 'com.ali.auth.sdk:alibabauth_core:2.0.0.11@aar'
  145. implementation 'com.ali.auth.sdk:alibabauth_ui:2.0.0.11@aar'
  146. implementation 'com.ali.auth.sdk:alibabauth_ext:2.0.0.11@aar'
  147. //安全组件
  148. implementation 'com.taobao.android:securityguardaar3:5.4.171@aar'
  149. implementation 'com.taobao.android:securitybodyaar3:5.4.99@aar'
  150. implementation 'com.taobao.android:avmpaar3:5.4.36@aar'
  151. implementation 'com.taobao.android:sgmiddletieraar3:5.4.9@aar'
  152. //Mtop
  153. implementation 'com.taobao.android:mtopsdk_allinone_open:3.1.2.5@jar'
  154. //applink
  155. implementation 'com.alibaba.sdk.android:alibc_link_partner:4.1.15@aar'
  156. //ut
  157. implementation 'com.taobao.android:utdid4all:1.5.2'
  158. implementation 'com.alibaba.mtl:app-monitor-sdk:2.6.4.5_for_bc'
  159. // 电商基础组件
  160. implementation 'com.alibaba.sdk.android:AlibcTradeCommon:4.0.0.16@aar'
  161. implementation 'com.alibaba.sdk.android:AlibcTradeBiz:4.0.0.16@aar'
  162. implementation 'com.alibaba.sdk.android:nb_trade:4.0.0.16@aar'
  163. implementation 'com.alibaba:fastjson:1.2.41@jar'
  164. }
  165. MobSDK {
  166. appKey "30dc33054b635"
  167. appSecret "396e98c293130c9976fb7428b6b434d6"
  168. ShareSDK {
  169. // platform configuration information
  170. devInfo {
  171. QQ {
  172. appId "1111030588"
  173. appKey "XoHKlrBybXy7ORBt"
  174. shareByAppClient true
  175. bypassApproval false
  176. enable true
  177. }
  178. WechatMoments {
  179. enable true
  180. }
  181. WechatFavorite {
  182. enable true
  183. }
  184. QZone {
  185. enable true
  186. }
  187. SinaWeibo {
  188. enable true
  189. }
  190. }
  191. }
  192. }
  193. // 注册SecVerify的相关信息
  194. //MobSDK {
  195. //// appKey "2ed488d929488"
  196. //// appSecret "53d4a16298d283828f2444cdd6d6548a"
  197. // //手机验证登录
  198. // SecVerify {}
  199. //
  200. // //短信
  201. // SMSSDK {}
  202. //
  203. // //调用MobPush,推送
  204. //// MobPush {
  205. //// //设置角标开关(不需要可不设置)
  206. ////// badge true
  207. //// //集成其他推送通道(可选)
  208. //// devInfo {
  209. //// //华为推送配置信息
  210. //// HUAWEI {
  211. //// appId "${HUAWEI_PUSH_ID}"
  212. //// }
  213. //// //魅族推送配置信息
  214. //// MEIZU {
  215. //// appId "${MEIZHU_PUSH_APPID}"
  216. //// appKey "${MEIZHU_PUSH_APPKEY}"
  217. //// }
  218. //// //小米推送配置信息
  219. //// XIAOMI {
  220. //// appId "${XIAOMI_PUSH_APPID}"
  221. //// appKey "${XIAOMI_PUSH_APPKEY}"
  222. //// }
  223. //// //FCM推送通道配置
  224. ////// FCM {
  225. //// //设置默认推送通知显示图标
  226. ////// iconRes "@mipmap/ic_launcher"
  227. ////// }
  228. //// //OPPO推送配置信息
  229. //// OPPO {
  230. //// appKey "${OPPO_PUSH_APPKEY}"
  231. //// appSecret "${OPPO_PUSH_APPSECRET}"
  232. //// }
  233. //// //VIVO推送配置信息
  234. //// VIVO {
  235. //// appId "${VIVO_PUSH_APPID}"
  236. //// appKey "${VIVO_PUSH_APPKEY}"
  237. //// }
  238. //// }
  239. //// }
  240. //
  241. // //分享
  242. // ShareSDK {
  243. // loopShare true
  244. // devInfo {
  245. // SinaWeibo {
  246. // enable true
  247. // }
  248. // Wechat {
  249. //// appId "${Wechat_appid}"
  250. //// appSecret "${Wechat_appSecret}"
  251. // enable true
  252. // withShareTicket true
  253. // bypassApproval false
  254. // }
  255. // QQ {
  256. // enable true
  257. // }
  258. // WechatMoments {
  259. // enable true
  260. // }
  261. // WechatFavorite {
  262. // enable true
  263. // }
  264. // QZone {
  265. // enable true
  266. // }
  267. // }
  268. // }
  269. //
  270. // //网页打开app,接受邀请码
  271. // MobLink {
  272. //// uriScheme "${uri_Scheme}"
  273. //// appLinkHost "${app_LinkHost}"
  274. // }
  275. //}