You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by an...@apache.org on 2004/10/14 16:55:42 UTC
[Ant Wiki] Updated: AntTasks
Date: 2004-10-14T07:55:42
Editor: TomiSchuetz <to...@swisslife.ch>
Wiki: Ant Wiki
Page: AntTasks
URL: http://wiki.apache.org/ant/AntTasks
no comment
Change Log:
------------------------------------------------------------------------------
@@ -6,5 +6,45 @@
== The Sync Task (present since 1.6) ==
Here is an example of some lore of this type: The Sync task will delete 'dangling files' and 'dangling directories' in the target directory.
+
+== The Property Task ==
+
+[http://ant.apache.org/manual/CoreTasks/property.html]
+
+=== The Prefix Attribute ===
+
+The Problem:
+I have to access some properties (from a file), which are already defined in my build file. To be able to access the properties I can use the {{{prefix}}} attribute of the property task.
+
+__framework.properties__
+{{{
+#Release information about the framework
+#Thu Oct 14 16:25:12 CEST 2004
+build.number=115
+release.version=0.4
+release.name=framework
+}}}
+
+__Ant Example Target__
+{{{
+<target name="read.properties">
+ <!-- Read the properties from the release of the framework -->
+ <property file="framework.properties" prefix="framework"/>
+ <echo message="${framework.build.number}"/>
+ <echo message="${framework.release.version}"/>
+ <echo message="${framework.release.name}"/>
+</target>
+}}}
+
+__Output__
+{{{
+Buildfile: C:\build.xml
+read.properties:
+ [echo] 115
+ [echo] 0.4
+ [echo] framework
+BUILD SUCCESSFUL
+Total time: 3 seconds
+}}}
----
CategoryCategory
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org