基础组件库
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

267 lignes
7.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. 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. // // 签名配置
  79. // signingConfigs {
  80. // // 智夜生活
  81. // zhiying {
  82. // storeFile file('zhiying.jks')
  83. // storePassword 'zhioscom'
  84. // keyAlias 'zysh'
  85. // keyPassword 'zhioscom'
  86. // v1SigningEnabled true
  87. // v2SigningEnabled true
  88. // }
  89. //
  90. // }
  91. //
  92. // flavorDimensions "app"
  93. //
  94. //
  95. // // 应用信息配置
  96. // productFlavors {
  97. // // 智夜生活
  98. // zhiying {
  99. // applicationId "cn.zhios.zhiying"
  100. // versionCode 1
  101. // dimension "app"
  102. // versionName '1.0.0'
  103. // // 签名信息
  104. // signingConfig signingConfigs.zhiying
  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. 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. MobSDK {
  143. appKey "30dc33054b635"
  144. appSecret "396e98c293130c9976fb7428b6b434d6"
  145. ShareSDK {
  146. // platform configuration information
  147. devInfo {
  148. QQ {
  149. appId "1111030588"
  150. appKey "XoHKlrBybXy7ORBt"
  151. shareByAppClient true
  152. bypassApproval false
  153. enable true
  154. }
  155. }
  156. }
  157. }
  158. // 注册SecVerify的相关信息
  159. //MobSDK {
  160. //// appKey "2ed488d929488"
  161. //// appSecret "53d4a16298d283828f2444cdd6d6548a"
  162. // //手机验证登录
  163. // SecVerify {}
  164. //
  165. // //短信
  166. // SMSSDK {}
  167. //
  168. // //调用MobPush,推送
  169. //// MobPush {
  170. //// //设置角标开关(不需要可不设置)
  171. ////// badge true
  172. //// //集成其他推送通道(可选)
  173. //// devInfo {
  174. //// //华为推送配置信息
  175. //// HUAWEI {
  176. //// appId "${HUAWEI_PUSH_ID}"
  177. //// }
  178. //// //魅族推送配置信息
  179. //// MEIZU {
  180. //// appId "${MEIZHU_PUSH_APPID}"
  181. //// appKey "${MEIZHU_PUSH_APPKEY}"
  182. //// }
  183. //// //小米推送配置信息
  184. //// XIAOMI {
  185. //// appId "${XIAOMI_PUSH_APPID}"
  186. //// appKey "${XIAOMI_PUSH_APPKEY}"
  187. //// }
  188. //// //FCM推送通道配置
  189. ////// FCM {
  190. //// //设置默认推送通知显示图标
  191. ////// iconRes "@mipmap/ic_launcher"
  192. ////// }
  193. //// //OPPO推送配置信息
  194. //// OPPO {
  195. //// appKey "${OPPO_PUSH_APPKEY}"
  196. //// appSecret "${OPPO_PUSH_APPSECRET}"
  197. //// }
  198. //// //VIVO推送配置信息
  199. //// VIVO {
  200. //// appId "${VIVO_PUSH_APPID}"
  201. //// appKey "${VIVO_PUSH_APPKEY}"
  202. //// }
  203. //// }
  204. //// }
  205. //
  206. // //分享
  207. // ShareSDK {
  208. // loopShare true
  209. // devInfo {
  210. // SinaWeibo {
  211. // enable true
  212. // }
  213. // Wechat {
  214. //// appId "${Wechat_appid}"
  215. //// appSecret "${Wechat_appSecret}"
  216. // enable true
  217. // withShareTicket true
  218. // bypassApproval false
  219. // }
  220. // QQ {
  221. // enable true
  222. // }
  223. // WechatMoments {
  224. // enable true
  225. // }
  226. // WechatFavorite {
  227. // enable true
  228. // }
  229. // QZone {
  230. // enable true
  231. // }
  232. // }
  233. // }
  234. //
  235. // //网页打开app,接受邀请码
  236. // MobLink {
  237. //// uriScheme "${uri_Scheme}"
  238. //// appLinkHost "${app_LinkHost}"
  239. // }
  240. //}