-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
124 lines (105 loc) · 4.41 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
<project name="mongo-filters" default="build" basedir=".">
<target name="clean-build" description="Cleanup build artifacts">
<delete dir="${project.basedir}/build" />
<delete dir="${project.basedir}/build/api" />
<delete dir="${project.basedir}/build/code-browser" />
<delete dir="${project.basedir}/build/coverage" />
<delete dir="${project.basedir}/build/logs" />
<delete dir="${project.basedir}/build/pdepend" />
<delete dir="${project.basedir}/build/phpdoc" />
</target>
<target name="prepare-build" depends="clean-build" description="Prepare for build">
<mkdir dir="${project.basedir}/build" />
<mkdir dir="${project.basedir}/build/api" />
<mkdir dir="${project.basedir}/build/code-browser" />
<mkdir dir="${project.basedir}/build/coverage" />
<mkdir dir="${project.basedir}/build/logs" />
<mkdir dir="${project.basedir}/build/pdepend" />
<mkdir dir="${project.basedir}/build/phpdoc" />
</target>
<target name="composer.update-dev">
<exec command="composer update -o --dev --prefer-source"
passthru="true" dir="${project.basedir}" />
</target>
<target name="phpunit">
<exec
command="${project.basedir}/vendor/bin/phpunit --colors --configuration ${project.basedir}/tests/phpunit.xml"
dir="${project.basedir}/tests" passthru="true" />
</target>
<target name="phpunit-ci">
<exec
command="${project.basedir}/vendor/bin/phpunit --colors --configuration ${project.basedir}/tests/phpunit-ci.xml"
dir="${project.basedir}/tests" passthru="true" />
</target>
<target name="build"
depends="prepare-build,composer.update-dev,lint,phploc,pdepend,phpcpd,phpmd-ci,phpcs-ci,phpunit-ci,phpdoc"></target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${project.basedir}/library">
<include name="**/*.php" />
</fileset>
</apply>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<arg value="--log-csv" />
<arg value="${project.basedir}/build/logs/phploc.csv" />
<arg value="${project.basedir}/library" />
</exec>
</target>
<target name="pdepend" description="Calculate software metrics using PHP_Depend">
<exec executable="${project.basedir}/vendor/bin/pdepend">
<arg value="--jdepend-xml=${project.basedir}/build/logs/jdepend.xml" />
<arg
value="--jdepend-chart=${project.basedir}/build/pdepend/dependencies.svg" />
<arg
value="--overview-pyramid=${project.basedir}/build/pdepend/overview-pyramid.svg" />
<arg path="${project.basedir}/library" />
</exec>
</target>
<target name="phpmd"
description="Perform project mess detection using PHPMD and print human readable output. ">
<exec executable="${project.basedir}/vendor/bin/phpmd" passthru="true">
<arg path="${project.basedir}/library" />
<arg value="text" />
<arg value="design,unusedcode" />
</exec>
</target>
<target name="phpmd-ci" description="Perform project mess detection using PHPMD. ">
<exec executable="${project.basedir}/vendor/bin/phpmd">
<arg path="${project.basedir}/library" />
<arg value="xml" />
<arg value="design,unusedcode" />
<arg value="--reportfile" />
<arg value="${project.basedir}/build/logs/pmd.xml" />
</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="${project.basedir}/vendor/bin/phpcs" passthru="true">
<arg value="--standard=PSR2" />
<arg path="${project.basedir}/library" />
</exec>
</target>
<target name="phpcs-ci"
description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="${project.basedir}/vendor/bin/phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${project.basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=PSR2" />
<arg path="${project.basedir}/library" />
</exec>
</target>
<target name="phpcpd" description="Find duplicate code using PHPCPD">
<exec executable="phpcpd">
<arg value="--log-pmd" />
<arg value="${project.basedir}/build/logs/pmd-cpd.xml" />
<arg path="${project.basedir}/library" />
</exec>
</target>
<target name="phpdoc" description="Build PHPdoc">
<exec executable="phpdoc">
</exec>
</target>
</project>