ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mansour Al Akeel <mansour.alak...@gmail.com>
Subject Create custom datatype programmatically
Date Sat, 04 Feb 2012 07:08:05 GMT
In the class org.apache.tools.ant.Project, theres a method called
createDataType(String str).
The string argument, is the name of the type to be created.

1- This can not be used if the new type is defined in a custom antlib.xml,
because it is not recognized.
for example getProject.createDataType("jar") would create an instance of
the Jar Task. Which not what I need.
And if I don getProject.createDataType("myCustomType"),  where myCustomType
is defined in an antlib.xml, it will return null.

2- If the type name in antlib.xml is changed then this has to be renamed.

I am not sure if it's better to use full class name as the name of the
type, but this will not make it possible to create types defined, in
antlib.xml
Any advice about how to create an instance of myCustomType grammatically ?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message