cordova cli 生成的项目的哪些部分可以在源代码控制中安全地进行版本控制? [英] What parts of cordova cli generated projects can be safely versioned in source control?

查看:17
本文介绍了cordova cli 生成的项目的哪些部分可以在源代码控制中安全地进行版本控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用 Cordova CLI 而不是本地种植的 ant 解决方案来管理 phonegap/科尔多瓦项目.我想知道目录树的哪些部分(如果有)不应置于版本控制之下?

I'm looking to use Cordova CLI instead of a home grown ant solution for command line management of a phonegap/cordova project. I'm wondering what parts of the directory tree, if any, should not be placed under version control?

推荐答案

这取决于您的项目和您的工作流程.

It depends on you project and your workflow.

对于很多项目,./www 文件夹就足够了,如前所述,但是还有一些其他文件夹可能会很好,具体取决于您使用的 cli 的哪些方面.

For a lot of projects, the ./www folder would be sufficient as already mentioned, however there are some other folders that could be good to have depending on what aspects of the cli you are using.

示例:

  • ./merges 用于平台特定的 HTML/CSS/JS 覆盖
  • ./.cordova 用于 cli 挂钩(如 before_build、after_plugin_add 等)
  • ./merges for platform specific HTML/CSS/JS overrides
  • ./.cordova for cli hooks (like before_build, after_plugin_add, etc)

加上在开发过程中您可能希望保留在 ./www 之外的任何其他自定义内容.例如,我有一个 ./src 文件夹,内容被连接起来并添加到 ./www 作为我们构建过程的一部分.我们的单元测试也在 ./www 之外.

Plus anything else custom you might want to keep out of ./www during development. For example, I have a ./src folder and the contents are concatenated and added to ./www as part of our build process. Our unit tests are also outside of ./www.

我有一个 .gitignore 而不是包含一个特定的文件夹,它可以保留像 ./platforms/*./plugins/* 这样的构建工件代码>不受版本控制.

Instead of including a specific folder, I have a .gitignore that keeps build artefacts like ./platforms/* and ./plugins/* out of version control.

这篇关于cordova cli 生成的项目的哪些部分可以在源代码控制中安全地进行版本控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆