在Install4j中-如何从外部文件读取版本? [英] In Install4j - How can I read the version from an external file?
问题描述
我从gradle插件运行install4j,但使用用户界面编辑install4j文件.但是我发现每次创建新版本时总是必须手动更新General Settings -> Application Info -> Version
很烦人.该文件已经存储在我们源代码中的文件中,因此我只想读取该文件,以避免额外的输入.
I run install4j from the gradle plugin but use the user interface to edit the install4j file. But I find it annoying to always have to manually update my General Settings -> Application Info -> Version
every time I make a new version. This is stored in a file in our source code already so I want to just read that file to avoid the extra input.
如何读取此文件,获取版本信息,然后在General Settings -> Appplication Info -> Version
中使用它?
How can I read this file, get the version info, then use that in General Settings -> Appplication Info -> Version
?
先谢谢了.
推荐答案
我建议从构建过程中调用install4j,install4j支持ant,gradle和maven,也可以使用命令行可执行文件调用.
I would suggest invoking install4j from your build process, install4j supports ant, gradle and maven and can also be invoked with a command line executable.
在这种情况下,您可以设置版本
In that case, you can set the version
- with the
release
attribute of the ant task - with the
release
attribute of the gradle task - by overriding the
release
property of the maven plugin, the maven plugin automatically uses the version in the POM. - by passing the
--release
argument to the command line compiler
对于要在构建过程中自定义的其他内容,可以使用编译器变量.
For other things that you want to customize from the build process, you can use compiler variables.
这篇关于在Install4j中-如何从外部文件读取版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!