Skip to content

Commit 4392b5c

Browse files
Cleanup build system
1 parent ec57a3d commit 4392b5c

File tree

5 files changed

+32
-156
lines changed

5 files changed

+32
-156
lines changed

build.xml

Lines changed: 16 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,26 @@
11
<?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">
83
<target name="clean" description="Cleanup build artifacts">
4+
<delete dir="${basedir}/vendor"/>
5+
<delete file="${basedir}/composer.lock"/>
96
</target>
107

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"/>
2916
</fileset>
17+
</delete>
3018

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"/>
4720

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"/>
6024
</exec>
61-
62-
<delete dir="${basedir}/build/SebastianBergmann"/>
63-
<delete file="${basedir}/build/LICENSE"/>
64-
<delete file="${basedir}/build/README.md"/>
6525
</target>
6626
</project>

build/package.xml

Lines changed: 0 additions & 58 deletions
This file was deleted.

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
],
1717
"require": {
1818
"php": ">=5.3.3"
19+
},
20+
"require-dev": {
21+
"phpunit/phpunit": "~4.2"
1922
},
2023
"autoload": {
2124
"classmap": [

phpunit.xml.dist

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
convertErrorsToExceptions="true"
5-
convertNoticesToExceptions="true"
6-
convertWarningsToExceptions="true"
7-
processIsolation="false"
8-
stopOnFailure="false"
9-
bootstrap="src/autoload.php">
10-
<testsuites>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.2/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
backupGlobals="false"
6+
verbose="true">
117
<testsuite name="Diff">
12-
<directory>./tests</directory>
8+
<directory suffix="Test.php">tests</directory>
139
</testsuite>
14-
</testsuites>
15-
<filter>
16-
<whitelist addUncoveredFilesFromWhitelist="true">
17-
<directory>./src</directory>
18-
<exclude>
19-
<file>./src/autoload.php</file>
20-
</exclude>
21-
</whitelist>
22-
</filter>
10+
11+
<filter>
12+
<whitelist processUncoveredFilesFromWhitelist="true">
13+
<directory suffix=".php">src</directory>
14+
</whitelist>
15+
</filter>
2316
</phpunit>
17+

src/autoload.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)