Hi all,

I've been using Gradle (0.8) for a little while now, and I'm overall
very pleased. So, thanks for that.

However, I do run into an issue with calling Ant tasks. I have an Ant
build script with a target that runs fine. I then create a Gradle build
script that imports the Ant script. When I run that Gradle script, I get
the following error:
        Execution failed for task ':createDb'.
        Cause: java.lang.NoSuchMethodError:
com.google.common.collect.LinkedHashMultimap.create()Lcom/google/common/
collect/LinkedHashMultimap;

The Ant task I'm calling internally calls google-collect.jar. I've
looked at this jar, and the method is certainly there. The Ant script
also makes sure this jar is on the classpath for the task, and like I
said, the Ant script runs fine. Any ideas?


I also tried this with 0.9-rc-1, and there it works using
ant.importBuild. However, when I define the target in my Gradle build
script, it doesn't.
Here's the Ant snippet:
        <federation id="testFederation" bootstrap="${bootstrapPath}"
password="${superUserPassword}"/>
        <createdatabase name="${database.name}"
dbapassword="${adminPassword}" databaseref="testFederation"/>
Note that the federation task is supposed to store the federation in the
project reference named "testFederation", and the createDatabase task
uses that through the "databaseref" attribute.
Here's my translation to Gradle:
        ant {
          federation(id: 'testFederation', bootstrap: bootstrapPath,
password: superUserPassword)
          createdatabase(name: databaseName, dbapassword: adminPassword,
databaseref: 'testFederation')
        }
However, this gives the following error:
        Execution failed for task ':createDb'.
        Cause: java.lang.ClassCastException:
com.xhive.anttasks.types.Federation cannot be cast to
com.xhive.anttasks.types.Database


The Ant tasks also allow a different way of specifying the federation:
        <createdatabase name="${database.name}"
dbapassword="${adminPassword}">
           <federation refid="testFederation"/>
        </createdatabase>
Which I translate to gradle as:
        createdatabase(name: databaseName, dbapassword: adminPassword) {
          federation(refid: 'testFederation')
        }
And this gives:
        Execution failed for task ':createDb'.
        Cause: java.lang.ClassCastException:
com.xhive.anttasks.types.Federation cannot be cast to
com.xhive.anttasks.types.Federation
Which to me looks like a class loader issue???


Can anybody shed some light on this? I was really hoping to be able to
forgo writing Ant scripts, but it seems I'm stuck with Gradle.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to