adding jslint support

git-svn-id: http://google-refine.googlecode.com/svn/trunk@413 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-04-07 19:05:04 +00:00
parent 7690f932b7
commit 4171db6540
2 changed files with 37 additions and 0 deletions

View File

@ -293,6 +293,23 @@
</cpd>
</target>
<target name="jslint" depends="prepare_reports">
<path id="jslint.path">
<fileset dir="${jslint.dir}" includes="*.jar"/>
</path>
<taskdef
name="jslint"
classname="com.googlecode.jslint4java.ant.JSLintTask"
classpathref="jslint.path"
/>
<jslint>
<formatter type="plain" destfile="${reports.dir}/jslint.txt" />
<fileset dir="${basedir}/src/main/webapp/scripts">
<include name="**/*.js" />
</fileset>
</jslint>
</target>
<target name="clean">
<delete file="${build.dir}/gridworks.jar" />
<delete dir="${server_classes.dir}" />

View File

@ -62,6 +62,7 @@ and <action> is one of
findbugs .................. Run Findbugs against Gridworks
pmd ....................... Run PMD against Gridworks
cpd ....................... Run Copy/Paste Detection against Gridworks
jslint .................... Run JSlint against Gridworks
mac_dist <version> ........ Make MacOSX binary distribution
windows_dist <version> .... Make Windows binary distribution
@ -307,6 +308,17 @@ pmd_prepare() {
tool_download $PMD_URL $PMD_FILE $PMD_DIR
}
jslint_prepare() {
tools_prepare
JSLINT_URL="http://jslint4java.googlecode.com/files/jslint4java-1.3.3-dist.zip"
JSLINT_FILE="jslint4java-1.3.3-dist.zip"
JSLINT_DIR="jslint4java-1.3.3"
tool_download $JSLINT_URL $JSLINT_FILE $JSLINT_DIR
}
# ----------------------------------------------------------------------------------------------
@ -566,6 +578,13 @@ cpd() {
ant cpd
}
jslint() {
jslint_prepare
ANT_PARAMS="-Djslint.dir=${GRIDWORKS_TOOLS_DIR}/${JSLINT_DIR}"
ant jslint
}
# -------------------------- script -----------------------------
# ----- Normalize the current directory -------------------------
@ -688,6 +707,7 @@ case "$ACTION" in
findbugs) findbugs;;
pmd) pmd;;
cpd) cpd;;
jslint) jslint;;
run) run;;
execute) execute $*;;
mac_dist) mac_dist $1;;