Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
using <presetdef > for defining data type?

using <presetdef > for defining data type?

2004-01-12       - By koji_sekiguchi@(protected)

Hello,

Can I use <presetdef> task to pre-set data type like <fileset>?
It seems that it can be used for defining "my <fileset>", but
it cannot be used for using "my <fileset>". What I tried to do
is:

<?xml version="1.0"?>
<project>
   <presetdef name="java.fileset">
       <fileset>
     <include name="**/*.java"/>
     <include name="**/*.class"/>
     <include name="**/*.jar"/>
  </fileset>
   </presetdef>

   <property name="java.dir" value="c:/somewhere"/>

   <target name="copy">
       <copy todir="to">
     <java.fileset dir="${java.dir}"/>
       </copy>
   </target>

</project>

With above build.xml, I run ant with -debug option:

C:\> ant -debug
  :
+Datatype java.fileset org.apache.tools.ant.types.FileSet
  :
BUILD SUCCESSFUL
Total time: 0 seconds

"java.fileset" seems to be defined correctly. But I run ant with
"copy" target option to actually use the new data type, I got
the following error:

C:\> ant copy
  :
BUILD FAILED
C:\build.xml:14: The <copy> type doesn't support the nested "java.fileset"
element.

Thank you,

Koji

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.