-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
73 lines (63 loc) · 2.89 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="UTF-8"?>
<project name="phinx-migrations" default="phpunit">
<target name="noop"/>
<property environment="env"/>
<condition property="is_windows">
<os family="windows"/>
</condition>
<tstamp>
<format property="now" pattern="yyyy-MM-dd HH:mm:ss" locale="en,UK"/>
<format property="now_num" pattern="yyyyMMddHHmmss" locale="en,UK"/>
<format property="now_file" pattern="yyyy-MM-dd_HHmmss" locale="en,UK"/>
</tstamp>
<!-- By default, we assume all tools to be on the $PATH -->
<condition property="ext" value=".bat">
<os family="windows"/>
</condition>
<!-- DISPLAYS WINDOWS OS -->
<target name="display_windows" if="is_windows" >
<echo message="OS Family is: Windows" />
</target>
<condition property="is_windows">
<os family="windows"/>
</condition>
<condition property="is_linux">
<os family="unix" />
</condition>
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="${basedir}/vendor/bin/phpunit${ext}" searchpath="true" resolveexecutable="true" failonerror="true" taskname="phpunit">
<arg value="--configuration"/>
<arg path="${basedir}/phpunit.xml"/>
</exec>
</target>
<target name="phpunit-coverage" description="Run unit tests with PHPUnit with coverage">
<delete dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/coverage"/>
<exec executable="${basedir}/vendor/bin/phpunit${ext}" searchpath="true" resolveexecutable="true" failonerror="true" taskname="phpunit-coverage">
<arg value="--configuration"/>
<arg path="${basedir}/phpunit.xml"/>
<arg value="--coverage-clover"/>
<arg path="${basedir}/build/logs/clover.xml"/>
<arg value="--coverage-html"/>
<arg path="${basedir}/build/coverage"/>
</exec>
</target>
<target name="php-cs-fixer" description="Code style fixer">
<mkdir dir="${basedir}/build"/>
<get src="https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.0.0/php-cs-fixer.phar" dest="${basedir}/build/php-cs-fixer.phar" skipexisting="true"/>
<exec executable="php" searchpath="true" resolveexecutable="true">
<arg value="${basedir}/build/php-cs-fixer.phar"/>
<arg value="fix"/>
<arg value="${basedir}/src/"/>
<arg value="--rules=@PSR2"/>
<arg value="--using-cache=no"/>
</exec>
<exec executable="php" searchpath="true" resolveexecutable="true">
<arg value="${basedir}/build/php-cs-fixer.phar"/>
<arg value="fix"/>
<arg value="${basedir}/tests/"/>
<arg value="--rules=@PSR2"/>
<arg value="--using-cache=no"/>
</exec>
</target>
</project>