-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
93 lines (76 loc) · 3.1 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?xml version="1.0" encoding="UTF-8"?>
<project name="Templado" default="build" basedir=".">
<property name="source" value="src"/>
<property name="tools" value="${basedir}/tools" />
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/phpab"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/phpab"/>
</target>
<target name="lint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}/src">
<include name="**/*.php" />
<modified />
</fileset>
</apply>
</target>
<target name="phpab" description="Build autoloader">
<mkdir dir="${basedir}/build/phpab" />
<exec executable="${tools}/phpab">
<arg line="--cache ${basedir}/build/phpab/autoload.cache -1 -o src/autoload.php" />
<arg path="src" />
</exec>
</target>
<target name="phpunit" description="Run tests using PHPUnit">
<exec executable="${tools}/phpunit" failonerror="true"/>
</target>
<target name="cs" description="Run PHP-CS-Fixer">
<exec executable="${tools}/php-cs-fixer" failonerror="true">
<arg line="fix" />
</exec>
</target>
<target name="cs-check" description="Run PHP-CS-Fixer in dry-run mode">
<exec executable="${tools}/php-cs-fixer" failonerror="true">
<arg line="fix --dry-run" />
</exec>
</target>
<target name="autoload" depends="phpab">
<exec executable="${tools}/composer" failonerror="true">
<arg line="dump" />
</exec>
</target>
<target name="composer">
<exec executable="${tools}/composer" failonerror="true">
<arg line="install" />
</exec>
</target>
<target name="tools">
<exec executable="phive" failonerror="true">
<arg line="--no-progress" />
<arg line="install" />
<arg line="--trust-gpg-keys" />
<!-- phpunit --> <!-- phpab --> <!-- php-cs-fixer --> <!-- psalm --> <!-- infection -->
<arg value="4AA394086372C20A,2A8299CE842DD38C,E82B2FB314E9906E,12CE0F1D262429A5,C5095986493B4AA0" />
</exec>
</target>
<target name="psalm">
<exec executable="${tools}/psalm" failonerror="true">
<arg line="--no-cache --show-info=true" />
</exec>
</target>
<target name="infection">
<exec executable="/usr/bin/php" failonerror="true">
<arg line="-d opcache.optimizations_level=0 ./tools/infection -jmax" />
</exec>
</target>
<target name="setup" depends="clean,tools,composer,phpab" />
<target name="test" depends="clean,lint,phpunit"/>
<target name="ci" depends="lint,setup,autoload,cs-check"/>
<target name="qa" depends="psalm"/>
<target name="build" depends="clean,autoload,cs,qa,phpunit" />
</project>