aboutsummaryrefslogtreecommitdiffstats
path: root/build.xml
diff options
context:
space:
mode:
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml55
1 files changed, 55 insertions, 0 deletions
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..b670974
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,55 @@
+<?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"/>
+ <exclude name="**/vendor/**" />
+ <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 value="--exclude"/>
+ <arg value="${basedir}/upload/system/storage/"/>
+ <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>