开发者

What files are unnecessary when exporting an Eclipse Workspace to a version control repository?

I have a few Android and Java projects under a single Eclipse workspace and would like to export the complete workspace to my own version control repository. I would like to keep the files being exported to a minimum. As such, other than the resource history and the JDT caching as mentioned by this article, is there any other files that do not need to be exported?

Note that a subsequent export of the imported workspace should result in a working build without adding additional files that are not already in the repository.

Under the [workspace]/.p开发者_开发技巧lugins/.metadata directory, I have the following directories

  1. org.eclipse.core.resources
  2. org.eclipse.core.runtime
  3. org.eclipse.debug.core
  4. org.eclipse.debug.ui
  5. org.eclipse.epp.usagedata.recording
  6. org.eclipse.equinox.p2.ui
  7. org.eclipse.jdt.core
  8. org.eclipse.jdt.debug.ui
  9. org.eclipse.jdt.junit.core
  10. org.eclipse.jdt.launching
  11. org.eclipse.jdt.ui
  12. org.eclipse.ltk.core.refactoring
  13. org.eclipse.ltk.ui.refactoring
  14. org.eclipse.mylyn.bugzilla.core
  15. org.eclipse.mylyn.tasks.ui
  16. org.eclipse.team.cvs.core
  17. org.eclipse.ui.ide
  18. org.eclipse.ui.intro
  19. org.eclipse.ui.workbench
  20. org.eclipse.ui.workbench.texteditor
  21. org.eclipse.wst.internet.cache
  22. org.eclipse.wst.sse.ui
  23. org.eclipse.wst.xml.core


Typically you will only be storing files under version control that are required for successfully building the application. But to help with development in large teams it is also typical (though not best practice) to store the bare minimum meta data required to reconstruct the Java project in the teams IDE of choice. So to sum up, from Eclipse you would want to export:

  • All Java source files and folders
  • All web application source files and folders
  • All custom source files and folders (i.e folders created by you with XML files etc)
  • The .project and .classpath files for your top level Eclipse project

You definitely do not want to export any Eclipse specific files/folders like .plugins. If you want a hard and fast guide, you should export to your VCS, any files/folders needed to build your application, imagining that the development could happen in any IDE. Using that hard and fast rule you can easily determine what to store, and it also becomes obvious that storing the .classpath and .project in VCS are really just crutches to speed up setting up a new Eclipse with your application faster. It's your judgement call really wether to include those two files.

What files are unnecessary when exporting an Eclipse Workspace to a version control repository?


The only directories/files you need in your repo for most projects are:

res/    
src/
assets/ (if used)
AndroidManifest.xml
default.properties


I think the simple answer is that you'll need to include all of the files if you want to be able to rebuild the workspace accurately. They aren't going to take a lot of space up in any case.

If you start checking in just pieces of the workspace, you would need to talk to the eclipse developers to ascertain that there will be no unknown side affects to that. It's not really worth it.

If it helps, I work on a lot of projects using eclipse and we don't check in the workspace at all.

Rebuilding the workspace from scratch isn't generally a problem and happens automatically.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜