Ant properties are key, value pairs you can configure inside your Ant build script. Typically you use properties for values that you need to refer to multiple times in your Ant build script. For instance, the source directory of your Java code, or the build output directory.
Ant Properties are set once and then can never be overridden. That's why setting any property on the command line via a -Dproperty=value will always override anything you've set in the file; the property is set and then nothing can override it. This way: Anything set at the command line takes precedence over build.
ant. PropertyHelper$PropertyEvaluator is used to expand ${some-string} into an Object . This is the interface you'd implement if you want to provide your own storage independent of Ant's project instance—the interface represents the reading end. An example for this would be org.
I have a main build script that calls various targets. One of these targets needs to store a value and another target needs to display it. Obviously this is not working so I think it may be related to scope. I've tried var, property, and declaring the property outside of target1. Since var seems to be mutable, it looks like I need to use it instead, but each time my output is empty.
Main script
<antcall target="target1"/>
<antcall target="display"/>
In target1:
<var name="myVar" value="${anotherVar}"/>
In display:
<echo>${myVar}</echo>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With