This repository has been archived by the owner on Jan 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.xml
145 lines (128 loc) · 6.11 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
<?xml version="1.0" encoding="utf-8"?>
<project name="Quick title Edition" basedir="." default="main">
<property name="builddir" value="build" />
<property name="source" value="." />
<property name="testdir" value="tests" />
<fileset id="php-files" dir="${project.basedir}">
<include name="**/*.php"/>
<exclude name="build/**"/>
<exclude name="tests/**"/>
<exclude name="vendor/**"/>
</fileset>
<!-- ============================================ -->
<!-- (DEFAULT) Target: main -->
<!-- ============================================ -->
<target name="main" description="Start analyzing our application">
<echo msg="Start Build" />
<phingCall target="prepare" />
<!-- <phingCall target="phpunit" /> -->
<phingCall target="pdepend" />
<phingCall target="phpmd" />
<phingCall target="phpcpd" />
<phingCall target="phpdoc" />
<phingCall target="phpcs" />
<phingCall target="phploc" />
<phingCall target="phpcb" />
<echo msg="Finished Build" />
</target>
<!-- ============================================ -->
<!-- (DEFAULT) Target: prepare -->
<!-- ============================================ -->
<target name="prepare" >
<echo msg="Making directory build" />
<delete dir="${builddir}/api" includeemptydirs="true" />
<delete dir="${builddir}/code-browser" includeemptydirs="true" />
<delete dir="${builddir}/coverage" includeemptydirs="true" />
<delete dir="${builddir}/logs" includeemptydirs="true" />
<delete dir="${builddir}/pdepend" includeemptydirs="true" />
<mkdir dir="${builddir}/api"/>
<mkdir dir="${builddir}/api/docblox"/>
<mkdir dir="${builddir}/code-browser"/>
<mkdir dir="${builddir}/coverage"/>
<mkdir dir="${builddir}/logs"/>
<mkdir dir="${builddir}/pdepend"/>
</target>
<!-- ============================================ -->
<!-- Target: Unit test -->
<!-- ============================================ -->
<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<echo msg="Beginning of the tests" />
<exec command="phpunit --bootstrap=${testdir}/bootstrap.php
--configuration ${testdir}/phpunit.xml
--log-junit ${builddir}/logs/junit.xml
--coverage-clover ${builddir}/logs/clover.xml
--coverage-html ${builddir}/coverage/
${testdir}"
/>
</target>
<!-- ============================================ -->
<!-- Target: PHP Depend -->
<!-- ============================================ -->
<target name="pdepend" description="Calculate dependencies of the code base">
<phpdepend>
<fileset refid="php-files"/>
<logger type="jdepend-xml" outfile="${builddir}/logs/jdepend.xml" />
<logger type="jdepend-chart" outfile="${builddir}/pdepend/dependencies.svg" />
<logger type="overview-pyramid" outfile="${builddir}/pdepend/overview-pyramid.svg" />
</phpdepend>
</target>
<!-- ============================================ -->
<!-- Target: PHPMD (Project Mess Detector) -->
<!-- ============================================ -->
<target name="phpmd" description="Generate pmd.xml using PHPMD">
<exec command="phpmd ${source} xml codesize,unusedcode --reportfile ${builddir}/phpmd.xml --exclude travis,tests,build,vendor" escape="false" />
</target>
<!-- ============================================ -->
<!-- Target: PHPCPD (Copy/Paste Detector) -->
<!-- ============================================ -->
<target name="phpcpd" description="Copy/Paste Detection">
<phpcpd>
<fileset refid="php-files"/>
<formatter type="pmd" outfile="${builddir}/logs/pmd-cpd.xml"/>
</phpcpd>
</target>
<!-- ============================================ -->
<!-- Target: PHPCS (PHP Code Sniffer) -->
<!-- ============================================ -->
<target name="phpcs" description="Coding Standards Analysis">
<exec command="../../phpbb/phpBB/vendor/bin/phpcs --standard=../../code_sniffer/ruleset-php-extensions.xml
--report=checkstyle
--report-file=${builddir}/logs/checkstyle.xml
--ignore=travis,tests,build,vendor
--extensions=php
${source}"
escape="false" />
</target>
<!-- ============================================ -->
<!-- Target: PHPDoc -->
<!-- ============================================ -->
<target name="phpdoc">
<phpdoc title="API Documentation" destdir="${builddir}/api/docblox" sourcecode="false" output="HTML:Smarty:PHP">
<fileset dir="${project.basedir}/${source}">
<include name="**/*.php"/>
</fileset>
<projdocfileset dir=".">
<include name="README"/>
<include name="INSTALL"/>
<include name="CHANGELOG"/>
</projdocfileset>
</phpdoc>
</target>
<!-- ============================================ -->
<!-- Target: PHPLoc (PHP Lines of Code) -->
<!-- ============================================ -->
<target name="phploc" description="Generate phploc.csv">
<phploc reportType="csv" reportName="phploc" reportDirectory="${builddir}/logs">
<fileset refid="php-files"/>
</phploc>
</target>
<!-- ============================================ -->
<!-- Target: PHPCB (PHP Code Browser) -->
<!-- ============================================ -->
<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec command="phpcb --log ${builddir}/logs
--ignore travis,tests,build,vendor
--source ${source}
--output ${builddir}/code-browser" />
</target>
</project>