Showing posts with label .hgignore. Show all posts
Showing posts with label .hgignore. Show all posts

Saturday, November 5, 2011

.hgignore for Android

If you use source control one of the first things you want to do is create an ignore rules file for binaries and auto generated files so they don't pollute check ins with useless changes.
Most developers out there use Mercurial and GIT for source control. Both of these systems are very similar and work fine for any project.

Here's the base .hgignore I've created over the course of making a few Android projects. This version is unique in that it will ignore the directories if your Android projects are placed in the root or in a subdirectory of the repository. It doesn't have that bug where a directory ending in an excluded directory's name also mistakenly get ignored. Like, should remain robin/ but bin/ is ignored.
#Mercurial Ignore Rules for Android
#Save as .hgignore in the repository base directory and add it to source control.
syntax: glob
*.class
*.apk
*.dex
*.ap_
*.suo

syntax: regexp
^(.*[\\/])?gen[\\/].*
^(.*[\\/])?bin[\\/].*
^(.*[\\/])?obj[\\/].*
^(.*[\\/])?log[\\/].*
^(.*[\\/])?obf[\\/].*
^(.*[\\/])?jars[\\/].*
^(.*[\\/])?jar-sources[\\/].*
^(.*[\\/])?javadoc[\\/].*
^(.*[\\/])?\.svn[\\/].*
^(.*[\\/])?\.metadata[\\/].*
^(.*[\\/])?\.settings[\\/].*