|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | | -<project name="yii2-base-project" default="full-build"> |
| 2 | +<project name="yii2-base-project" default="build"> |
3 | 3 | <property name="pdepend" value="${basedir}/vendor/bin/pdepend"/> |
4 | 4 | <property name="phpcpd" value="${basedir}/vendor/bin/phpcpd"/> |
5 | 5 | <property name="phpcs" value="${basedir}/vendor/bin/phpcs"/> |
|
8 | 8 | <property name="phpmd" value="${basedir}/vendor/bin/phpmd"/> |
9 | 9 | <property name="phpunit" value="${basedir}/vendor/bin/phpunit"/> |
10 | 10 |
|
| 11 | + <target name="build" |
| 12 | + depends="prepare,static-analysis" |
| 13 | + description="Performs static analysis and withouy running the tests"/> |
| 14 | + |
11 | 15 | <target name="full-build" |
12 | 16 | depends="prepare,static-analysis,phpunit" |
13 | 17 | description="Performs static analysis and runs the tests"/> |
|
65 | 69 | <target name="lint" |
66 | 70 | unless="lint.done" |
67 | 71 | description="Perform syntax check of sourcecode files"> |
68 | | - <apply executable="php" taskname="lint"> |
| 72 | + <apply executable="php" taskname="lint" failonerror="true"> |
69 | 73 | <arg value="-l"/> |
70 | 74 |
|
71 | 75 | <fileset dir="${basedir}/app"> |
72 | 76 | <include name="**/*.php"/> |
73 | | - <modified/> |
74 | 77 | </fileset> |
75 | 78 |
|
76 | 79 | <fileset dir="${basedir}/tests"> |
77 | 80 | <include name="**/*.php"/> |
78 | | - <modified/> |
79 | 81 | </fileset> |
80 | 82 | </apply> |
81 | 83 |
|
|
187 | 189 | unless="phpcpd.done" |
188 | 190 | description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing."> |
189 | 191 | <exec executable="${phpcpd}" taskname="phpcpd"> |
| 192 | + <arg value="--min-lines=2"/> |
| 193 | + <arg value="--min-tokens=5"/> |
190 | 194 | <arg path="${basedir}/app"/> |
191 | 195 | </exec> |
192 | 196 |
|
|
200 | 204 | <exec executable="${phpcpd}" taskname="phpcpd"> |
201 | 205 | <arg value="--log-pmd"/> |
202 | 206 | <arg path="${basedir}/build/logs/pmd-cpd.xml"/> |
| 207 | + <arg value="--min-lines=2"/> |
| 208 | + <arg value="--min-tokens=10"/> |
203 | 209 | <arg path="${basedir}/app"/> |
204 | 210 | </exec> |
205 | 211 |
|
|
213 | 219 | <exec executable="${phpunit}" resultproperty="result.phpunit" taskname="phpunit"> |
214 | 220 | <arg value="--configuration"/> |
215 | 221 | <arg path="${basedir}/build/phpunit.xml"/> |
| 222 | + <arg path="${basedir}/tests"/> |
216 | 223 | </exec> |
217 | 224 |
|
218 | 225 | <property name="phpunit.done" value="true"/> |
|
226 | 233 | <arg value="--configuration"/> |
227 | 234 | <arg path="${basedir}/build/phpunit.xml"/> |
228 | 235 | <arg value="--no-coverage"/> |
| 236 | + <arg path="${basedir}/tests"/> |
229 | 237 | </exec> |
230 | 238 |
|
231 | 239 | <property name="phpunit.done" value="true"/> |
|
0 commit comments