Mercurial ignore-file for Eclipse and Android development

后端 未结 5 2024
傲寒
傲寒 2021-01-31 19:21

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

相关标签:
5条回答
  • 2021-01-31 19:41

    I have found a good example of .hgignore. It works for me.

    #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[\\/].*
    

    Source: http://androidfragments.blogspot.ru/2011/11/hgignore-for-android.html

    0 讨论(0)
  • 2021-01-31 19:53

    There's a very nice sample .hgignore for Android at http://androidfragments.blogspot.com/2011/11/hgignore-for-android.html

    0 讨论(0)
  • 2021-01-31 19:57

    The eclipse files should definitely be added. The general guideline is to add:

    • everything that is hand written/typed
    • the minimal subset of everything else necessary to build the project

    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)

    0 讨论(0)
  • 2021-01-31 19:59

    Here is my hgignore:

    syntax: regexp
    \.DS_Store
    .swo
    .swp
    .metadata/
    /bin/
    

    Whether it's a good one or not is a separate issue

    0 讨论(0)
  • 2021-01-31 20:03

    well if its android projects than

    local.properties should also be ignored

    0 讨论(0)
提交回复
热议问题