Re: Moving to Ant 1.6.1 => UnknownElements galor!
Wascally Wabbit wrote: At 07:11 AM 2/19/2004, you wrote: On Wed, 18 Feb 2004, Peter Reilly <[EMAIL PROTECTED]> wrote: > Your container class will need 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) Hmm, the FAQ entry doesn't say whether I can or can not convert the UnknownElement to a Task right inside the addTask method (i.e. use maybeConfigure) or only once execute has been invoked. I'm not sure myself 8-) Stefan FYI, I have tried replacing the task inside the addTask and it seems to work thus far (I store the "real" task not the UnknownElement). Yes, this should work. I will update the FAQ with this information. (Hopefully, this time with nearly correct spellings). Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Moving to Ant 1.6.1 => UnknownElements galor!
At 07:11 AM 2/19/2004, you wrote: On Wed, 18 Feb 2004, Peter Reilly <[EMAIL PROTECTED]> wrote: > Your container class will need 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) Hmm, the FAQ entry doesn't say whether I can or can not convert the UnknownElement to a Task right inside the addTask method (i.e. use maybeConfigure) or only once execute has been invoked. I'm not sure myself 8-) Stefan FYI, I have tried replacing the task inside the addTask and it seems to work thus far (I store the "real" task not the UnknownElement). The Wabbit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Moving to Ant 1.6.1 => UnknownElements galor!
On Wed, 18 Feb 2004, Peter Reilly <[EMAIL PROTECTED]> wrote: > Your container class will need 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) Hmm, the FAQ entry doesn't say whether I can or can not convert the UnknownElement to a Task right inside the addTask method (i.e. use maybeConfigure) or only once execute has been invoked. I'm not sure myself 8-) Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Thanks! Was: Moving to Ant 1.6.1 => UnknownElements galor!
Thanks everyone; you've saved me much time. The Wabbit At 06:52 AM 2/18/2004, you wrote: On Wed, 18 Feb 2004, Peter Reilly <[EMAIL PROTECTED]> wrote: > Your container class will need 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) Peter, could you write something up for the FAQ? I've seen similar comments on the Webtest[1] list where people can't run Webtest against Ant 1.6.x - so the change obviously affects custom TaskContainers very badly. We should make it known, at least. Stefan Footnotes: [1] http://webtest.canoo.com/webtest/manual/WebTestHome.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Moving to Ant 1.6.1 => UnknownElements galor!
Stefan Bodewig wrote: On Wed, 18 Feb 2004, Peter Reilly <[EMAIL PROTECTED]> wrote: Your container class will need 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) Peter, could you write something up for the FAQ? I will have a go. I've seen similar comments on the Webtest[1] list where people can't run Webtest against Ant 1.6.x - so the change obviously affects custom TaskContainers very badly. We should make it known, at least. It should also be in the WHATNEWS file. Peter Stefan Footnotes: [1] http://webtest.canoo.com/webtest/manual/WebTestHome.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Moving to Ant 1.6.1 => UnknownElements galor!
On Wed, 18 Feb 2004, Peter Reilly <[EMAIL PROTECTED]> wrote: > Your container class will need 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) Peter, could you write something up for the FAQ? I've seen similar comments on the Webtest[1] list where people can't run Webtest against Ant 1.6.x - so the change obviously affects custom TaskContainers very badly. We should make it known, at least. Stefan Footnotes: [1] http://webtest.canoo.com/webtest/manual/WebTestHome.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Moving to Ant 1.6.1 => UnknownElements galor!
The objects added in TaskContainer.addTask(Task task) have changed from Tasks to UnknownElements. There was a number of valid reasons for this change. Your container class will need 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() instread - this will return null for non tasks (types like fileset id=x). So.. interate over the tasks, if they are UEs, convert them to tasks, using UE#maybeConfigure and UE#getTask() This approach should work for ant1.5 and ant1.6. Peter Wascally Wabbit wrote: Ant Developers, I just did a quick Ant 1.5.4 -> 1.6.1 library switch. Ran our own Ant task test suites and got lots of fireworks mostly caused by the "mysterious" mapping of many of our task objects to the "UnknownElement". Needless to say our task containers do not recognize unknown elements and promptly die. Upgrading is my job for tomorrow. Sooo I'm wondering if there's an easy explanation for this or...I'm looking at hours of crawling through the Ant 1.6.1 source x-| Any pointers would be greatly appreciated. I've not seen anything on the Ant 1.6 developers list about this (i don't think). Here's a typical stack trace (FYI). The task to be added is an unknownElement eventhough the XML seez it's one of my taskdefs. Thread [main] (Suspended (breakpoint at line 393 in SwitchTask)) SwitchTask.includeTask(Task) line: 393 <<-- incoming UnknownElement SwitchTask(TaskSet).addTask(Task) line: 183 SwitchTask.addTask(Task) line: 423 UnknownElement.handleChildren(Object, RuntimeConfigurable) line: 329 UnknownElement.configure(Object) line: 176 UnknownElement.maybeConfigure() line: 152 UnknownElement(Task).perform() line: 363 Target.execute() line: 301 Target.performTasks() line: 328 Project.executeTarget(String) line: 1215 SwitchTaskTest(BuildFileTest).executeTarget(String) line: 232 SwitchTaskTest(HTC).runTarget(String) line: 956 SwitchTaskTest.testDefaultAlwaysMatches() line: 153 Method.invoke(Object, Object[]) line: not available [native method] SwitchTaskTest(TestCase).runTest() line: 154 SwitchTaskTest(HTC).runBare() line: 398 TestResult$1.protect() line: 106 TestResult.runProtected(Test, Protectable) line: 124 TestResult.run(TestCase) line: 109 SwitchTaskTest(TestCase).run(TestResult) line: 118 RemoteTestRunner.runTests(String[], String) line: 392 RemoteTestRunner.run() line: 276 RemoteTestRunner.main(String[]) line: 167 The Wabbit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Moving to Ant 1.6.1 => UnknownElements galor!
Ant Developers, I just did a quick Ant 1.5.4 -> 1.6.1 library switch. Ran our own Ant task test suites and got lots of fireworks mostly caused by the "mysterious" mapping of many of our task objects to the "UnknownElement". Needless to say our task containers do not recognize unknown elements and promptly die. Upgrading is my job for tomorrow. Sooo I'm wondering if there's an easy explanation for this or...I'm looking at hours of crawling through the Ant 1.6.1 source x-| Any pointers would be greatly appreciated. I've not seen anything on the Ant 1.6 developers list about this (i don't think). Here's a typical stack trace (FYI). The task to be added is an unknownElement eventhough the XML seez it's one of my taskdefs. Thread [main] (Suspended (breakpoint at line 393 in SwitchTask)) SwitchTask.includeTask(Task) line: 393 <<-- incoming UnknownElement SwitchTask(TaskSet).addTask(Task) line: 183 SwitchTask.addTask(Task) line: 423 UnknownElement.handleChildren(Object, RuntimeConfigurable) line: 329 UnknownElement.configure(Object) line: 176 UnknownElement.maybeConfigure() line: 152 UnknownElement(Task).perform() line: 363 Target.execute() line: 301 Target.performTasks() line: 328 Project.executeTarget(String) line: 1215 SwitchTaskTest(BuildFileTest).executeTarget(String) line: 232 SwitchTaskTest(HTC).runTarget(String) line: 956 SwitchTaskTest.testDefaultAlwaysMatches() line: 153 Method.invoke(Object, Object[]) line: not available [native method] SwitchTaskTest(TestCase).runTest() line: 154 SwitchTaskTest(HTC).runBare() line: 398 TestResult$1.protect() line: 106 TestResult.runProtected(Test, Protectable) line: 124 TestResult.run(TestCase) line: 109 SwitchTaskTest(TestCase).run(TestResult) line: 118 RemoteTestRunner.runTests(String[], String) line: 392 RemoteTestRunner.run() line: 276 RemoteTestRunner.main(String[]) line: 167 The Wabbit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]