Date: 2004-10-14T07:55:42
   Editor: TomiSchuetz <[EMAIL PROTECTED]>
   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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to