diff --git a/docs/manual/CoreTasks/presetdef.html b/docs/manual/CoreTasks/presetdef.html index 390c8a005..166d643af 100644 --- a/docs/manual/CoreTasks/presetdef.html +++ b/docs/manual/CoreTasks/presetdef.html @@ -3,10 +3,15 @@
@@ -43,35 +48,67 @@ This nested element can be any other type or task. The attributes and elements that need to be preset are placed here.
- +- The following fragment defines a javac task with the debug and deprecation + The following fragment defines a javac task with the debug, deprecation + srcdir and destdir attributes set. It also has a src element to source files from a generated directory. -
--+<presetdef name="my.javac"> - <javac debug="${debug}" deprecation="${deprecation}"> + <javac debug="${debug}" deprecation="${deprecation}" + srcdir="${src.dir}" destdir="${classes.dir}"> <src path="${gen.dir}"/> </javac> </presetdef> -+
This can be used as a normal javac task - example: -
-- --<my.javac src="${src.dir}" destdir="${classes.dir}"/> -++<my.javac/> +
Copyright © 2003 Apache Software -Foundation. All rights Reserved.
- - + The attributes specified in the preset task may be overridden - i.e. + they may be seen as optional attributes - example: +++ One may put a presetdef definition in an antlib. + For example suppose the jar file antgoodies.jar has + the antlib.xml as follows: ++<my.javac srcdir="${test.src}" deprecation="no"/> ++
++ One may then use this in a build file as follows: ++<antlib> + <taskdef resource="com/acme/antgoodies/tasks.properties"/> + <!-- Implement the common use of the javac command --> + <presetdef name="javac"> + <javac deprecation="${deprecation}" debug="${debug}" + srcdir="src" destdir="classes"/> + </presetdef> +</antlib> ++
+++<project default="example" xmlns:antgoodies="antlib:com.acme.antgoodies"> + <target name="example"> + <!-- Compile source --> + <antgoodies:javac srcdir="src/main"/> + <!-- Compile test code --> + <antgoodies:javac srcdir="src/test"/> + </target> +</project> ++
Copyright © 2003 Apache Software + Foundation. All rights Reserved.
+ +