izpack and build.properties
Does anyone know how to pass build properties to izpack in ANT.
I hav开发者_运维百科e a working izpack install in ANT and it works fine but I have to remember to manually put in thing like version number etc.. which are in my build.properties file.
TIA
You can reference Ant properties using the @{}
syntax in IzPack install definitions:
<installation version="1.0">
<!-- Ant properties in this file can be referenced with @{},
otherwise use variables below in installer files with ${} -->
<info>
<appname>@{product.name}</appname>
<appversion>@{product.version}</appversion>
<uninstaller name="remove.task" path="${INSTALL_PATH}/Uninstall" write="yes"/>
</info>
...
Source
It seems that in order to propagate all project properties to the the izpack compiler you need to set the inheritAll attribute to "true".
<izpack input="install-definition.xml"
output="${output.dir}/${product.short.name}-${product.version}-install.jar"
installerType="standard"
inheritAll="true"
basedir="${temp.dir}" />
Then in your installation definition file reference the property using @{product.version}
However, I could not find it the documentation so it may inherit more than properties.
I found a way. I copy the install to my dist folder and replace at that point.
<copy file="install.xml" todir="${output.dir}" overwrite="true">
<filterset>
<filter token="release.version" value="${release.version}"/>
</filterset>
</copy>
later on:
<target name="installer" description="Build installer" depends="all">
<izpack input="${output.dir}/install.xml" output="c:/temp/test.jar" basedir="${release.dir}"/>
</target>
精彩评论