This repository has been archived by the owner on Jun 19, 2021. It is now read-only.
forked from mishin/linuxcounter.new
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·166 lines (151 loc) · 6.59 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
154
155
156
157
158
159
160
161
162
163
164
165
166
<project name="Test" default="build" basedir=".">
<property name="output" location="${basedir}/build"/>
<property name="testdir" location="${basedir}/src/Syw/Front"/>
<target name="build" depends="clean, prepare, paralleltasks, phpunit, apigen, phpdox, phpcb"></target>
<!-- this works -->
<target name="clean" unless="clean.done" description="Cleanup build artifacts">
<delete dir="${output}"/>
<property name="clean.done" value="true"/>
</target>
<!-- this works -->
<target name="prepare" depends="clean" unless="prepare.done" description="Prepare for build">
<mkdir dir="${output}"/>
<mkdir dir="${output}/apigen"/>
<mkdir dir="${output}/phpdox"/>
<mkdir dir="${output}/code-browser"/>
<mkdir dir="${output}/coverage"/>
<mkdir dir="${output}/logs"/>
<mkdir dir="${output}/pdepend"/>
<property name="prepare.done" value="true"/>
</target>
<target name="paralleltasks" depends="prepare" description="Run the tasks in parallel using a maximum of 2 threads.">
<parallel threadCount="2">
<antcall target="lint"/>
<antcall target="pdepend"/>
<antcall target="phpmd"/>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="phploc"/>
</parallel>
</target>
<!-- this works -->
<target name="lint" unless="lint.done" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${testdir}">
<include name="**/*.php" />
<modified />
</fileset>
</apply>
<property name="lint.done" value="true"/>
</target>
<!-- this works -->
<target name="phploc" unless="phploc.done" description="Measure project size using PHPLOC">
<exec executable="phploc" output="/dev/null">
<arg value="--exclude" />
<arg path="${testdir}/Tests" />
<arg value="--exclude" />
<arg path="${testdir}/*/Tests" />
<arg value="--exclude" />
<arg path="${testdir}/*/*/Tests" />
<arg value="--log-csv" />
<arg value="${output}/logs/phploc.csv" />
<arg path="${testdir}" />
</exec>
<property name="phploc.done" value="true"/>
</target>
<!-- this works -->
<target name="pdepend" unless="pdepend.done" description="Calculate software metrics using PHP_Depend">
<exec executable="pdepend" output="/dev/null">
<arg value="--jdepend-xml=${output}/logs/jdepend.xml" />
<arg value="--jdepend-chart=${output}/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${output}/pdepend/overview-pyramid.svg" />
<arg path="${testdir}" />
</exec>
<property name="pdepend.done" value="true"/>
</target>
<!-- this works -->
<target name="phpmd" unless="phpmd.done" description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="phpmd" output="/dev/null">
<arg path="${testdir}/" />
<arg value="xml" />
<arg value="codesize,unusedcode,naming,design" />
<arg value="--reportfile" />
<arg value="${output}/logs/pmd.xml" />
<arg value="--exclude" />
<arg path="Tests" />
</exec>
<property name="phpmd.done" value="true"/>
</target>
<!-- this works -->
<target name="phpcs" unless="phpcs.done"
description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${output}/logs/checkstyle.xml" />
<arg value="--standard=psr2" />
<arg value="--ignore=Tests" />
<arg value="--ignore=autoload.php" />
<arg value="--extensions=php" />
<arg path="${testdir}" />
</exec>
<property name="phpcs.done" value="true"/>
</target>
<!-- this works -->
<target name="phpcpd" unless="phpcpd.done" description="Find duplicate code using PHPCPD">
<exec executable="phpcpd" output="/dev/null">
<arg value="--log-pmd" />
<arg value="${output}/logs/pmd-cpd.xml" />
<arg value="--exclude" />
<arg path="${testdir}/Tests" />
<arg value="--exclude" />
<arg path="${testdir}/*/Tests" />
<arg value="--exclude" />
<arg path="${testdir}/*/*/Tests" />
<arg path="${testdir}" />
</exec>
<property name="phpcpd.done" value="true"/>
</target>
<!-- this DOESNT work! -->
<target name="apigen" unless="apigen.done" description="Generate API documentation using apigen 2">
<exec executable="apigen" output="/dev/null">
<arg value="--source" />
<arg value="${testdir}" />
<arg value="--destination" />
<arg value="${output}/apigen" />
</exec>
<property name="apigen.done" value="true"/>
</target>
<!-- this works -->
<target name="phpunit" unless="phpunit.done" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="false" output="/dev/null">
<arg line="--coverage-clover ${output}/coverage/clover.xml
--coverage-html ${output}/coverage/
-c app"/>
</exec>
<property name="phpunit.done" value="true"/>
</target>
<target name="phpdox"
unless="phpdox.done"
depends="phploc,phpcs,phpmd"
description="Generate project documentation using phpDox">
<exec executable="phpdox" dir="${output}/phpdox" taskname="phpdox" output="/dev/null">
<arg value="--file" />
<arg value="${basedir}/phpdox.xml" />
</exec>
<property name="phpdox.done" value="true"/>
</target>
<target name="phpcb" unless="phpcb.done" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb" output="/dev/null">
<arg value="--log" />
<arg path="${output}/logs" />
<arg value="--ignore" />
<arg path="Tests" />
<arg value="--source" />
<arg path="${testdir}" />
<arg value="--output" />
<arg path="${output}/code-browser" />
</exec>
<property name="phpcb.done" value="true"/>
</target>
</project>