forked from hpbuniat/javascript-github-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·67 lines (59 loc) · 2.21 KB
/
build.xml
File metadata and controls
executable file
·67 lines (59 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8"?>
<project name="js-project" default="build" basedir=".">
<property file="build.properties"/>
<target name="build" depends="clean,lint,parallelTasks"/>
<target name="clean">
<!-- Clean up -->
<delete dir="${basedir}/build"/>
<!-- Create build directories -->
<mkdir dir="${basedir}/build/logs"/>
</target>
<!-- Run lint for php-files -->
<target name="lint">
<apply executable="php" failonerror="true" logerror="on">
<arg line="-ln"/>
<fileset dir="${basedir}">
<include name="**/*.php"/>
</fileset>
</apply>
</target>
<!-- Run the pdepend, phpmd, phpcpd, phpcs, phpdoc and phploc tasks
in parallel using a maximum of 2 threads. -->
<target name="parallelTasks" depends="lint">
<parallel threadCount="2">
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="jslint"/>
</parallel>
</target>
<!-- Generate pmd-cpd.xml -->
<target name="phpcpd">
<exec executable="phpcpd">
<arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml --exclude ${basedir}/test --min-lines 3 --min-tokens 60 --suffixes php,phtml,tpl,js,css ${basedir}" />
</exec>
</target>
<!-- Generate checkstyle.xml -->
<target name="phpcs">
<exec executable="phpcs" output="${basedir}/build/logs/checkstyle.xml" error="/tmp/checkstyle.error.log">
<arg line="--report=checkstyle --extensions=php --standard=Squiz ${basedir}"/>
</exec>
</target>
<!-- Generate jslint.xml -->
<target name="jslint" description="Run the JSLint and JSHint tools on JS files">
<fileset dir="${basedir}" id="jsfiles.raw">
<include name="**/*.js" />
<exclude name="**/*.min.js" />
<exclude name="**/test/*/*.js" />
<exclude name="**/min/*/*.js" />
<exclude name="**/build/*.js" />
<exclude name="**/release/*.js" />
</fileset>
<pathconvert pathsep=" " property="jsfiles.clean" refid="jsfiles.raw" />
<exec executable="java" output="build/logs/jslint.xml">
<arg line="-jar jslint4java-1.4.7.jar --report xml ${jsfiles.clean}" />
</exec>
<exec executable="jshint" output="build/logs/jslint-hint.xml">
<arg line="${jsfiles.clean} --jslint-reporter" />
</exec>
</target>
</project>