This repository has been archived by the owner on Apr 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
112 lines (96 loc) · 4.3 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?xml version="1.0" encoding="UTF-8"?>
<project name="PhingVisualizer" default="setup" phingVersion="3.0">
<target name="setup" description="Prepare library for dev">
<phingcall target="composer:install"/>
<phingcall target="phive:install"/>
</target>
<target name="composer:install" description="Install dependencies">
<composer command="install">
<arg value="--no-interaction"/>
<arg value="--prefer-dist"/>
</composer>
</target>
<target name="composer:optimize" description="Install dependencies optimized for production environment">
<composer command="install">
<arg value="--no-dev"/>
<arg value="--optimize-autoloader"/>
<arg value="--prefer-dist"/>
</composer>
</target>
<target name="composer:validate" description="Checks if composer.json is valid">
<composer command="validate">
<arg value="--strict"/>
</composer>
</target>
<target name="phpunit:run" description="Run PHPUnit's tests" depends="composer:install, phive:install">
<exec executable="bin/phpunit" passthru="true" checkreturn="true"/>
</target>
<target name="php:check-syntax" description="Check syntax on PHP files">
<phplint haltonfailure="true">
<fileset dir="${project.basedir}">
<include name="src/**.php"/>
<include name="tests/**.php"/>
</fileset>
</phplint>
</target>
<target name="test" description="Test library"
depends="php:check-syntax, composer:validate, composer:install, phpstan:analyse, phpunit:run, behat:run"/>
<target name="make:cc-test-reporter" description="Download CodeClimate test reporter">
<exec command="make cc-test-reporter" passthru="true"/>
</target>
<target name="phive:install" description="Install PHPStan">
<exec executable="phive" checkreturn="true" passthru="true">
<arg value="install"/>
<arg value="--trust-gpg-keys"/>
<arg value="4AA394086372C20A,8E730BA25823D8B5,2420BAE0A3BE25C6,4AA394086372C20A"/>
</exec>
</target>
<target name="code-climate:before" description="CodeClimate before build" depends="make:cc-test-reporter">
<exec executable="${project.basedir}/cc-test-reporter" passthru="true">
<arg value="before-build"/>
</exec>
</target>
<target name="phpstan:analyse" description="Analyse source code" depends="phive:install">
<exec executable="bin/phpstan" passthru="true" checkreturn="true">
<arg value="--level=max"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--debug"/>
<arg value="analyse"/>
<arg path="src/"/>
</exec>
</target>
<target name="code-climate:after" description="CodeClimate after build" depends="make:cc-test-reporter">
<exec executable="${project.basedir}/cc-test-reporter" passthru="true">
<arg value="format-coverage"/>
<arg value="--input-type=clover"/>
<arg file="${project.basedir}/resources/coverage/clover.xml"/>
</exec>
<exec executable="${project.basedir}/cc-test-reporter" passthru="true">
<arg value="upload-coverage"/>
</exec>
</target>
<target name="behat:run" description="Run Behat tests" depends="composer:install">
<exec executable="vendor/bin/behat" checkreturn="true" passthru="true">
<arg value="--stop-on-failure"/>
</exec>
</target>
<target name="git:tags" description="List all git tags">
<!--https://stackoverflow.com/a/34239190/4345061-->
<exec executable="git" passthru="true">
<arg value="log"/>
<arg line="--graph --all --decorate --oneline --simplify-by-decoration"/>
</exec>
</target>
<target name="changelog:links" description="Update links in composer.json">
<composer command="require">
<arg value="symplify/changelog-linker"/>
</composer>
<exec executable="vendor/bin/changelog-linker">
<arg value="link"/>
</exec>
<composer command="remove">
<arg value="symplify/changelog-linker"/>
</composer>
</target>
</project>