Loading...

user@ant.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Create custom datatype programmatically Stefan Bodewig Sat Feb 04 22:00:11 2012

On 2012-02-04, Mansour Al Akeel wrote:

> 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.

More specifically, if the type lives in a Namespace it has to be
"namespace-URI:type-name".

> 1- This can not be used if the new type is defined in a custom antlib.xml,
> because it is not recognized.

Do you use a custom namespace (likely when using an Antlib).

> for example getProject.createDataType("jar") would create an instance of
> the Jar Task.

Probably you need something like
getProject.createDataType("antlib:org.example.antlib:jar")

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]