-
Notifications
You must be signed in to change notification settings - Fork 38
/
build.xml
90 lines (77 loc) · 3.03 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Slim Auth" default="build">
<property file="build.properties" />
<fileset id="src" dir="${project.basedir}/src">
<include name="**/*.php" />
</fileset>
<target name="clean" description="Clean build path">
<delete dir="${project.basedir}/build" />
<mkdir dir="${project.basedir}/build" />
<mkdir dir="${project.basedir}/build/docs" />
<mkdir dir="${project.basedir}/build/cache" />
<mkdir dir="${project.basedir}/build/coverage" />
<mkdir dir="${project.basedir}/build/logs" />
</target>
<target name="phplint" description="Running php lint check">
<phplint haltonfailure="true">
<fileset refid="src" />
</phplint>
</target>
<target name="phpunit" description="Running unit tests">
<exec
passthru="${passthru}"
dir="${project.basedir}"
command="phpunit
--log-junit=${project.basedir}/build/logs/junit.xml
--coverage-clover=${project.basedir}/build/logs/clover.xml
--coverage-html=${project.basedir}/build/coverage" />
</target>
<target name="php-cs-fixer" description="Fix CS violations">
<exec
passthru="${passthru}"
dir="${project.basedir}"
command="php-cs-fixer fix --verbose" />
</target>
<target name="phpdoc" description="Generate API documentation">
<exec passthru="${passthru}" command="phpdoc --force" />
</target>
<target name="phpunit-gen-report">
<phpunitreport
infile="${project.basedir}/build/logs/junit.xml"
format="frames"
todir="${project.basedir}/build/logs"
/>
</target>
<target name="phpcpd" description="Copy/Paste detection">
<phpcpd>
<fileset refid="src" />
<formatter
type="pmd"
outfile="${project.basedir}/build/logs/pmd-cpd.xml" />
</phpcpd>
</target>
<target name="phploc" description="Generate phploc.csv">
<phploc reportType="csv" reportName="phploc" reportDirectory="${project.basedir}/build/logs">
<fileset refid="src" />
</phploc>
</target>
<target name="phpmd" description="Mess detection">
<exec
passthru="${passthru}"
dir="${project.basedir}/src"
command="phpmd ${project.basedir}/src xml cleancode,codesize,controversial,design,naming,unusedcode
--suffixes .php
--reportfile ${project.basedir}/build/logs/pmd.xml" />
</target>
<target name="build" description="Build app">
<phingCall target="clean" />
<phingCall target="phplint" />
<phingCall target="php-cs-fixer" />
<phingCall target="phpunit" />
<phingCall target="phpunit-gen-report" />
<phingCall target="phpcpd" />
<phingCall target="phpmd" />
<phingCall target="phploc" />
<phingCall target="phpdoc" />
</target>
</project>