1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project name =" DR_PaymentMethodFilter" default =" full-build" basedir =" ." >
3
+ <property name =" builddir" value =" ${ project.basedir } /build" override =" true" />
4
+ <property name =" srcdir" value =" ${ project.basedir } /src" override =" true" />
5
+ <property name =" testdir" value =" ${ project.basedir } /src" override =" true" />
6
+ <property name =" vendordir" value =" ${ project.basedir } /vendor" override =" true" />
7
+
8
+ <property name =" pdepend" value =" ${ vendordir } /bin/pdepend" />
9
+ <property name =" phpcpd" value =" ${ vendordir } /bin/phpcpd" />
10
+ <property name =" phpcs" value =" ${ vendordir } /bin/phpcs" />
11
+ <property name =" phploc" value =" ${ vendordir } /bin/phploc" />
12
+ <property name =" phpmd" value =" ${ vendordir } /bin/phpmd" />
13
+ <property name =" phpunit" value =" ${ vendordir } /bin/phpunit" />
14
+
15
+ <target name =" full-build"
16
+ depends =" prepare,static-analysis,phpunit,-check-failure"
17
+ description =" Performs static analysis, runs the tests, and generates project documentation" />
18
+
19
+ <target name =" full-build-parallel"
20
+ depends =" prepare,static-analysis-parallel,phpunit,-check-failure"
21
+ description =" Performs static analysis (executing the tools in parallel), runs the tests, and generates project documentation" />
22
+
23
+ <target name =" quick-build"
24
+ depends =" prepare,lint,phpunit-no-coverage"
25
+ description =" Performs a lint check and runs the tests (without generating code coverage reports)" />
26
+
27
+ <target name =" static-analysis"
28
+ depends =" lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcpd-ci"
29
+ description =" Performs static analysis" />
30
+
31
+ <target name =" static-analysis-parallel"
32
+ description =" Performs static analysis (executing the tools in parallel)" >
33
+ <parallel threadCount =" 2" >
34
+ <sequential >
35
+ <phingcall target =" pdepend" />
36
+ <phingcall target =" phpmd-ci" />
37
+ </sequential >
38
+ <phingcall target =" lint" />
39
+ <phingcall target =" phpcpd-ci" />
40
+ <phingcall target =" phpcs-ci" />
41
+ <phingcall target =" phploc-ci" />
42
+ </parallel >
43
+ </target >
44
+
45
+ <target name =" clean" unless =" clean.done" description =" Cleanup build artifacts" >
46
+ <delete dir =" ${ builddir } /api" />
47
+ <delete dir =" ${ builddir } /coverage" />
48
+ <delete dir =" ${ builddir } /logs" />
49
+ <delete dir =" ${ builddir } /pdepend" />
50
+ <property name =" clean.done" value =" true" />
51
+ </target >
52
+
53
+ <target name =" prepare" unless =" prepare.done" depends =" clean" description =" Prepare for build" >
54
+ <mkdir dir =" ${ builddir } /api" />
55
+ <mkdir dir =" ${ builddir } /coverage" />
56
+ <mkdir dir =" ${ builddir } /logs" />
57
+ <mkdir dir =" ${ builddir } /pdepend" />
58
+ <property name =" prepare.done" value =" true" />
59
+ </target >
60
+
61
+ <target name =" lint" unless =" lint.done" description =" Perform syntax check of sourcecode files" >
62
+ <apply executable =" php" checkreturn =" true" >
63
+ <arg value =" -l" />
64
+
65
+ <fileset dir =" ${ srcdir } " >
66
+ <include name =" **/*.php" />
67
+ </fileset >
68
+
69
+ <fileset dir =" ${ testdir } " >
70
+ <include name =" **/*.php" />
71
+ </fileset >
72
+ </apply >
73
+
74
+ <property name =" lint.done" value =" true" />
75
+ </target >
76
+
77
+ <target name =" phploc" unless =" phploc.done"
78
+ description =" Measure project size using PHPLOC and print human readable output. Intended for usage on the command line." >
79
+ <exec executable =" ${ phploc } " >
80
+ <arg value =" --count-tests" />
81
+ <arg path =" ${ srcdir } " />
82
+ <arg path =" ${ testdir } " />
83
+ </exec >
84
+
85
+ <property name =" phploc.done" value =" true" />
86
+ </target >
87
+
88
+ <target name =" phploc-ci" unless =" phploc.done" depends =" prepare"
89
+ description =" Measure project size using PHPLOC and log result in CSV and XML format. Intended for usage within a continuous integration environment." >
90
+ <exec executable =" ${ phploc } " >
91
+ <arg value =" --count-tests" />
92
+ <arg value =" --log-csv" />
93
+ <arg path =" ${ builddir } /logs/phploc.csv" />
94
+ <arg value =" --log-xml" />
95
+ <arg path =" ${ builddir } /logs/phploc.xml" />
96
+ <arg path =" ${ srcdir } " />
97
+ <arg path =" ${ testdir } " />
98
+ </exec >
99
+
100
+ <property name =" phploc.done" value =" true" />
101
+ </target >
102
+
103
+ <target name =" pdepend" unless =" pdepend.done" depends =" prepare"
104
+ description =" Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment." >
105
+ <exec executable =" ${ pdepend } " >
106
+ <arg value =" --jdepend-xml=${ builddir } /logs/jdepend.xml" />
107
+ <arg value =" --jdepend-chart=${ builddir } /pdepend/dependencies.svg" />
108
+ <arg value =" --overview-pyramid=${ builddir } /pdepend/overview-pyramid.svg" />
109
+ <arg path =" ${ srcdir } " />
110
+ </exec >
111
+
112
+ <property name =" pdepend.done" value =" true" />
113
+ </target >
114
+
115
+ <target name =" phpmd" unless =" phpmd.done"
116
+ description =" Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing." >
117
+ <exec executable =" ${ phpmd } " >
118
+ <arg path =" ${ srcdir } " />
119
+ <arg value =" text" />
120
+ <arg path =" ${ builddir } /phpmd.xml" />
121
+ </exec >
122
+
123
+ <property name =" phpmd.done" value =" true" />
124
+ </target >
125
+
126
+ <target name =" phpmd-ci" unless =" phpmd.done" depends =" prepare"
127
+ description =" Perform project mess detection using PHPMD and log result in XML format. Intended for usage within a continuous integration environment." >
128
+ <exec executable =" ${ phpmd } " >
129
+ <arg path =" ${ srcdir } " />
130
+ <arg value =" xml" />
131
+ <arg path =" ${ builddir } /phpmd.xml" />
132
+ <arg value =" --reportfile" />
133
+ <arg path =" ${ builddir } /logs/pmd.xml" />
134
+ </exec >
135
+
136
+ <property name =" phpmd.done" value =" true" />
137
+ </target >
138
+
139
+ <target name =" phpcs" unless =" phpcs.done"
140
+ description =" Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing." >
141
+ <exec executable =" ${ phpcs } " >
142
+ <arg value =" --standard=PSR2" />
143
+ <arg value =" --extensions=php" />
144
+ <arg path =" ${ srcdir } " />
145
+ <arg path =" ${ testdir } " />
146
+ </exec >
147
+
148
+ <property name =" phpcs.done" value =" true" />
149
+ </target >
150
+
151
+ <target name =" phpcs-ci" unless =" phpcs.done" depends =" prepare"
152
+ description =" Find coding standard violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment." >
153
+ <exec executable =" ${ phpcs } " output =" /dev/null" >
154
+ <arg value =" --report=checkstyle" />
155
+ <arg value =" --report-file=${ builddir } /logs/checkstyle.xml" />
156
+ <arg value =" --standard=PSR2" />
157
+ <arg value =" --extensions=php" />
158
+ <arg value =" --ignore=autoload.php" />
159
+ <arg path =" ${ srcdir } " />
160
+ <arg path =" ${ testdir } " />
161
+ </exec >
162
+
163
+ <property name =" phpcs.done" value =" true" />
164
+ </target >
165
+
166
+ <target name =" phpcpd" unless =" phpcpd.done"
167
+ description =" Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing." >
168
+ <exec executable =" ${ phpcpd } " >
169
+ <arg path =" ${ srcdir } " />
170
+ </exec >
171
+
172
+ <property name =" phpcpd.done" value =" true" />
173
+ </target >
174
+
175
+ <target name =" phpcpd-ci" unless =" phpcpd.done" depends =" prepare"
176
+ description =" Find duplicate code using PHPCPD and log result in XML format. Intended for usage within a continuous integration environment." >
177
+ <exec executable =" ${ phpcpd } " >
178
+ <arg value =" --log-pmd" />
179
+ <arg path =" ${ builddir } /logs/pmd-cpd.xml" />
180
+ <arg path =" ${ srcdir } " />
181
+ </exec >
182
+
183
+ <property name =" phpcpd.done" value =" true" />
184
+ </target >
185
+
186
+ <target name =" phpunit" unless =" phpunit.done" depends =" prepare" description =" Run unit tests with PHPUnit" >
187
+ <exec executable =" ${ phpunit } " returnProperty =" result.phpunit" >
188
+ <arg value =" --configuration" />
189
+ <arg path =" ${ project.basedir } /phpunit.xml.dist" />
190
+ </exec >
191
+
192
+ <property name =" phpunit.done" value =" true" />
193
+ </target >
194
+
195
+ <target name =" phpunit-no-coverage" unless =" phpunit.done" depends =" prepare"
196
+ description =" Run unit tests with PHPUnit (without generating code coverage reports)" >
197
+ <exec executable =" ${ phpunit } " checkreturn =" true" >
198
+ <arg value =" --configuration" />
199
+ <arg path =" ${ project.basedir } /phpunit.xml.dist" />
200
+ <arg value =" --no-coverage" />
201
+ </exec >
202
+
203
+ <property name =" phpunit.done" value =" true" />
204
+ </target >
205
+
206
+ <target name =" -check-failure" >
207
+ <if >
208
+ <isfailure code =" ${ result.phpunit } " />
209
+ <then >
210
+ <fail message =" PHPUnit did not finish successfully" />
211
+ </then >
212
+ </if >
213
+ </target >
214
+ </project >
0 commit comments