Benjamin,
I’m trying to wrap my ant build.xml file which uses junit and i tried your solution and I get this error:
Could not resolve all dependencies for configuration ‘:junitAnt’. . . .
I believe this is because the taskdef is being called in the configuration phase (dependencies have not been resolved yet). Any ideas on how to fix this?