I have seen samples for Mercurial ignore files for Visual Studio, amongst others.
I've just started playing around with Android development, and I also use this time to experimenting with Mercurial. So my question is: does anyone have a good example of a .hgignore
file to use for Eclipse and Android development?
For starters I've got the following myself:
# use glob syntax
syntax: glob
# Ignore patterns
.metadata\
bin\
gen\
Are there any other ignore patterns that should be included? Should for instance the Eclipse files .classpath
and .project
be omitted from version control as well?
-- Edit below --
I haven't quite gotten the answers I hoped for yet, so I'll put out a bounty and try to specify a bit clearer what I'm looking for.
After experimenting a bit myself, I seem to have found that the suggested .hgignore
listed above seems to be sufficient. The only addition I've made, is one line with .settings
(this was a folder that appeared after I ran Android Tools -> Fix Project Properties). I've also found that (as mentioned by Ry4an) that the Eclipse files .classpath
and .project
should not be excluded.
I am however uncertain that this small ignore file will be sufficient when I get to projects a bit bigger than the basic tutorials (if it actually is all good, please explain why, and you'll get the credit). So to summarize what I'm looking for:
.hgignore
file for an Android project under EclipseThe eclipse files should definitely be added. The general guideline is to add:
That last one is where your judgement comes in. It clearly excludes the .jar files you build yourself and your final .apk, but does it include third party .jar's you use? Some people do include them, but better is to include a configuration file for a dependency manager like 'ivy' which lets the next builder download the requirements they need automatically.
After auto-creating a project in my tools of choice, I'll just do a command like this:
hg status --unknown --no-status >> .hgignore
which adds the list of all unknown files to .hgignore. Then I go in and remove things I wants saved (ex: .project) and wildcard files that will grow siblings (ex: **.class)