Hi Russel,
my requirement was to invoke Groovy script from the Gradle build file. In addition this Groovy script was compiled by Gradle using compile task with customized dependencies. My solution is the following:

...
dependencies {
    addMavenRepo()
    groovy('org.codehaus.groovy:groovy-all:1.5.7')

    addFlatDirResolver('lib', new File("$rootDir/lib"))
    compile(':logback-classic:0.9.9', ':logback-core:0.9.9', ':slf4j-api:1.5.3', 'org.apache.ant:ant:1.7.0', 'org.apache.ant:ant-launcher:1.7.0')
}
...
createTask('foo', dependsOn: 'compile') {
    ant.java(classname: 'foo.Foo', failonerror: true, classpath: ".:$rootDir/build/classes:" + project.dependencies.antpath('compile'))
}
...


I am a Gradle newbie so it is possible that better solution exists. :-)

Ales



Russel Winder  wrote / napísal(a):
I have been looking in the documentation but not finding it -- and yes I
am trying to avoid reading the source code :-)

In order to create a JavaDoc and GroovyDoc job in a Gradle file the
classpath of the dependencies needs to be added to the classpath.  The
dependencies are given such as:

dependencies {
  addMavenRepo ( )
  groovy ( 'org.codehaus.groovy:groovy-all:' + groovyVersion )
  compile ( [
             'commons-cli:commons-cli:' + ant.antProject.properties.commonsCliVersion ,
             'org.apache.ant:ant:' + ant.antProject.properties.antVersion
             ] )
  testCompile ( [
                 'junit:junit:' + ant.antProject.properties.junitVersion
                 ] )
  testRuntime ( [
                 'org.apache.ivy:ivy:' + ant.antProject.properties.ivyVersion
                 ] )
}
So the question is what are the refids that can then be used in a
classpath specification?

Thanks.

  
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to