用于Eclipse和Android开发的Mercurial ignore-file [英] Mercurial ignore-file for Eclipse and Android development
问题描述
我已经看到Mercurial忽略了 Visual Studio 文件的示例,等等。
我刚刚开始玩Android开发,我也用这个时间来试用Mercurial。 所以我的问题是:有没有人有一个很好的例子,一个用于Eclipse和Android开发的 .hgignore
文件?
对于初学者,我有以下几点:
#使用glob语法
pre>
语法:glob
#忽略模式
.metadata\
bin \
gen \
是否还有其他应忽略的模式?例如,应该从版本控制中省略Eclipse文件
.classpath
和.project
- 下方修改 -
我还没有得到我希望的答案,所以我会放弃一个赏金,并尝试指定一个更清楚我正在寻找的东西。
经过一番尝试,我似乎发现上面列出的建议
.hgignore
似乎已经足够了。我唯一的添加,是一个.settings
(这是一个文件夹,出现后我运行Android工具 - >修复项目属性)。我还发现(如Ry4an所提到的),Eclipse文件.classpath
和.project
应该>不被排除。
我不确定这个小的忽略文件是否足够,当我的项目比基本的教程(如果它实际上是是好的,请解释为什么,你会得到信用)。所以总结一下我在找什么:
- 我想要一个具体的例子,一个
.hgignore
Eclipse下的Android项目文件 - 忽略文件应该是这样的,只要我在新的位置检出存储库的副本,它应该立即工作不需要混淆路径和引用,添加丢失的文件等)
- 请同时解释为什么你的包含文件看起来像这样(我想了解为什么某些文件/目录被排除在外(为什么有些应该被包括在内))
- 如果包括操作系统特定的排除,请同时声明(我正在Windows 7 btw上运行。 / li>
绝对应该添加eclipse文件。一般准则是添加:
- 手写/打字的所有内容
- 最小子集构建项目所需的其他一切
最后一个是您的判断来源,它清楚地排除了您构建的.jar文件你自己和你最后的.apk,但是它包括你使用的第三方.jar?有些人确实包括他们,但更好的是包括一个依赖管理器的配置文件,如ivy,让下一个构建器自动下载他们需要的需求。
之后在我选择的工具中自动创建一个项目,我只需要这样做一个命令:
hg status --unknown - 无状态>> .hgignore
它将所有未知文件的列表添加到.hgignore。然后我进去,删除我想要保存的东西(例如:.project)和将增加兄弟姐妹的通配符文件(例如:**。class)
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:
- I want a concrete example for a
.hgignore
file for an Android project under Eclipse - The ignore file should be so that whenever I check out a copy of the repository at a new location, it should work straight away (i.e. without having to mess with paths and references, add missing files etc.)
- Please also explain why your include file looks like it does (I want to understand why certain files/directories are excluded (and why some definitely should be included))
- If you include OS specific excludes, please also state so (I'm running on Windows 7 btw.)
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)
这篇关于用于Eclipse和Android开发的Mercurial ignore-file的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!