|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
2 |
| -<project name="diff" default="build"> |
3 |
| - <property name="php" value="php"/> |
4 |
| - <property name="phpunit" value="phpunit"/> |
5 |
| - |
6 |
| - <target name="build" depends="prepare,lint,phpunit"/> |
7 |
| - |
| 2 | +<project name="diff"> |
8 | 3 | <target name="clean" description="Cleanup build artifacts">
|
| 4 | + <delete dir="${basedir}/vendor"/> |
| 5 | + <delete file="${basedir}/composer.lock"/> |
9 | 6 | </target>
|
10 | 7 |
|
11 |
| - <target name="prepare" depends="clean,phpab" description="Prepare for build"> |
12 |
| - </target> |
13 |
| - |
14 |
| - <target name="phpab" description="Generate autoloader script"> |
15 |
| - <exec executable="phpab"> |
16 |
| - <arg value="--output" /> |
17 |
| - <arg path="src/autoload.php" /> |
18 |
| - <arg path="src" /> |
19 |
| - </exec> |
20 |
| - </target> |
21 |
| - |
22 |
| - <target name="lint"> |
23 |
| - <apply executable="${php}" failonerror="true"> |
24 |
| - <arg value="-l" /> |
25 |
| - |
26 |
| - <fileset dir="${basedir}/src"> |
27 |
| - <include name="**/*.php" /> |
28 |
| - <modified /> |
| 8 | + <target name="composer" depends="clean" description="Install dependencies with Composer"> |
| 9 | + <tstamp> |
| 10 | + <format property="thirty.days.ago" pattern="MM/dd/yyyy hh:mm aa" offset="-30" unit="day"/> |
| 11 | + </tstamp> |
| 12 | + <delete> |
| 13 | + <fileset dir="${basedir}"> |
| 14 | + <include name="composer.phar" /> |
| 15 | + <date datetime="${thirty.days.ago}" when="before"/> |
29 | 16 | </fileset>
|
| 17 | + </delete> |
30 | 18 |
|
31 |
| - <fileset dir="${basedir}/tests"> |
32 |
| - <include name="**/*.php" /> |
33 |
| - <modified /> |
34 |
| - </fileset> |
35 |
| - </apply> |
36 |
| - </target> |
37 |
| - |
38 |
| - <target name="phpunit" description="Run unit tests with PHPUnit"> |
39 |
| - <condition property="phpunit_cmd" value="${php} ${phpunit}" else="${phpunit}"> |
40 |
| - <not> |
41 |
| - <equals arg1="${phpunit}" arg2="phpunit" /> |
42 |
| - </not> |
43 |
| - </condition> |
44 |
| - |
45 |
| - <exec executable="${phpunit_cmd}" failonerror="true"/> |
46 |
| - </target> |
| 19 | + <get src="https://getcomposer.org/composer.phar" dest="${basedir}/composer.phar" skipexisting="true"/> |
47 | 20 |
|
48 |
| - <target name="pear"> |
49 |
| - <mkdir dir="${basedir}/build/SebastianBergmann/Diff"/> |
50 |
| - |
51 |
| - <copy todir="${basedir}/build/SebastianBergmann/Diff"> |
52 |
| - <fileset dir="${basedir}/src"/> |
53 |
| - </copy> |
54 |
| - |
55 |
| - <copy file="LICENSE" todir="${basedir}/build"/> |
56 |
| - <copy file="README.md" todir="${basedir}/build"/> |
57 |
| - |
58 |
| - <exec executable="pear" dir="${basedir}/build"> |
59 |
| - <arg value="package" /> |
| 21 | + <exec executable="php"> |
| 22 | + <arg value="composer.phar"/> |
| 23 | + <arg value="install"/> |
60 | 24 | </exec>
|
61 |
| - |
62 |
| - <delete dir="${basedir}/build/SebastianBergmann"/> |
63 |
| - <delete file="${basedir}/build/LICENSE"/> |
64 |
| - <delete file="${basedir}/build/README.md"/> |
65 | 25 | </target>
|
66 | 26 | </project>
|
0 commit comments