The preset definition generates a new definition based on a current definition with some attributes or elements preset.
since Ant 1.6
Attribute | Description | Required |
name | the name of the new definition | Yes |
uri | The uri that this definition should live in. | No |
The <presetdef> task takes one nested element as a parameter. 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 attributes set. It also has a src element to source files from a generated directory.
<presetdef name="my.javac"> <javac debug="${debug}" deprecation="${deprecation}"> <src path="${gen.dir}"/> </javac> </presetdef>
This can be used as a normal javac task - example:
<my.javac src="${src.dir}" destdir="${classes.dir}"/>
Copyright © 2003 Apache Software Foundation. All rights Reserved.