This repository has been archived by the owner on Dec 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
102 lines (89 loc) · 3.74 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="bitcoin-php " default="build">
<property name="toolsdir" value="${project.basedir}/vendor/bin"/>
<property name="builddir" value="${project.basedir}/build/"/>
<target name="build" depends="prepare,lint,phpcbf,phpunit" />
<target name="clean"
unless="clean.done"
description="Cleanup build artifacts">
<delete dir="${builddir}/coverage"/>
<delete dir="${builddir}/cache"/>
<delete dir="${builddir}/logs"/>
<property name="clean.done" value="true"/>
</target>
<target name="prepare"
unless="prepare.done"
depends="clean"
description="Prepare for build">
<mkdir dir="${builddir}/coverage"/>
<mkdir dir="${builddir}/cache"/>
<mkdir dir="${builddir}/logs"/>
<mkdir dir="${builddir}/docs"/>
<property name="prepare.done" value="true"/>
</target>
<target name="lint"
description="Check the syntax of PHP files">
<mkdir dir="${builddir}/cache" />
<phplint cachefile="${builddir}/cache/phplint.cache">
<fileset dir="${project.basedir}/src">
<include name="**/*.php"/>
</fileset>
<fileset dir="${project.basedir}/tests">
<include name="**/*.php"/>
</fileset>
</phplint>
</target>
<target name="phpunit"
description="Run test suite"
>
<delete dir="${builddir}/docs/code-coverage" />
<mkdir dir="${builddir}/docs/code-coverage" />
<exec executable="${toolsdir}/phpunit" passthru="true">
<arg value="-c" />
<arg path="${project.basedir}" />
<arg value="--debug" />
</exec>
</target>
<target name="phpunit-doc"
description="Run test suite with coverage"
>
<exec executable="${toolsdir}/phpunit" passthru="true">
<arg value="-c" />
<arg path="${project.basedir}" />
<arg value="--coverage-clover=${project.basedir}/build/coverage/coverage.clover" />
<arg value="--coverage-html=${project.basedir}/build/docs" />
</exec>
</target>
<target name="phpcs"
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing."
>
<exec executable="${toolsdir}/phpcs" output="/dev/null">
<arg value="--standard=PSR1,PSR2" />
<arg value="--extensions=php" />
<arg path="${project.basedir}/src" />
<arg path="${project.basedir}/tests" />
</exec>
</target>
<target name="phpcs-ci"
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing."
depends="prepare"
>
<exec executable="${toolsdir}/phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${builddir}/logs/checkstyle.xml" />
<arg value="--standard=PSR1,PSR2" />
<arg value="--extensions=php" />
<arg path="${project.basedir}/src" />
</exec>
</target>
<target name="phpcbf"
description="Fix coding standard violations using PHP_CodeSniffer. Intended for usage on the command line before committing."
>
<exec command="${toolsdir}/phpcbf ./src ./tests --standard=PSR1,PSR2 -n" passthru="true">
</exec>
</target>
<target name="phpmd">
<exec command="${toolsdir}/phpmd src/ text build/phpmd.xml" passthru="true">
</exec>
</target>
</project>