我使用 Launch4j 并将${dist}
在其配置中使用一个属性。
当任务和它的参数直接在build.xml
文件中时,它可以工作:
<project ...>
<property name="dist" location="/temp/dist" />
<launch4j>
<config headerType="gui" outfile="${dist}/myprogram.exe"
dontWrapJar="false" jarPath="${dist}/myprogram.jar">
...
</config>
</launch4j>
</project>
然而,Launch4j 可以使用它自己的 xml 配置文件,<launch4jConfig>
作为根元素:
在 ant.xml 中:
<launch4j configFile="my_launch4j_config.xml" />
在 my_launch4j_config.xml 中:
<launch4jConfig>
<headerType>gui</headerType>
<outfile>${dist}/myprogram.exe</outfile>
<dontWrapJar>false</dontWrapJar>
<jar>${dist}/myprogram.jar</jar>
...
</launch4jConfig>
在这种情况下,${dist}
没有扩展,也没有%dist%
我尝试过的所有内容......是否存在使用 launch4j 配置文件中的属性的解决方案?