On 10/08/10 7:48 PM, [email protected] wrote:

Hi

Anybody tried defining custom ant task in gradle for compiling jasper template into .jasper file. I tried the following but has not been successful.

repositories {
        mavenCentral()
}

configurations {
        jasperreports
}

dependencies {
         jasperreports 'net.sf.jasperreports:jasperreports:3.7.0',
                'commons-digester:commons-digester:2.0',
                'org.codehaus.groovy:groovy-all:1.7.4'
}

ant.taskdef(name:'jrc', classname:'net.sf.jasperreports.ant.JRAntCompileTask',
        classpath:project.configurations.jasperreports.asPath
)

task compileJasper << {
        ant.mkdir(dir:'jrxml')
        ant.mkdir(dir:'jasper')
        ant.copy(todir:'jrxml') {
                ant.fileset(dir:'resources/templates') {
                        include(name:'**/*.jrxml')
                }
        }
ant.jrc(srcdir:'jrxml', destdir:'jasper', compiler:'net.sf.jasperreports.compilers.JRGroovyCompiler')
}

Been getting thrown exception from gradle on not able to resolve jasperreport classes. But when I copied the dependencies into {GRADLE_HOME}\lib folder, the task execute properly. Any ideas anybody?

Can you run Gradle with -s, and send in the stack trace for the exception?


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Reply via email to