我在 NetBeans 中有一个 java 项目,我使用 Mercurial 进行版本控制。
我想在 about 框中查看我的项目版本号,我希望它根据 Mercurial 修订号进行更新。
任何想法如何做到这一点? :)
最佳答案
关注' Version numbering for auto builds with Mercurial ',您可以在 VERSION.TXT 文件中记录以下结果(您关于对话框将显示):
hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'
Lazy Badger comments :
log will be a lot better (and correct) with:
hg log -r tip --template "{latesttag}.{latesttagdistance}"
您在“How good is my method of embedding version numbers into my application using Mercurial hooks? ”中有更多选择
version_gen.sh
和: hg parent --template "r{node|short}_{date|shortdate}" > version.num
In the makefile, make sure
version_gen.sh
is run beforeversion.num
is used to set the version parameter.
关于netbeans - 如何从 Mercurial 存储库获取修订号并将其粘贴到 NetBeans 资源包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13232469/