Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why do my custom task containers see Unknown Elements in Ant 1.6 – they worked in Ant 1.5?

0
Posted

Why do my custom task containers see Unknown Elements in Ant 1.6 – they worked in Ant 1.5?

0

The objects added in TaskContainer.addTask(Task task) have changed from Tasks to UnknownElements. There was a number of valid reasons for this change. But the backward compatibility problems were not noticed until after Ant 1.6.0 was released. Your container class will need to be modified to check if the Task is an UnknownElement and call perform on it to convert it to a Task and to execute it. (see apache.tools.ant.taskdefs.Sequential) If you want to do more processing on the task, you need to use the techniques in apache.tools.ant.taskdefs.Antlib#execute() This does make use of one 1.6 method call (UE#getRealObject()), you need to use UE#getTask() instead – this will return null for non tasks (types like fileset id=x). So..

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.