基础组件库
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

291 行
8.4 KiB

  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. }
  179. }
  180. }
  181. // 注册SecVerify的相关信息
  182. //MobSDK {
  183. //// appKey "2ed488d929488"
  184. //// appSecret "53d4a16298d283828f2444cdd6d6548a"
  185. // //手机验证登录
  186. // SecVerify {}
  187. //
  188. // //短信
  189. // SMSSDK {}
  190. //
  191. // //调用MobPush,推送
  192. //// MobPush {
  193. //// //设置角标开关(不需要可不设置)
  194. ////// badge true
  195. //// //集成其他推送通道(可选)
  196. //// devInfo {
  197. //// //华为推送配置信息
  198. //// HUAWEI {
  199. //// appId "${HUAWEI_PUSH_ID}"
  200. //// }
  201. //// //魅族推送配置信息
  202. //// MEIZU {
  203. //// appId "${MEIZHU_PUSH_APPID}"
  204. //// appKey "${MEIZHU_PUSH_APPKEY}"
  205. //// }
  206. //// //小米推送配置信息
  207. //// XIAOMI {
  208. //// appId "${XIAOMI_PUSH_APPID}"
  209. //// appKey "${XIAOMI_PUSH_APPKEY}"
  210. //// }
  211. //// //FCM推送通道配置
  212. ////// FCM {
  213. //// //设置默认推送通知显示图标
  214. ////// iconRes "@mipmap/ic_launcher"
  215. ////// }
  216. //// //OPPO推送配置信息
  217. //// OPPO {
  218. //// appKey "${OPPO_PUSH_APPKEY}"
  219. //// appSecret "${OPPO_PUSH_APPSECRET}"
  220. //// }
  221. //// //VIVO推送配置信息
  222. //// VIVO {
  223. //// appId "${VIVO_PUSH_APPID}"
  224. //// appKey "${VIVO_PUSH_APPKEY}"
  225. //// }
  226. //// }
  227. //// }
  228. //
  229. // //分享
  230. // ShareSDK {
  231. // loopShare true
  232. // devInfo {
  233. // SinaWeibo {
  234. // enable true
  235. // }
  236. // Wechat {
  237. //// appId "${Wechat_appid}"
  238. //// appSecret "${Wechat_appSecret}"
  239. // enable true
  240. // withShareTicket true
  241. // bypassApproval false
  242. // }
  243. // QQ {
  244. // enable true
  245. // }
  246. // WechatMoments {
  247. // enable true
  248. // }
  249. // WechatFavorite {
  250. // enable true
  251. // }
  252. // QZone {
  253. // enable true
  254. // }
  255. // }
  256. // }
  257. //
  258. // //网页打开app,接受邀请码
  259. // MobLink {
  260. //// uriScheme "${uri_Scheme}"
  261. //// appLinkHost "${app_LinkHost}"
  262. // }
  263. //}