forked from Andrewsville/PHP-Token-Reflection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
117 lines (103 loc) · 3.84 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
113
114
115
116
117
<?xml version="1.0" encoding="UTF-8"?>
<project name="TokenReflection" default="build" basedir=".">
<property name="sourcedir" value="${basedir}/TokenReflection" />
<property name="testsdir" value="${basedir}/tests" />
<property name="builddir" value="${basedir}/build" />
<condition property="executableExtension" value=".bat" else="">
<os family="windows" />
</condition>
<target name="build" depends="prepare,phplint,pdepend,phpmd,phpcpd,phploc,phpcs,apigen,phpunit,phpcb" />
<target name="clean" description="Clean build artifacts">
<delete dir="${builddir}/api" />
<delete dir="${builddir}/code-browser" />
<delete dir="${builddir}/coverage" />
<delete dir="${builddir}/logs" />
<delete dir="${builddir}/pdepend" />
</target>
<target name="prepare" description="Prepare build" depends="clean">
<mkdir dir="${builddir}/api" />
<mkdir dir="${builddir}/code-browser" />
<mkdir dir="${builddir}/coverage" />
<mkdir dir="${builddir}/logs" />
<mkdir dir="${builddir}/pdepend" />
</target>
<target name="phplint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${sourcedir}" />
<fileset dir="${testsdir}">
<exclude name="data/**" />
</fileset>
</apply>
</target>
<target name="pdepend" description="Calculate software metrics using PHP_Depend">
<exec executable="pdepend${executableExtension}">
<arg value="--jdepend-xml=${builddir}/logs/jdepend.xml" />
<arg value="--jdepend-chart=${builddir}/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${builddir}/pdepend/overview-pyramid.svg" />
<arg path="${sourcedir}" />
</exec>
</target>
<target name="phpmd" description="Perform project mess detection using PHPMD">
<exec executable="phpmd${executableExtension}">
<arg path="${sourcedir}" />
<arg value="xml" />
<arg path="${builddir}/phpmd.xml" />
<arg value="--reportfile" />
<arg path="${builddir}/logs/pmd.xml" />
</exec>
</target>
<target name="phpcpd" description="Find duplicate code using PHPCPD">
<exec executable="phpcpd${executableExtension}">
<arg value="--log-pmd" />
<arg path="${builddir}/logs/pmd-cpd.xml" />
<arg path="${sourcedir}" />
</exec>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc${executableExtension}">
<arg value="--log-csv" />
<arg path="${builddir}/logs/phploc.csv" />
<arg path="${sourcedir}" />
</exec>
</target>
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer">
<exec executable="phpcs${executableExtension}">
<arg value="--standard=${builddir}/phpcs.xml" />
<arg value="--tab-width=4" />
<arg value="--encoding=utf-8" />
<arg value="--report=checkstyle" />
<arg value="--report-file=${builddir}/logs/checkstyle.xml" />
<arg path="${sourcedir}" />
</exec>
</target>
<target name="apigen" description="Generate API documentation using ApiGen">
<exec executable="apigen${executableExtension}">
<arg value="--source" />
<arg path="${sourcedir}" />
<arg value="--destination" />
<arg path="${builddir}/api" />
<arg value="--report" />
<arg path="${builddir}/logs/documentation.xml" />
<arg value="--deprecated" />
<arg value="--todo" />
<arg value="--progressbar=no" />
</exec>
</target>
<target name="phpunit" description="Run unit tests using PHPUnit">
<exec executable="phpunit${executableExtension}" failonerror="true">
<arg value="--configuration" />
<arg path="${builddir}/phpunit.xml" />
</exec>
</target>
<target name="phpcb" description="Aggregate tool output using PHP_CodeBrowser">
<exec executable="phpcb${executableExtension}">
<arg value="--log" />
<arg path="${builddir}/logs" />
<arg value="--source" />
<arg path="${sourcedir}" />
<arg value="--output" />
<arg path="${builddir}/code-browser" />
</exec>
</target>
</project>