ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 4143] New: - Cannot create instance of custom type
Date Sat, 13 Oct 2001 09:41:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4143>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4143

Cannot create instance of custom type

           Summary: Cannot create instance of custom type
           Product: Ant
           Version: 1.4
          Platform: Macintosh
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: jesse.glick@netbeans.com


I am using Ant 1.4. I have found that typedef is not as useful as it
sounds because you cannot (it appears) actually define a custom type
at top level, with an ID. (Doing so might allow you to use refid later
to use unmodified tasks with your subclassed type.) For example this
does not work:

<project default="all">
  <target name="all">
    <typedef name="myfileset" classname="..." classpath="..."/>
    <myfileset dir="." id="someid"/>
  </target>
</project>

Ant says that there is no such task <myfileset>. (The message is
misleading because a plain <fileset> works there too, so it should say
there is no such task or type.) But we just defined it. You also
cannot do this:

<project default="all">
  <typedef name="myfileset" classname="..." classpath="..."/>
  <myfileset dir="." id="someid"/>
  <target name="all">
    <!-- use someid somehow -->
  </target>
</project>

because <typedef> is not allowed at top level. (Why? <taskdef> is.)

Since it does not appear <typedef> will let you actually define a new
instance of the type, how is it supposed to be used? The manual says
that it is only really useful with custom tasks. But if you have a
custom task then presumably that task will understand subelements of
certain names to be of your custom type, without needing <typedef> at
all.

Mime
View raw message