I’m trying to use the Gradle JS Plugin https://github.com/eriwen/gradle-js-plugin to run jshint against my Javascript codebase. However, the task refuses to actually run, saying it has no source files. Here’s an excerpt from my build.gradle:
javascript.source {
dev {
js {
srcDir webAppDirName + "/js/"
include "**/*.js"
}
}
}
println ("*****
" + javascript.source.dev.js.files)
jshint {
source = javascript.source.dev.js.files
jshint.predef = ['$': false, 'd3': false]
dest = project.file("${buildDir}/foobar.txt")
ignoreExitCode = false
}
When I run ‘gradle jshint --info’ I get the following relevant output:
Selected primary task 'jshint'
Tasks to be executed: [task ':widgets:jshint']
:widgets:jshint
Skipping task ':widgets:jshint' as it has no source files.
:widgets:jshint UP-TO-DATE
The println indicates that javascript.source.dev.js.file contains a list of the expected .js files. What do I need to do to make this task run jshint for me? Thanks.
Note that the build.gradle where this code is located is for a subproject ‘widgets’ that builds a .war for my application. I’m using the 1.5.1 version of the plugin.