gpt4 book ai didi

android - Cordova在android项目中添加插件很慢

转载 作者:行者123 更新时间:2023-11-29 16:34:35 25 4
gpt4 key购买 nike

我们正在 CI 上自动构建 APK,但整个过程大约需要 10 分钟,80% 的时间都花在了这个阶段。

Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for android
Adding cordova-plugin-statusbar to package.json
Saved plugin info for "cordova-plugin-statusbar" to config.xml.

这些是来自 config.xml

的插件
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-device" spec="2.0.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^2.0.0" />
<plugin name="phonegap-plugin-barcodescanner" spec="^8.0.0">
<variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
</plugin>
<plugin name="cordova-plugin-camera-preview" spec="^0.10.0" />
<plugin name="cordova-plugin-screen-orientation" spec="^3.0.1" />
<plugin name="cordova.plugins.diagnostic" spec="^4.0.10" />
<plugin name="cordova-android-support-gradle-release" spec="^1.4.4">
<variable name="ANDROID_SUPPORT_VERSION" value="26.+" />
</plugin>
<plugin name="cordova-sqlite-storage" spec="^2.4.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.2" />
<plugin name="cordova-plugin-camera" spec="^4.0.3" />

是否可以通过某种方式缓存结果或任何其他方式来加速插件的安装来加速这些过程?

最佳答案

如果您将 Cordova plugins/ 目录置于版本控制之下(大概在您的 Git 存储库中),那么当项目在 CI 环境中 checkout 时,Cordova 将查找并使用那些本地插件而不是离开去通过 npm 远程获取每一个。这应该使过程更快。如果/当您需要更新插件时,只需将更新提交到 repo。

虽然理论上您也可以将 platforms/ 提交到您的 repo 以加快构建速度(这样 Cordova 就不必安装和构建每个平台项目),但我建议不要这样做,因为Cordova 项目中的平台项目应被视为易变的。

关于android - Cordova在android项目中添加插件很慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52835049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com