.build();
ant.withClasspath(combinedClasspath).execute(new Closure<Object>(this, this) {
@SuppressWarnings("UnusedDeclaration")
public Object doCall(Object it) {
final GroovyObjectSupport antBuilder = (GroovyObjectSupport) it;
antBuilder.invokeMethod("taskdef", ImmutableMap.of(
"name", "groovydoc",
"classname", "org.codehaus.groovy.ant.Groovydoc"
));
antBuilder.invokeMethod("groovydoc", new Object[]{args, new Closure<Object>(this, this) {
public Object doCall(Object ignore) {
for (Groovydoc.Link link : links) {
antBuilder.invokeMethod("link", new Object[]{
ImmutableMap.of(
"packages", Joiner.on(",").join(link.getPackages()),
"href", link.getUrl()
)
});