How to set the classpath of an ant task to be the project's compile classpath?

I need to set the classpath of the ant xslt task to be the compile classpath of the project. What would be the best way to do it?

Best regards,

Martin

apply plugin: 'checkstyle'
  checkstyle {
 toolVersion='5.9'
 configFile=new File("config/checkstyle", "sun_checks.xml")
 ignoreFailures=true
 showViolations=false
}
  task checkstyleReport << {
 if (file("$buildDir/reports/checkstyle/${ext.checkType}.xml").exists()) {
  ant.xslt(in: "$buildDir/reports/checkstyle/${ext.checkType}.xml",
   style:"config/checkstyle/checkstyle-noframes.xsl",
   out:"$buildDir/reports/checkstyle/checkstyle_${ext.checkType}.html"
  )
 }
}
    afterEvaluate {
 plugins.withType(CheckstylePlugin) {
  checkstyleReport {
   sourceSets.each { sourceSet ->
     ext.checkType = sourceSet.name.toLowerCase()
    checkstyleReport.execute()
   }
  }
 }
}

It depends on what exactly the Ant xslt task expects, but the value might be something like ‘sourceSets.main.compileClasspath.asPath’. Also check out the Ant chapter in the Gradle User Guide.

Thanks for the reply, it pointed me in the right direction! In the end, I just had to disable the “RedundantThrows” module in the checkstyle config-file which was unneccessarily complaining about unknown exception classes.