|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
2 |
| -<project name="phpunit" default="setup" xmlns:if="ant:if" xmlns:unless="ant:unless"> |
3 |
| - <target name="setup" depends="clean,install-dependencies"/> |
4 |
| - <target name="validate" depends="php-syntax-check,validate-composer-json"/> |
| 2 | +<project name="phpunit" default="setup"> |
| 3 | + <target name="setup" depends="install-dependencies"/> |
5 | 4 |
|
6 |
| - <target name="clean" unless="clean.done" description="Cleanup build artifacts"> |
| 5 | + <target name="clean" description="Cleanup build artifacts"> |
7 | 6 | <delete dir="${basedir}/build/artifacts"/>
|
8 | 7 | <delete dir="${basedir}/build/tmp"/>
|
9 | 8 | <delete dir="${basedir}/vendor"/>
|
10 |
| - |
11 |
| - <property name="clean.done" value="true"/> |
12 | 9 | </target>
|
13 | 10 |
|
14 |
| - <target name="prepare" unless="prepare.done" depends="clean" description="Prepare for build"> |
15 |
| - <mkdir dir="${basedir}/build/artifacts/logfiles"/> |
16 |
| - <mkdir dir="${basedir}/build/tmp"/> |
17 |
| - |
18 |
| - <property name="prepare.done" value="true"/> |
19 |
| - </target> |
20 |
| - |
21 |
| - <target name="validate-composer-json" depends="clean" unless="validate-composer-json.done" description="Validate composer.json"> |
22 |
| - <exec executable="${basedir}/tools/composer" failonerror="true" taskname="composer"> |
23 |
| - <arg value="validate"/> |
24 |
| - <arg value="--strict"/> |
25 |
| - <arg value="${basedir}/composer.json"/> |
26 |
| - </exec> |
27 |
| - |
28 |
| - <property name="validate-composer-json.done" value="true"/> |
29 |
| - </target> |
30 |
| - |
31 |
| - <target name="-dependencies-installed"> |
32 |
| - <available type="dir" file="${basedir}/vendor" property="dependencies-installed"/> |
33 |
| - </target> |
34 |
| - |
35 |
| - <target name="install-dependencies" unless="dependencies-installed" depends="-dependencies-installed,validate-composer-json" description="Install dependencies with Composer"> |
| 11 | + <target name="install-dependencies" description="Install dependencies (and generate autoloader) with Composer"> |
36 | 12 | <exec executable="${basedir}/tools/composer" taskname="composer">
|
37 | 13 | <arg value="install"/>
|
38 | 14 | <arg value="--no-interaction"/>
|
|
41 | 17 | </exec>
|
42 | 18 | </target>
|
43 | 19 |
|
44 |
| - <target name="check-dependencies" description="Performs check for outdated dependencies"> |
45 |
| - <exec executable="${basedir}/tools/composer" taskname="composer"> |
46 |
| - <arg value="show"/> |
47 |
| - <arg value="--minor-only"/> |
48 |
| - <arg value="--latest"/> |
49 |
| - <arg value="--direct"/> |
50 |
| - <arg value="--outdated"/> |
51 |
| - <arg value="--strict"/> |
| 20 | + <target name="update-tools"> |
| 21 | + <exec executable="${basedir}/tools/phive"> |
| 22 | + <arg value="--no-progress"/> |
| 23 | + <arg value="self-update"/> |
| 24 | + </exec> |
| 25 | + |
| 26 | + <exec executable="${basedir}/tools/phive"> |
| 27 | + <arg value="--no-progress"/> |
| 28 | + <arg value="update"/> |
52 | 29 | </exec>
|
53 | 30 | </target>
|
54 | 31 |
|
55 |
| - <target name="php-syntax-check" unless="php-syntax-check.done" description="Perform syntax check on PHP files"> |
56 |
| - <apply executable="php" failonerror="true" taskname="lint"> |
57 |
| - <arg value="-l"/> |
| 32 | + <target name="generate-global-assert-wrappers" description="Generate global function wrappers for static methods in Assert and TestCase that are commonly used"> |
| 33 | + <exec executable="${basedir}/build/scripts/generate-global-assert-wrappers.php" taskname="generate-global-assert-wrappers" failonerror="true"/> |
| 34 | + <exec executable="${basedir}/tools/php-cs-fixer" taskname="php-cs-fixer" failonerror="true"> |
| 35 | + <arg value="fix"/> |
| 36 | + <arg path="${basedir}/src/Framework/Assert/Functions.php"/> |
| 37 | + </exec> |
| 38 | + </target> |
58 | 39 |
|
59 |
| - <fileset dir="${basedir}/src"> |
60 |
| - <include name="**/*.php"/> |
61 |
| - <modified/> |
62 |
| - </fileset> |
| 40 | + <target name="package-extension-for-testing" |
| 41 | + description="Package PHAR of test runner extension that is used for testing"> |
| 42 | + <delete dir="${basedir}/build/tmp"/> |
| 43 | + <mkdir dir="${basedir}/build/tmp"/> |
63 | 44 |
|
64 |
| - <fileset dir="${basedir}/tests"> |
65 |
| - <include name="**/*.php"/> |
66 |
| - <modified/> |
| 45 | + <copy tofile="${basedir}/build/tmp/manifest.xml" file="${basedir}/build/test-extension/manifest.xml" /> |
| 46 | + <copy todir="${basedir}/build/tmp/phpunit-test-extension"> |
| 47 | + <fileset dir="${basedir}/build/test-extension/src"> |
| 48 | + <include name="**/*" /> |
67 | 49 | </fileset>
|
68 |
| - </apply> |
| 50 | + </copy> |
69 | 51 |
|
70 |
| - <property name="php-syntax-check.done" value="true"/> |
71 |
| - </target> |
| 52 | + <exec executable="${basedir}/tools/phpab" taskname="phpab"> |
| 53 | + <arg value="--all" /> |
| 54 | + <arg value="--static" /> |
| 55 | + <arg value="--once" /> |
| 56 | + <arg value="--phar" /> |
| 57 | + <arg value="--output" /> |
| 58 | + <arg path="${basedir}/tests/end-to-end/_files/phar-extension/tools/phpunit.d/phpunit-test-extension-1.0.0.phar" /> |
| 59 | + <arg path="${basedir}/build/tmp" /> |
| 60 | + </exec> |
72 | 61 |
|
73 |
| - <target name="test" depends="validate,install-dependencies" description="Run tests"> |
74 |
| - <exec executable="${basedir}/phpunit" taskname="phpunit"/> |
| 62 | + <delete dir="${basedir}/build/tmp"/> |
75 | 63 | </target>
|
76 | 64 |
|
77 | 65 | <target name="signed-phar" depends="phar" description="Create signed PHAR archive of PHPUnit and all its dependencies">
|
|
385 | 373 | <arg value="--coverage-text" />
|
386 | 374 | </exec>
|
387 | 375 | </target>
|
388 |
| - |
389 |
| - <target name="update-tools"> |
390 |
| - <exec executable="${basedir}/tools/phive"> |
391 |
| - <arg value="--no-progress"/> |
392 |
| - <arg value="self-update"/> |
393 |
| - </exec> |
394 |
| - |
395 |
| - <exec executable="${basedir}/tools/phive"> |
396 |
| - <arg value="--no-progress"/> |
397 |
| - <arg value="update"/> |
398 |
| - </exec> |
399 |
| - </target> |
400 |
| - |
401 |
| - <target name="generate-global-assert-wrappers" description="Generate global function wrappers for static methods in Assert and TestCase that are commonly used"> |
402 |
| - <exec executable="${basedir}/build/scripts/generate-global-assert-wrappers.php" taskname="generate-global-assert-wrappers" failonerror="true"/> |
403 |
| - <exec executable="${basedir}/tools/php-cs-fixer" taskname="php-cs-fixer" failonerror="true"> |
404 |
| - <arg value="fix"/> |
405 |
| - <arg path="${basedir}/src/Framework/Assert/Functions.php"/> |
406 |
| - </exec> |
407 |
| - </target> |
408 |
| - |
409 |
| - <target name="package-extension-for-testing" |
410 |
| - description="Package PHAR of test runner extension that is used for testing"> |
411 |
| - <delete dir="${basedir}/build/tmp"/> |
412 |
| - <mkdir dir="${basedir}/build/tmp"/> |
413 |
| - |
414 |
| - <copy tofile="${basedir}/build/tmp/manifest.xml" file="${basedir}/build/test-extension/manifest.xml" /> |
415 |
| - <copy todir="${basedir}/build/tmp/phpunit-test-extension"> |
416 |
| - <fileset dir="${basedir}/build/test-extension/src"> |
417 |
| - <include name="**/*" /> |
418 |
| - </fileset> |
419 |
| - </copy> |
420 |
| - |
421 |
| - <exec executable="${basedir}/tools/phpab" taskname="phpab"> |
422 |
| - <arg value="--all" /> |
423 |
| - <arg value="--static" /> |
424 |
| - <arg value="--once" /> |
425 |
| - <arg value="--phar" /> |
426 |
| - <arg value="--output" /> |
427 |
| - <arg path="${basedir}/tests/end-to-end/_files/phar-extension/tools/phpunit.d/phpunit-test-extension-1.0.0.phar" /> |
428 |
| - <arg path="${basedir}/build/tmp" /> |
429 |
| - </exec> |
430 |
| - |
431 |
| - <delete dir="${basedir}/build/tmp"/> |
432 |
| - </target> |
433 | 376 | </project>
|
434 |
| - |
0 commit comments