I have a task that prints out the classpath for my project. I tried using to print out the values of some properties, but I am not having any success with that part.
task printClassPath() {
println( "-- Groovy version: " + groovy.lang.GroovySystem.getVersion() )
dependsOn classes
description = 'this prints out the class path'
println("Printed the path")
runtimeClasspath.getAsPath().tokenize(":").each { theFile ->
println theFile
}
println "\n"
// println "destinationDir: " + destinationDir
// println "output.classesDir: " + output.classesDir.getPath()
println "reportsDirName: " + reportsDirName
}
If I am reading http://www.gradle.org/docs/current/userguide/java_plugin.html, runtimeClasspath, destinationDir, output.classesDir and reportsDirName are properties defined by the Java plugin. But I can only access runtimeClasspath and reportsDirName. When I try to access the other two, I get: > Could not find property ‘destinationDir’ on task ‘:printClassPath’.