-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
113 lines (100 loc) · 4.26 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?xml version="1.0" encoding="UTF-8"?>
<project name="TemplatingServiceProvider" default="build" basedir=".">
<property name="project.bindir" value="${project.basedir}/vendor/bin" />
<property name="project.builddir" value="${project.basedir}/build" />
<target name="build">
<phingcall target="lint" />
<phingcall target="tests" />
<phingcall target="style" />
</target>
<target name="style">
<exec executable="${project.bindir}/phpcs" passthru="true" checkreturn="true" >
<arg value="--standard=PSR2" />
<arg value="${project.basedir}/src" />
<arg value="${project.basedir}/tests" />
</exec>
</target>
<target name="tests">
<exec command="${project.bindir}/phpunit --testsuite unit" passthru="true" checkreturn="true" />
</target>
<target name="lint">
<phplint haltonfailure="true">
<fileset dir="${project.basedir}/src">
<include name="**/*.php" />
</fileset>
<fileset dir="${project.basedir}/tests">
<include name="**/*.php" />
</fileset>
</phplint>
</target>
<target name="qa" depends="prepare-ci">
<phingcall target="tests-ci" />
<phingcall target="loc-ci" />
<phingcall target="dependencies-ci" />
<phingcall target="phpmd-ci" />
<phingcall target="style-ci" />
<phingcall target="duplications-ci" />
</target>
<target name="prepare-ci">
<delete dir="${project.builddir}/logs" />
<delete dir="${project.builddir}/coverage" />
<delete dir="${project.builddir}/images" />
<mkdir dir="${project.builddir}/logs" mode="0777" />
<mkdir dir="${project.builddir}/coverage" mode="0777" />
<mkdir dir="${project.builddir}/images" mode="0777" />
</target>
<target name="tests-ci">
<exec executable="${project.bindir}/phpunit" passthru="true">
<arg value="--coverage-html" />
<arg value="${project.builddir}/coverage" />
<arg value="--coverage-clover" />
<arg value="${project.builddir}/logs/clover.xml" />
<arg value="--log-junit" />
<arg value="${project.builddir}/logs/junit.xml" />
</exec>
</target>
<target name="loc-ci">
<exec executable="${project.bindir}/phploc" passthru="true">
<arg value="--count-tests" />
<arg value="--log-csv" />
<arg value="${project.builddir}/logs/phploc.csv" />
<arg value="--log-xml" />
<arg value="${project.builddir}/logs/phploc.xml" />
<arg value="${project.basedir}/src" />
<arg value="${project.basedir}/tests" />
</exec>
</target>
<target name="dependencies-ci">
<exec executable="${project.bindir}/pdepend" passthru="true">
<arg value="--jdepend-xml=${project.builddir}/logs/jdepend.xml" />
<arg value="--jdepend-chart=${project.builddir}/images/dependencies.svg" />
<arg value="--overview-pyramid=${project.builddir}/images/overview-pyramid.svg" />
<arg path="${project.basedir}/src" />
</exec>
</target>
<target name="phpmd-ci">
<exec executable="${project.bindir}/phpmd" passthru="true">
<arg path="${project.basedir}/src" />
<arg value="xml" />
<arg value="cleancode,codesize,controversial,design,naming,unusedcode" />
<arg value="--reportfile" />
<arg value="${project.builddir}/logs/pmd.xml" />
</exec>
</target>
<target name="style-ci">
<exec executable="${project.bindir}/phpcs" passthru="true">
<arg value="--report=checkstyle" />
<arg value="--report-file=${project.builddir}/logs/checkstyle.xml" />
<arg value="--standard=PSR2" />
<arg value="${project.basedir}/src" />
<arg value="${project.basedir}/tests" />
</exec>
</target>
<target name="duplications-ci">
<exec executable="${project.bindir}/phpcpd" passthru="true">
<arg value="--log-pmd" />
<arg value="${project.builddir}/logs/pmd-cpd.xml" />
<arg path="${project.basedir}/src" />
</exec>
</target>
</project>