|
|
@@ -1,5 +1,5 @@ |
|
|
|
<!-- property task --> |
|
|
|
<external> |
|
|
|
<external xmlns:ant="http://ant.apache.org"> |
|
|
|
<description> |
|
|
|
|
|
|
|
<p>Sets a property (by name and value), or set of properties (from file or resource) in the project.</p> |
|
|
@@ -26,23 +26,23 @@ |
|
|
|
</description> |
|
|
|
|
|
|
|
<section anchor="examples" name="Examples"> |
|
|
|
<source><![CDATA[ |
|
|
|
<property name="foo.dist" value="dist"/> |
|
|
|
]]></source> |
|
|
|
<source> |
|
|
|
<ant:property name="foo.dist" value="dist"/> |
|
|
|
</source> |
|
|
|
<p>sets the property <code>foo.dist</code> to the value "dist".</p> |
|
|
|
<source><![CDATA[ |
|
|
|
<property file="foo.properties"/> |
|
|
|
]]></source> |
|
|
|
<source> |
|
|
|
<ant:property file="foo.properties"/> |
|
|
|
</source> |
|
|
|
<p>reads a set of properties from a file called "foo.properties".</p> |
|
|
|
<source><![CDATA[ |
|
|
|
<property resource="foo.properties"/> |
|
|
|
]]></source> |
|
|
|
<source> |
|
|
|
<ant:property resource="foo.properties"/> |
|
|
|
</source> |
|
|
|
<p>reads a set of properties from a resource called "foo.properties".</p> |
|
|
|
<p>Note that you can reference a global properties file for all of your Ant |
|
|
|
builds using the following:</p> |
|
|
|
<source><![CDATA[ |
|
|
|
<property file="${user.home}/.ant-global.properties"/> |
|
|
|
]]></source> |
|
|
|
<source> |
|
|
|
<ant:property file="${user.home}/.ant-global.properties"/> |
|
|
|
</source> |
|
|
|
<p>since the "user.home" property is defined by the Java virtual machine |
|
|
|
to be your home directory. Where the "user.home" property resolves to in |
|
|
|
the file system depends on the operating system version and the JVM implementation. |
|
|
@@ -51,11 +51,11 @@ variants, this will most likely resolve to the user's directory in the "Doc |
|
|
|
and Settings" folder. Older windows variants such as Windows 98/ME are less |
|
|
|
predictable, as are other operating system/JVM combinations.</p> |
|
|
|
|
|
|
|
<source><![CDATA[ |
|
|
|
<property environment="env"> |
|
|
|
<echo message="Number of Processors = ${env.NUMBER_OF_PROCESSORS}"> |
|
|
|
<echo message="ANT_HOME is set to = ${env.ANT_HOME}"> |
|
|
|
]]></source> |
|
|
|
<source> |
|
|
|
<ant:property environment="env"/> |
|
|
|
<ant:echo message="Number of Processors = ${env.NUMBER_OF_PROCESSORS}"/> |
|
|
|
<ant:echo message="ANT_HOME is set to = ${env.ANT_HOME}"/> |
|
|
|
</source> |
|
|
|
<p>reads the system environment variables and stores them in properties, prefixed with "env". |
|
|
|
Note that this only works on <em>select</em> operating systems. |
|
|
|
Two of the values are shown being echoed. |
|
|
|