问题
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.
How can I read this file, get the version info, then use that in General Settings -> Appplication Info -> Version
?
Thanks in advance.
回答1:
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.
来源:https://stackoverflow.com/questions/41356032/in-install4j-how-can-i-read-the-version-from-an-external-file