-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
74 lines (61 loc) · 2.57 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
74
<?xml version="1.0" encoding="UTF-8"?>
<project name="tideman" default="build">
<target name="build" depends="lint,phpstan,phpcs,phpunit" />
<target name="build-ci" depends="lint,phpstan,phpcs,phpunit-ci,print-logs" />
<target name="test" depends="phpunit" />
<target name="coverage" depends="phpunit-coverage" />
<target name="clean" description="Cleanup build artifacts">
<delete dir="build/coverage"/>
<delete dir="build/logs"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="build/coverage"/>
<mkdir dir="build/logs"/>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<phplint>
<fileset dir="src">
<include name="**/*.php" />
</fileset>
<fileset dir="tests">
<include name="**/*.php" />
</fileset>
</phplint>
</target>
<target name="print-logs" description="print build logs">
<loadfile property="log-output" file="build/logs/out.log" />
<echo message="${log-output}" />
</target>
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer">
<exec executable="vendor/bin/phpcs" passthru="true" checkreturn="true">
<arg value="--standard=PSR2" />
<arg path="src" />
<arg path="tests" />
</exec>
</target>
<target name="phpstan" description="Statically analyze php code">
<exec executable="vendor/bin/phpstan" passthru="true" checkreturn="true">
<arg value="analyse" />
<arg value="--no-progress" />
<arg value="--level=4" />
<arg path="src" />
<arg path="tests" />
</exec>
</target>
<target name="phpunit" description="Run all tests with PHPUnit">
<exec executable="vendor/bin/phpunit" passthru="true" checkreturn="true" >
<arg path="tests" />
</exec>
</target>
<target name="phpunit-ci" description="Run all tests with PHPUnit">
<exec executable="vendor/bin/phpunit" passthru="true" checkreturn="true">
<arg value="--coverage-text" />
<arg value="--colors=never" />
</exec>
</target>
<target name="phpunit-coverage" depends="prepare" description="Run all tests and generate html coverage report">
<exec executable="vendor/bin/phpunit" passthru="true" checkreturn="true">
<arg value="--coverage-html=build/coverage" />
</exec>
</target>
</project>