forked from techdivision/TechDivision.ModuleBase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
67 lines (59 loc) · 2.43 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0"?>
<project name="TechDivision.ModuleBase" default="run-all-tests">
<property environment="env" />
<property name="basedir" value="." />
<property name="php-src.dir" value="${basedir}/Classes"/>
<property name="php-target.dir" value="${basedir}/target"/>
<property name="codepool" value="vendor"/>
<property name="vendor.dir" value="${basedir}/${codepool}" />
<property name="phpmd.file" value="${basedir}/phpmd.xml" />
<target name="phplint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${php-src.dir}">
<include name="**/*.php" />
<exclude name="vendor/**" />
</fileset>
</apply>
</target>
<target name="prepare">
<mkdir dir="${php-target.dir}/reports" />
</target>
<target name="phpcs">
<exec executable="${vendor.dir}/bin/phpcs" dir="${basedir}" passthru="true" checkreturn="true">
<arg line="-n --extensions=php --standard=phpcs.xml ${php-src.dir}"/>
</exec>
</target>
<target name="phpcpd">
<exec executable="${vendor.dir}/bin/phpcpd" dir="${basedir}" passthru="true" checkreturn="true">
<arg line="--log-pmd ${php-target.dir}/reports/pmd-cpd.xml --exclude vendor ${php-src.dir}"/>
</exec>
</target>
<target name="phploc">
<exec executable="${vendor.dir}/bin/phploc" dir="${basedir}" passthru="true" checkreturn="true">
<arg line="--log-xml ${php-target.dir}/reports/phploc.xml ${php-src.dir}"/>
</exec>
</target>
<target name="phplint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${php-src.dir}">
<include name="**/*.php" />
<exclude name="vendor/**" />
</fileset>
</apply>
</target>
<target name="phpmd">
<exec executable="${vendor.dir}/bin/phpmd" dir="${basedir}" passthru="true">
<arg line="${php-src.dir} xml ${phpmd.file} --reportfile ${php-target.dir}/reports/pmd.xml" />
</exec>
</target>
<target name="run-all-tests" description="runs all tests">
<phingcall target="prepare" />
<phingcall target="phpcs" />
<phingcall target="phpcpd" />
<phingcall target="phplint" />
<phingcall target="phpmd" />
<phingcall target="phploc" />
</target>
</project>