标签云

微信群

扫码加入我们

WeChat QR Code

We have an Apache ANT script to build our application, then check in the resulting JAR file into version control (VSS in this case). However, now we have a change that requires us to build 2 JAR files for this project, then check both into VSS.

The current target that checks the original JAR file into VSS discovers the name of the JAR file through some property. Is there an easy way to "generalize" this target so that I can reuse it to check in a JAR file with any name? In a normal language this would obviously call for a function parameter but, to my knowledge, there really isn't an equivalent concept in ANT.


It seems, you have forgotten to close <attribute> tag. It should be like <attribute name="file" />

2018年08月15日50分48秒

Awesome suggestion. Thanks.

2018年08月15日50分48秒

It's probably a better idea to use macros rather than antcall (see the other answers). With antcall you break ant's dependency mechanism and are apt to end up with some rather confusing build logs.

2018年08月14日50分48秒