From 39478937931fc463f3abb270708167e794a59632 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 21 Feb 2002 06:25:16 +0000 Subject: [PATCH] little bit of extra detail on the example. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271461 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/using.html | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/manual/using.html b/docs/manual/using.html index 1ce50c997..0d25e6ce0 100644 --- a/docs/manual/using.html +++ b/docs/manual/using.html @@ -223,9 +223,11 @@ ant.java.version the JVM version Ant detected; currently it can hold

Example Buildfile

 <project name="MyProject" default="dist" basedir=".">
-
+    <description>
+        simple example build file
+    </description>
   <!-- set global properties for this build -->
-  <property name="src" value="."/>
+  <property name="src" value="src"/>
   <property name="build" value="build"/>
   <property name="dist"  value="dist"/>
 
@@ -236,12 +238,14 @@ ant.java.version    the JVM version Ant detected; currently it can hold
     <mkdir dir="${build}"/>
   </target>
 
-  <target name="compile" depends="init">
+  <target name="compile" depends="init"
+        description="compile the source " >
     <!-- Compile the java code from ${src} into ${build} -->
     <javac srcdir="${src}" destdir="${build}"/>
   </target>
 
-  <target name="dist" depends="compile">
+  <target name="dist" depends="compile"
+        description="generate the distribution" >
     <!-- Create the distribution directory -->
     <mkdir dir="${dist}/lib"/>
 
@@ -249,7 +253,8 @@ ant.java.version    the JVM version Ant detected; currently it can hold
     <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
   </target>
 
-  <target name="clean">
+  <target name="clean"
+        description="clean up" >
     <!-- Delete the ${build} and ${dist} directory trees -->
     <delete dir="${build}"/>
     <delete dir="${dist}"/>
@@ -257,6 +262,21 @@ ant.java.version    the JVM version Ant detected; currently it can hold
 </project>
 
+Notice that we are declaring properties outside any target. The +<property>,<path> and <taskdef> +tasks are special in that they can be declared outside any target. When you +do this they are evaluated before any targets are executed. No other tasks +can be declared outside targets. + +

+We have given some targets descriptions; this causes the projecthelp +invocation option to list them as public targets with the descriptions; the +other target is internal and not listed. +

+Finally, for this target to work the source in the src subdirectory +should be stored in a directory tree which matches the package names. Check the +<javac> task for details. +

Token Filters

A project can have a set of tokens that might be automatically expanded if found when a file is copied, when the filtering-copy behavior is selected in the