Which files to keep under source control for google-chrome-app?

对着背影说爱祢 提交于 2019-12-24 04:47:11

问题


https://github.com/MobileChromeApps/mobile-chrome-apps allows Chrome Apps to work on mobile.

Their getting started wiki is really good to get things working but it generates a lot of files with absolute paths. Nothing is said about which files to keep under source control.

At the moment I'm using each build: $ cca create YourApp --link-to=path/to/manifest.json which seems just wrong (for example the config.xml is lost).


回答1:


TLDR; www/ is by far the most important. For the rest, just control what you edit, and trust that cca create --link-to= will re-create the project in a good state.


The files generated during cca create fall into two main buckets:

  1. Your application; This obviously includes everything in the www/ folder, but also config.xml, merges/ (optional), and hooks/ (optional).
  2. cordova/cca build artifacts; This includes plaforms/ and plugins/, and, well, anything else :)

Absolutely you should version control #1. Many developers don't actually use merges/ or hooks/ (at least at first), and config.xml is actually auto-generated during cca create using values from your www/manifest.json, so its fine to not version it unless you made manual edits. We realize its common to add <preference>'s there, so we are working on adding support for importing merges/ hooks/ and config.xml using --link-to=path/to/config.xml. Sorry if you need this feature today, please follow this issue to find out when it is resolves in cca.

As for #2, that depends on your preference. If you are making edits directly to the native bits of the platforms, then you should absolutely add those to version control. Or, if you want 100% control over how those bits evolve and you are 100% happy with the way the projects are working for you today, then sure, add them to version control.

However, we (cca and cordova developers) are constantly fixing, evolving, and improving platforms/ and plugins/, and by far the easiest way to "upgrade" your project right now is to just re-create it. We try very hard to be backwards compatible (and yell loud when we aren't), so you should have considerable confidence that a project today will work at least as well created next week.

Personally, I keep only #1 in version control, and re-create projects often (whenever the tools update, hey its quick!). Its not been an issue yet. I think the cca create --link-to=path-to-app syntax really helps here, and we are considering adding support for a cca update to make this even easier, eventually.

Finally, one developer working with cca has blogged about his experience, and one of the topics he covers is what to check in. He came to the same conclusion as we suggest.

Good Luck!



来源:https://stackoverflow.com/questions/22126126/which-files-to-keep-under-source-control-for-google-chrome-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!