Issue
In your opinion, what Eclipse configuration files need to be included in git commits and what are those that should be ignored?
Specifically, I am talking about an Ecore/Xtext project using Eclipse modeling framework under ubuntu.
The files I am thinking of are : .DS_Store .metadata .classpath .project .settings
I have a doubt about META-INF build.properties plugin.properties
And what about .gitignore itself?
I believe generated source files in src and src.gen should be included in commits since I may need to edit them in the future. I am right? Or maybe should I include them only once I edit them?
Thank you in advance,
Solution
Let me preface that many people say you shouldn't commit any IDE specific files to avoid restricting projects to a particular IDE. But in my experience when working with Eclipse plugins/EMF/Xtext projects it makes everything easier to only use Eclipse and include them. You might not need them if you use a pure maven-tycho build process though.
Anyway here is what I would commit.
Project files that should definitely be committed:
META-INF
contains important plugin meta data, like theMANIFEST.MF
plugin.properties
is used to localize theMANIFEST.MF
Eclipse-specific files that should be committed:
.project
is required to import the projects correctlybuild.properties
is required to build the project correctly.settings
contains plugin specific metadata, for example which Java versions.classpath
is as far as I know mostly generated and updated from other sources but could contain other information that you need. I never had any issues committing it.
Files that should usually be committed:
.gitignore
- it makes sense to have common rules for everyone. If anyone needs their own local ignore pattern, they should use.git/info/exclude
instead which is never commited.src-gen
- best practices often say that generated files should not be committed but every project I work at some point included this folder. Generating Java classes from large .ecore files can take some time. But even more important is, that if someone changes the model, everyone else has to generatesrc-gen
after checkout of that commit. In fast moving projects that means you may have to generatesrc-gen
after each checkout. If you checkout older commits or switch branches you have generatesrc-gen
. If you forget, your Eclipse workspace will be littered with errors. Generating on checkout could likely be scripted but its still a hassle. So just regeneratesrc-gen
when you change the model and spare everyone else from doing it every time. (By the way I would still avoid changing the files manually if possible. It's rarely required and can usually be avoided)
Files that shouldn't be committed:
.metadata
in the workspace. This contains e.g. information about projects in the workspace (including local projects not under version control) and likely contains user-specific paths.target
andbin
foldersxtend-gen
if you use Xtend. Unlikesrc-gen
, this one folder more ephemeral and is automatically regenerated by Eclipse when building.
Answered By - kapex
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.