In Install4j - How can I read the version from an external file?

北慕城南 提交于 2019-12-07 21:36:03

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!