Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between @ and $ when accessing Ant properties?

Tags:

ant

What's the difference between @{property} and ${property} in accessing Ant properties?

Didn't see any obvious note about it in the Ant manual.

like image 408
imeikas Avatar asked May 14 '09 09:05

imeikas


People also ask

What are Ant properties?

Properties are key-value pairs where each value is associated to a key. The property is used to set value which can be accessed anywhere in the buildfile. Once a property is set, it cannot be changed. Apache Ant provides <property> tag which can be used to set property.

What Ant properties file?

Ant properties files let you move properties out of your build. xml file. You create . properties file for all the properties that are defined outside the build file.

Where are Ant properties set?

The home directory for Ant library files - typically ANT_HOME/lib folder. Ant also makes the system properties (Example: file. separator) available to the build file. In addition to the above, the user can define additional properties using the property element.


2 Answers

${property} is the normal way to access properties. @{property} is used inside macro definitions to access arguments passed to this macro. See the Ant manual on macrodef.

like image 100
rudolfson Avatar answered Oct 12 '22 11:10

rudolfson


${property} is used to reference Properties.

@{attribute} is used to reference Attributes in <macrodef> Tasks.

like image 27
Dave Webb Avatar answered Oct 12 '22 11:10

Dave Webb