Can anybody tell me what I’m doing wrong here? Here’s my task:
task pmd << {
// TODO The up-to-date check isn't working.
inputs.files sourceSets.main.java
inputs.files sourceSets.test.java
outDir = file("$buildDirName/pmd")
outDir.mkdirs()
outputs.dir outDir
println("outdir: " + outDir)
gproj = project
ant {
taskdef(name: 'pmd', classname: 'net.sourceforge.pmd.ant.PMDTask',
classpath: configurations.pmdConf.asPath)
pmd(rulesetFiles: 'basic,design,unusedcode',
targetjdk: "$sourceCompatibility", shortfilenames: "true") {
formatter(type: 'xml', toFile: outDir.path + "/pmd.xml")
fileset(dir: projectDir.getPath()) {
sourceSets.main.java.each { file ->
include(name: gproj.relativePath(file))
}
sourceSets.test.java.each { file ->
include(name: gproj.relativePath(file))
}
}
}
}
}
When I run “gradle -i pmd”, it says this:
:bridge:pmd Task ‘:bridge:pmd’ has not declared any outputs, assuming that it is out-of-date. outdir: C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\bridge\build\pmd