groovy

AntBuilder doesn't handle ConditionTask

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0-JSR-6
  • Component/s: None
  • Labels:
    None
  • Environment:
    All
  • Number of attachments :
    1

Description

I noticed that AntBuilder doesn't handle ConditionTask (FYI,
ConditionTask does not extend Task).

This breaks with a groovy script such as:
ant = new AntBuilder();

//ant.condition("property":"output"){contains([string:"hi",substring:"hi"])};
// Note that equals is a keyword in Java, so pass in Equals (uppercase)
ant.condition("property":"output"){Equals([arg1:"hi",arg2:"hi"])};
//ant.condition("property":"output"){os(["family":"unix"]);};
ant.echo("\${output}")

-------------------------
A patch (diff -u) is in the attachment

Activity

Hide
Russel Winder added a comment -

This problem persists in CVS 2006-03-16. However the presented patch is not a good solution to the problem. Henry has correctly ascertained that the issue must be to do with the fact that ConditionTask does not extend Task but the code for AntBuilder appears to already deal with this via the use of TaskAdapter.

Further testing in progress...

Show
Russel Winder added a comment - This problem persists in CVS 2006-03-16. However the presented patch is not a good solution to the problem. Henry has correctly ascertained that the issue must be to do with the fact that ConditionTask does not extend Task but the code for AntBuilder appears to already deal with this via the use of TaskAdapter. Further testing in progress...
Hide
Dierk Koenig added a comment -

should have been resolved with
http://jira.codehaus.org/browse/GROOVY-1335
thanks to Marc Guillemot.

please verfy and close the issue if the fix is ok.

Show
Dierk Koenig added a comment - should have been resolved with http://jira.codehaus.org/browse/GROOVY-1335 thanks to Marc Guillemot. please verfy and close the issue if the fix is ok.
Hide
Russel Winder added a comment -

Do we have a test for this in the set of tests? If so we can close this. If not, we can after we have a test!

Show
Russel Winder added a comment - Do we have a test for this in the set of tests? If so we can close this. If not, we can after we have a test!
Hide
Marc Guillemot added a comment -

src/test/groovy/util/AntTest.groovy contains a unit test using condition (with "contains" rather than with "equals") therefore I think that this bud can be closed.

Show
Marc Guillemot added a comment - src/test/groovy/util/AntTest.groovy contains a unit test using condition (with "contains" rather than with "equals") therefore I think that this bud can be closed.
Hide
Russel Winder added a comment -

No point in having a resolved issue open when everyone agrees it should be closed

Show
Russel Winder added a comment - No point in having a resolved issue open when everyone agrees it should be closed

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: