forked from ocStore/ocStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
52 lines (45 loc) · 2.06 KB
/
build.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="OpenCart" default="build" basedir=".">
<property name="source" value="upload"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/tests/docs"/>
<delete dir="${basedir}/tests/logs"/>
<delete dir="${basedir}/tests/testresults"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/tests/docs"/>
<mkdir dir="${basedir}/tests/logs"/>
<mkdir dir="${basedir}/tests/testresults"/>
</target>
<target name="lint" description="Perform syntax check of source code files">
<apply executable="php" failonerror="true">
<arg value="-l"/>
<fileset dir="${basedir}/upload">
<include name="**/*.php"/>
<modified/>
</fileset>
</apply>
</target>
<target name="csslint" description="Run the CSSLint tool on CSS files">
<fileset dir="${basedir}/upload" id="cssfiles.raw">
<include name="**/*.css" />
</fileset>
<pathconvert pathsep=" " property="cssfiles.clean" refid="cssfiles.raw" />
<exec executable="csslint" output="${basedir}/tests/csslint.xml">
<arg line="--warnings=box-model,floats --errors=ids,important --format=lint-xml ${cssfiles.clean}" />
</exec>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<arg value="--log-csv"/>
<arg value="${basedir}/tests/logs/phploc.csv"/>
<arg path="${basedir}/upload"/>
</exec>
</target>
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
<exec executable="phpcs">
<arg line="--report=checkstyle --report-file=${basedir}/tests/checkstyle.xml --standard=tests/phpcs/OpenCart/ruleset.xml --extensions=php ${source}/"/>
</exec>
</target>
<target name="build" depends="prepare,phpcs,lint,phploc,csslint"/>
</project>