forked from jeremykendall/flaming-archer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
128 lines (113 loc) · 4.46 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="UTF-8"?>
<project name="Flaming Archer" default="build">
<property file="build.properties" />
<fileset id="php-files" 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/api" />
<mkdir dir="${project.basedir}/build/cache" />
<mkdir dir="${project.basedir}/build/code-browser" />
<mkdir dir="${project.basedir}/build/coverage" />
<mkdir dir="${project.basedir}/build/logs" />
<mkdir dir="${project.basedir}/build/pdepend" />
</target>
<target name="phplint" description="Running php lint check">
<phplint haltonfailure="true">
<fileset refid="php-files" />
</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="phpunit-gen-report">
<phpunitreport
infile="${project.basedir}/build/logs/junit.xml"
format="frames"
todir="${project.basedir}/build/logs"
/>
</target>
<target name="phpdoc" description="Generate API documentation">
<exec
passthru="${passthru}"
command="phpdoc
-d ${project.basedir}/src
-t ${project.basedir}/build/api
--defaultpackagename=FA
--title='Flaming Archer'
--force" />
</target>
<target name="phpcs" description="Coding Standards Analysis">
<exec
passthru="${passthru}"
command="phpcs
--report=checkstyle
--report-file=${project.basedir}/build/logs/checkstyle.xml
--standard=PSR2
--extensions=php
${project.basedir}/src" />
</target>
<target name="phpcpd" description="Copy/Paste detection">
<phpcpd>
<fileset refid="php-files" />
<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="php-files" />
</phploc>
</target>
<target name="phpcb" description="Source code browser">
<exec
passthru="${passthru}"
command="phpcb
--log ${project.basedir}/build/logs
--source ${project.basedir}/src
--output ${project.basedir}/build/code-browser" />
</target>
<target name="pdepend" description="Calculate dependencies">
<exec
passthru="${passthru}"
dir="${project.basedir}/src"
command="pdepend
--configuration=${project.basedir}/pdepend.xml
--jdepend-chart=${project.basedir}/build/pdepend/dependencies.svg
--jdepend-xml=${project.basedir}/build/logs/jdepend.xml
--overview-pyramid=${project.basedir}/build/pdepend/overview-pyramid.svg
--suffix=php
--ignore=tests,vendor
${project.basedir}" />
</target>
<target name="phpmd" description="Mess detection">
<phpmd rulesets="codesize,design,unusedcode,controversial">
<fileset refid="php-files" />
<formatter
type="xml"
outfile="${project.basedir}/build/logs/pmd.xml" />
</phpmd>
</target>
<target name="build" description="Build app">
<phingCall target="clean" />
<phingCall target="phplint" />
<phingCall target="phpdoc" />
<phingCall target="phpcs" />
<phingCall target="phpunit" />
<phingCall target="phpunit-gen-report" />
<phingCall target="phpcpd" />
<phingCall target="phpmd" />
<phingCall target="pdepend" />
<phingCall target="phploc" />
<phingCall target="phpcb" />
</target>
</project>