forked from mollie/mollie-api-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
96 lines (85 loc) · 3.38 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="universal-client-php" default="build">
<target name="build" depends="build-parallel"/>
<target name="build-serial" depends="prepare,phpunit"/>
<target name="build-parallel" depends="prepare,tools-parallel"/>
<target name="tools-parallel" description="Run tools in parallel" depends="lint">
<parallel threadCount="4">
<antcall target="phpunit"/>
<antcall target="phploc"/>
<antcall target="phpcpd"/>
</parallel>
</target>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/clover"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
</target>
<target name="prepare" depends="clean"
description="Prepare for build">
<mkdir dir="${basedir}/build/clover"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
</target>
<target name="composer-install" description="Install dependencies through composer" unless="composer.installed">
<property name="composer.installed">true</property>
<exec executable="composer" failonerror="true">
<env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1" />
<arg value="validate" />
<arg value="--strict" />
</exec>
<exec executable="composer" failonerror="true">
<env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1" />
<arg value="install" />
<arg value="--no-interaction" />
<arg value="--no-progress" />
<arg value="--no-plugins" />
<arg value="--no-scripts" />
<arg value="--quiet" />
</exec>
</target>
<target name="lint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}">
<include name="**/*.php" />
<exclude name="vendor/**" />
<modified />
</fileset>
</apply>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="nice" failonerror="true">
<arg value="phploc" />
<arg value="--count-tests"/>
<arg value="--log-csv"/>
<arg value="build/logs/phploc.csv"/>
<arg value="--names"/>
<arg value="*.php,*.phtml"/>
<arg value="--exclude"/>
<arg value="build"/>
<arg value="--exclude"/>
<arg value="vendor"/>
<arg value="${basedir}" />
</exec>
</target>
<target name="phpcpd" description="Find duplicate code using PHPCPD">
<exec executable="nice">
<arg value="phpcpd" />
<arg value="--quiet" />
<arg value="--exclude"/>
<arg value="build"/>
<arg value="--exclude"/>
<arg value="tests"/>
<arg value="--log-pmd" />
<arg value="${basedir}/build/logs/cpd.xml" />
<arg value="." />
</exec>
</target>
<target name="phpunit" description="Run unit and integration tests with PHPUnit" depends="composer-install">
<!-- run the unit tests -->
<exec executable="vendor/bin/phpunit" />
</target>
</project>