基础组件库
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.
 
 
 
 
 

320 line
9.2 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. // 签名配置
  50. signingConfigs {
  51. // 智夜生活
  52. zhiying {
  53. storeFile file('zhiying.jks')
  54. storePassword 'zhioscom'
  55. keyAlias 'zysh'
  56. keyPassword 'zhioscom'
  57. v1SigningEnabled true
  58. v2SigningEnabled true
  59. }
  60. }
  61. flavorDimensions "app"
  62. buildTypes {
  63. debug {
  64. buildConfigField "boolean", "LOG_DEBUG", "true"
  65. minifyEnabled false
  66. zipAlignEnabled true
  67. shrinkResources false
  68. signingConfig signingConfigs.zhiying
  69. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  70. }
  71. release {
  72. buildConfigField "boolean", "LOG_DEBUG", "false"
  73. minifyEnabled false
  74. shrinkResources false
  75. zipAlignEnabled true
  76. signingConfig signingConfigs.zhiying
  77. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  78. }
  79. }
  80. dexOptions {
  81. //最大堆内存
  82. javaMaxHeapSize "4g"//4g
  83. //使用增量模式构建
  84. incremental true
  85. //是否支持大工程模式
  86. jumboMode = true
  87. //预编译
  88. preDexLibraries = false
  89. //线程数
  90. threadCount = 8
  91. }
  92. // 应用信息配置
  93. // productFlavors {
  94. // // 智夜生活
  95. // zhiying {
  96. // applicationId "cn.zhios.zhiying"
  97. // versionCode 14
  98. // dimension "app"
  99. // versionName '1.1.4'
  100. // // 签名信息
  101. // signingConfig signingConfigs.zhiying
  102. // }
  103. // }
  104. //
  105. // // 打包脚本
  106. // android.applicationVariants.all { variant ->
  107. // if (variant.buildType.name != "debug") {
  108. // variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk")
  109. // }
  110. //
  111. // variant.outputs.all { output ->
  112. // def outputFile = output.outputFile
  113. // if (outputFile != null && outputFile.name.endsWith('.apk')) {
  114. // //这里修改apk文件名
  115. // def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
  116. // outputFileName = fileName
  117. // }
  118. // }
  119. // }
  120. configurations.all {
  121. resolutionStrategy.eachDependency { DependencyResolveDetails details ->
  122. def requested = details.requested
  123. if (requested.group == 'com.android.support') {
  124. if (!requested.name.startsWith("multidex")) {
  125. details.useVersion '28.0.3'
  126. }
  127. }
  128. resolutionStrategy.force 'com.android.support:support-v4:28.0.0'
  129. }
  130. }
  131. }
  132. flutter {
  133. source '../..'
  134. }
  135. dependencies {
  136. implementation 'androidx.appcompat:appcompat:1.2.0'
  137. implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
  138. testImplementation 'junit:junit:4.12'
  139. androidTestImplementation 'androidx.test:runner:1.1.1'
  140. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  141. //登陆
  142. implementation 'com.ali.auth.sdk:alibabauth_core:2.0.0.11@aar'
  143. implementation 'com.ali.auth.sdk:alibabauth_ui:2.0.0.11@aar'
  144. implementation 'com.ali.auth.sdk:alibabauth_ext:2.0.0.11@aar'
  145. //安全组件
  146. implementation 'com.taobao.android:securityguardaar3:5.4.171@aar'
  147. implementation 'com.taobao.android:securitybodyaar3:5.4.99@aar'
  148. implementation 'com.taobao.android:avmpaar3:5.4.36@aar'
  149. implementation 'com.taobao.android:sgmiddletieraar3:5.4.9@aar'
  150. //Mtop
  151. implementation 'com.taobao.android:mtopsdk_allinone_open:3.1.2.5@jar'
  152. //applink
  153. implementation 'com.alibaba.sdk.android:alibc_link_partner:4.1.15@aar'
  154. //ut
  155. implementation 'com.taobao.android:utdid4all:1.5.2'
  156. implementation 'com.alibaba.mtl:app-monitor-sdk:2.6.4.5_for_bc'
  157. // 电商基础组件
  158. implementation 'com.alibaba.sdk.android:AlibcTradeCommon:4.0.0.16@aar'
  159. implementation 'com.alibaba.sdk.android:AlibcTradeBiz:4.0.0.16@aar'
  160. implementation 'com.alibaba.sdk.android:nb_trade:4.0.0.16@aar'
  161. implementation 'com.alibaba:fastjson:1.2.41@jar'
  162. }
  163. MobSDK {
  164. appKey "30dc33054b635"
  165. appSecret "396e98c293130c9976fb7428b6b434d6"
  166. MobLink {
  167. uriScheme "fnoos://cn.zhios.zhiying"
  168. appLinkHost "bied.t4m.cn"
  169. }
  170. //手机验证登录
  171. SecVerify {}
  172. //短信
  173. SMSSDK {}
  174. ShareSDK {
  175. // platform configuration information
  176. devInfo {
  177. QQ {
  178. appId "1111030588"
  179. appKey "XoHKlrBybXy7ORBt"
  180. shareByAppClient true
  181. bypassApproval false
  182. enable true
  183. }
  184. Wechat {
  185. appId "wx598aaef252cd78e4"
  186. appSecret "d2fc2edf9ece746765b3bfc0bf1b230e"
  187. withShareTicket true
  188. bypassApproval false
  189. enable true
  190. }
  191. WechatMoments {
  192. enable true
  193. }
  194. WechatFavorite {
  195. enable true
  196. }
  197. QZone {
  198. enable true
  199. }
  200. SinaWeibo {
  201. enable true
  202. }
  203. }
  204. }
  205. }
  206. // 注册SecVerify的相关信息
  207. //MobSDK {
  208. //// appKey "2ed488d929488"
  209. //// appSecret "53d4a16298d283828f2444cdd6d6548a"
  210. // //手机验证登录
  211. // SecVerify {}
  212. //
  213. // //短信
  214. // SMSSDK {}
  215. //
  216. // //调用MobPush,推送
  217. //// MobPush {
  218. //// //设置角标开关(不需要可不设置)
  219. ////// badge true
  220. //// //集成其他推送通道(可选)
  221. //// devInfo {
  222. //// //华为推送配置信息
  223. //// HUAWEI {
  224. //// appId "${HUAWEI_PUSH_ID}"
  225. //// }
  226. //// //魅族推送配置信息
  227. //// MEIZU {
  228. //// appId "${MEIZHU_PUSH_APPID}"
  229. //// appKey "${MEIZHU_PUSH_APPKEY}"
  230. //// }
  231. //// //小米推送配置信息
  232. //// XIAOMI {
  233. //// appId "${XIAOMI_PUSH_APPID}"
  234. //// appKey "${XIAOMI_PUSH_APPKEY}"
  235. //// }
  236. //// //FCM推送通道配置
  237. ////// FCM {
  238. //// //设置默认推送通知显示图标
  239. ////// iconRes "@mipmap/ic_launcher"
  240. ////// }
  241. //// //OPPO推送配置信息
  242. //// OPPO {
  243. //// appKey "${OPPO_PUSH_APPKEY}"
  244. //// appSecret "${OPPO_PUSH_APPSECRET}"
  245. //// }
  246. //// //VIVO推送配置信息
  247. //// VIVO {
  248. //// appId "${VIVO_PUSH_APPID}"
  249. //// appKey "${VIVO_PUSH_APPKEY}"
  250. //// }
  251. //// }
  252. //// }
  253. //
  254. // //分享
  255. // ShareSDK {
  256. // loopShare true
  257. // devInfo {
  258. // SinaWeibo {
  259. // enable true
  260. // }
  261. // Wechat {
  262. //// appId "${Wechat_appid}"
  263. //// appSecret "${Wechat_appSecret}"
  264. // enable true
  265. // withShareTicket true
  266. // bypassApproval false
  267. // }
  268. // QQ {
  269. // enable true
  270. // }
  271. // WechatMoments {
  272. // enable true
  273. // }
  274. // WechatFavorite {
  275. // enable true
  276. // }
  277. // QZone {
  278. // enable true
  279. // }
  280. // }
  281. // }
  282. //
  283. // //网页打开app,接受邀请码
  284. // MobLink {
  285. //// uriScheme "${uri_Scheme}"
  286. //// appLinkHost "${app_LinkHost}"
  287. // }
  288. //}