Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Gradle custom Plugin that allows running JSLint static analysis against JavaScipt code. A blog article accompanies this source code to explain its intent and implementation.
Groovy Shell JavaScript
Branch: master
Failed to load latest commit information.
config/codenarc
gradle/wrapper defer to local dependencies for testing at the integration level with…
lib
releases
src update and release version 0.2
.gitignore
LICENSE-2.0.txt
README.markdown
build.gradle defer to local dependencies for testing at the integration level with…
gradlew defer to local dependencies for testing at the integration level with…
gradlew.bat defer to local dependencies for testing at the integration level with…
settings.gradle update and release version 0.2

README.markdown

Gradle JSLint Plugin

This is a simple Plugin for Gradle which wraps an existing Ant JSLint task and makes available it's static analysis capabilities for your Gradle builds.

More information about JSLint can be found at: http://www.jslint.com/lint.html

More about the jslint4java ant task can be found at: http://jslint4java.googlecode.com/svn/docs/1.4/ant.html

The Gradle jslint Task can be configured with the following parameters(types and defaults are shown):

    List<String> inputDirs = ['.']    
    String includes = '**/*.js'
    String excludes = ''
    String formatterType = 'plain'
    String destFilename = 'jslint'
    boolean haltOnFailure = true
    String options = ''    

The formatterTypes available are: plain, xml, html

Here's an example which uses most of the options:


 jslint {
     inputDirs = ['webapp/js']
     haltOnFailure = false
     excludes = '**/metadata/'
     options = 'rhino'
     formatterType = 'html'
 } 

You can use a Github repository to provide version 0.2 of this plugin for your build. Here's a sample configuration that works with Gradle 1.2

    apply plugin: 'java'
    group = 'temp'

    buildscript {
        repositories{
            maven{
                url = 'http://kellyrob99.github.com/Jenkins-api-tour/repository'
            }
        }
        dependencies {
            classpath 'org.kar:gradle-jslint-plugin:0.2'
        }
    }

    repositories{
        mavenCentral() //needed by the plugin to retrieve the jslint jar
    }

    apply plugin: 'jslint'

This plugin is made available under the Apache 2.0 license, I hope you find value and have fun with it! http://www.apache.org/licenses/LICENSE-2.0

Something went wrong with that request. Please try again.