-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
153 lines (133 loc) · 5.89 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0" encoding="UTF-8"?>
<project name="Koch Framework" default="build" basedir=".">
<property name="sourcedir" value="${basedir}/src" />
<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,phpcb,apigen,phpunit" />
<target name="build-jenkins" depends="prepare,pdepend,phpmd,phpcpd,phploc,phpcs,phpcb,apigen,phpunit" />
<target name="fetch-composer" description="Installing dependencies">
<exec executable="wget" failonerror="true">
<arg value="-nc" />
<arg value="http://getcomposer.org/composer.phar" />
</exec>
</target>
<target name="composer-install" description="Installing dependencies">
<exec executable="php" failonerror="true">
<arg value="${basedir}/bin/composer/composer.phar" />
<arg value="install" />
<arg value="--dev" />
</exec>
</target>
<target name="php-cs-fixer" description="Check CodingStandard with php-cs-fixer">
<exec executable="./bin/fix-codingstyle.sh" />
</target>
<target name="utf8-encoding-check" description="Check UTF-8 encoding of files">
<exec executable="./bin/checkEncodingUTF8.sh">
<arg value="src" />
</exec>
</target>
<target name="clean" description="Cleanup build artifacts">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${builddir}" includes="**/*"/>
</delete>
<delete dir="${basedir}/vendor" quiet="true" />
<delete file="${basedir}/composer.lock"/>
</target>
<target name="prepare" description="Prepare build" depends="clean, composer-install">
<mkdir dir="${builddir}/api" />
<mkdir dir="${builddir}/code-browser" />
<mkdir dir="${builddir}/coverage" />
<mkdir dir="${builddir}/logs" />
<mkdir dir="${builddir}/pdepend" />
<!-- Notes:
- the vendor folder is created by composer
- composer resides in /bin/composer/composer.phar
-->
</target>
<target name="phplint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${sourcedir}" />
</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="Find duplicate code using PHPCPD">
<exec executable="phpmd${executableExtension}">
<arg path="${sourcedir}" />
<arg value="xml" />
<arg path="${basedir}/phpmd.xml" />
<arg value="--reportfile" />
<arg path="${builddir}/logs/pmd.xml" />
</exec>
</target>
<target name="phpcpd" description="Perform project mess detection using PHPMD">
<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=PSR2" />
<arg value="--tab-width=4" />
<arg value="--encoding=utf-8" />
<arg value="--extensions=php" />
<arg value="--report=checkstyle" />
<arg value="--report-file=${builddir}/logs/checkstyle.xml" />
<arg value="--ignore=Cache" />
<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="--undocumented" />
<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="${basedir}/vendor/bin/phpunit${executableExtension}" failonerror="false">
<arg value="--configuration" />
<arg path="${basedir}/tests/phpunit.xml.dist" />
</exec>
</target>
<target name="phpunit-local" description="Run unit tests using PHPUnit">
<exec executable="${basedir}/vendor/bin/phpunit${executableExtension}" failonerror="true">
<arg value="--configuration" />
<arg path="${basedir}/tests/phpunit.xml.local" />
</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>