-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
344 lines (312 loc) · 8.66 KB
/
build.xml
File metadata and controls
344 lines (312 loc) · 8.66 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
<?xml version="1.0" encoding="UTF-8"?>
<project default="build" name="OBMS">
<property name="basedir" value="."/>
<property name="source" value="./src"/>
<property name="ignore" value="build"/>
<target
depends="prepare,phars,vendors,fixtures,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdoc,phpcb,phpunit"
name="build"/>
<target
depends="prepare,phars,vendors,fixtures,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdoc,phpcb"
name="build-no-tests"/>
<target
depends="prepare,lint,phploc,tools-parallel"
name="build-parallel"/>
<target
description="Run tools in parallel"
name="tools-parallel">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd-ci"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs-ci"/>
<antcall target="phploc"/>
<antcall target="phpdoc"/>
</parallel>
</target>
<target
description="Cleanup build artifacts"
name="clean">
<delete dir="${basedir}/build/doc"/>
<delete
dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<delete
file="${basedir}/bin/composer.phar"/>
<delete
file="${basedir}/bin/pdepend.phar"/>
<delete
file="${basedir}/bin/phploc.phar"/>
<delete file="${basedir}/bin/phpmd.phar"/>
<delete file="${basedir}/bin/phpcs.phar"/>
<delete
file="${basedir}/bin/phpcpd.phar"/>
<delete
file="${basedir}/bin/phpdoc.phar"/>
<delete file="${basedir}/bin/phpcb.phar"/>
<delete
file="${basedir}/bin/phpunit.phar"/>
</target>
<target depends="clean"
description="Prepare for build"
name="prepare">
<mkdir dir="${basedir}/build/doc"/>
<mkdir
dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target
description="Perform syntax check of sourcecode files"
name="lint">
<apply executable="php">
<arg value="-l"/>
<fileset dir="${basedir}/src">
<include name="**/*.php"/>
<modified/>
</fileset>
<fileset dir="${basedir}/src/">
<include name="**/*Test.php"/>
<modified/>
</fileset>
</apply>
</target>
<target description="Install phars"
name="phars">
<!-- composer -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="curl -s https://getcomposer.org/installer | php"/>
</exec>
<move file="${basedir}/composer.phar"
tofile="${basedir}/bin/composer.phar"/>
<!-- pdepend -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="wget http://static.pdepend.org/php/latest/pdepend.phar"/>
</exec>
<chmod file="pdepend.phar" perm="+x"/>
<move file="${basedir}/pdepend.phar"
tofile="${basedir}/bin/pdepend.phar"/>
<!-- phploc -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="wget https://phar.phpunit.de/phploc.phar"/>
</exec>
<chmod file="${basedir}/phploc.phar"
perm="+x"/>
<move file="${basedir}/phploc.phar"
tofile="${basedir}/bin/phploc.phar"/>
<!-- phpmd -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="wget http://static.phpmd.org/php/latest/phpmd.phar"/>
</exec>
<chmod file="${basedir}/phpmd.phar"
perm="+x"/>
<move file="${basedir}/phpmd.phar"
tofile="${basedir}/bin/phpmd.phar"/>
<!-- phpcs -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar"/>
</exec>
<chmod file="${basedir}/phpcs.phar"
perm="+x"/>
<move file="${basedir}/phpcs.phar"
tofile="${basedir}/bin/phpcs.phar"/>
<!-- phpcpd -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="wget https://phar.phpunit.de/phpcpd.phar"/>
</exec>
<chmod file="${basedir}/phpcpd.phar"
perm="+x"/>
<move file="${basedir}/phpcpd.phar"
tofile="${basedir}/bin/phpcpd.phar"/>
<!-- phpdoc -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="wget http://phpdoc.org/phpDocumentor.phar"/>
</exec>
<chmod
file="${basedir}/phpDocumentor.phar"
perm="+x"/>
<move
file="${basedir}/phpDocumentor.phar"
tofile="${basedir}/bin/phpdoc.phar"/>
<!-- phpcb -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="wget https://github.com/Mayflower/PHP_CodeBrowser/releases/download/1.1.1/phpcb-1.1.1.phar"/>
</exec>
<chmod
file="${basedir}/phpcb-1.1.1.phar"
perm="+x"/>
<move file="${basedir}/phpcb-1.1.1.phar"
tofile="${basedir}/bin/phpcb.phar"/>
<!-- phpunit -->
<exec executable="bash">
<arg value="-c"/>
<arg
value="wget https://phar.phpunit.de/phpunit.phar"/>
</exec>
<chmod
file="${basedir}/phpunit.phar"
perm="+x"/>
<move file="${basedir}/phpunit.phar"
tofile="${basedir}/bin/phpunit.phar"/>
</target>
<target
description="Measure project size using PHPLOC"
name="phploc">
<exec
executable="${basedir}/bin/phploc.phar">
<arg value="--count-tests"/>
<arg value="--log-csv"/>
<arg
value="${basedir}/build/logs/phploc.csv"/>
<arg value="--log-xml"/>
<arg
value="${basedir}/build/logs/phploc.xml"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target
description="Calculate software metrics using PHP_Depend"
name="pdepend">
<exec
executable="${basedir}/bin/pdepend.phar">
<arg
value="--jdepend-xml=${basedir}/build/logs/phpdepend.xml"/>
<arg
value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg"/>
<arg
value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target
description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing."
name="phpmd">
<exec
executable="${basedir}/bin/phpmd.phar">
<arg path="${basedir}/src"/>
<arg value="xml"/>
<arg
value="${basedir}/build/logs/pmd.xml"/>
</exec>
</target>
<target
description="Perform project mess detection using PHPMD creating a log file for the continuous integration server"
name="phpmd-ci">
<exec
executable="${basedir}/bin/phpmd.phar">
<arg
line="./src xml ${basedir}/app/phpmd.xml --reportfile ${basedir}/build/logs/pmd.xml"/>
</exec>
</target>
<target
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing."
name="phpcs">
<exec
executable="${basedir}/bin/phpcs.phar">
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target
description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server"
name="phpcs-ci">
<exec
executable="${basedir}/bin/phpcs.phar">
<arg value="--report=checkstyle"/>
<arg
value="--report-file=${basedir}/build/logs/checkstyle.xml"/>
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target
description="Find duplicate code using PHPCPD"
name="phpcpd">
<exec
executable="${basedir}/bin/phpcpd.phar">
<arg value="--log-pmd"/>
<arg
value="${basedir}/build/logs/pmd-cpd.xml"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target
description="Generate documentation using PHPDocumentor"
name="phpdoc">
<exec
executable="${basedir}/bin/phpdoc.phar">
<arg value="--directory"/>
<arg path="${source}"/>
<arg value="--target"/>
<arg path="${basedir}/build/doc"/>
<arg value="--title"/>
<arg value="OBMSDocumentation"/>
<arg value="--template"/>
<arg value="clean"/>
</exec>
</target>
<target
description="Aggregate tool output with PHP_CodeBrowser"
name="phpcb">
<exec
executable="${basedir}/bin/phpcb.phar">
<arg value="--log"/>
<arg value="${basedir}/build/logs/"/>
<arg value="--output"/>
<arg
value="${basedir}/build/code-browser/"/>
<arg value="--source"/>
<arg value="${basedir}/src/"/>
</exec>
</target>
<target description="Install vendors"
name="vendors">
<exec
executable="${basedir}/bin/composer.phar">
<arg value="install"/>
</exec>
</target>
<target depends="vendors"
description="Install fixtures"
name="fixtures">
<exec executable="php">
<arg value="app/console"/>
<arg value="doctrine:fixtures:load"/>
<arg value="--env=test"/>
<arg value="--no-interaction"/>
</exec>
</target>
<target
description="Run unit tests with PHPUnit"
name="phpunit">
<exec executable="${basedir}/bin/phpunit.phar">
<arg value="-c"/>
<arg path="app/phpunit.xml.dist"/>
<arg value="--coverage-html"/>
<arg path="build/coverage/"/>
</exec>
</target>
</project>