This repository was archived by the owner on Oct 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
242 lines (202 loc) · 7.53 KB
/
build.xml
File metadata and controls
242 lines (202 loc) · 7.53 KB
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : build.xml
Created on : May 11, 2010, 8:35 PM
Author : fqqdk <fqqdk@freemail.hu>
Description:
The main build file
-->
<project name="phpcmc">
<!--
project header: general targets tasks, macrodefs, imports, etc
MUST NOT have dependencies
MUST NOT have descriptions
MUST have bodies
-->
<condition property="shell.task" value="win-shell" else="exec-shell"><os family="windows" /></condition>
<import file="src/zetsubo/ant/${shell.task}.xml" />
<import file="src/zetsubo/ant/php.xml" />
<target name="unimplemented">
<fail message="Unimplemented target!" />
</target>
<!--
abstract public targets, defining the workflows
they MUST NOT have bodies
they MUST have descriptions
they MAY have multiple dependencies on other abstract targets to define their workflow
they MUST have at most one implementation dependency
the implementor target (if there is one) MUST appear after the ordering (workflow) dependencies
-->
<target name = "prepare"
description = "prepares the project by setting properties, filesets, etc"
depends = "phpcmc.prepare" />
<target name = "clean"
description = "cleans the working directories"
depends = "prepare, phpmc.clean" />
<target name = "unittest"
description = "runs unit level tests"
depends = "prepare, phpunit" />
<target name = "package"
description = "packages the project"
depends = "prepare, pear" />
<target name = "deploy"
description = "deploys package to the repository"
depends = "prepare, pirum-deploy" />
<target name = "release"
description = "releases the project"
depends = "bump, prepare, package, deploy" />
<target name = "document"
description = "generates the API documentation"
depends = "prepare, phpdoc" />
<target name = "checkstyle"
description = "checks for standard violations"
depends = "prepare, phpcs" />
<target name="build" description="runs the build" depends="phpunit" />
<!--
internal targets, defining implementation details of abstract targets
they SHOULD NOT have descriptions
they MUST be prefixed with a unique prefix to create consistent naming
they MAY depend on abstract targets, but those are ordering dependencies so it is discouraged
(workflow dependencies SHOULD be defined among the abstract targets)
they MAY depend on other internal targets to define an internal, implementation specific worflow
internal dependencies MUST appear after any abstract dependency
internal dependencies of a target MUST be in the same namespace
-->
<!-- project specific implementation targets -->
<target name="phpcmc.prepare">
<tstamp prefix="release">
<format property="date" pattern="yyyy-MM-dd" />
<format property="time" pattern="HH:mm:ss" />
</tstamp>
<property file="version.properties" />
<property name="release.version" value="${version.major}.${version.minor}" />
<property name="pirum.repo.dir" value="/opt/pearserver" />
<property name="uriAndOrChannel" value="<channel>pear.meza.hu</channel>" />
<property name="target.dir" value="${basedir}/build" />
<property name="package.dir" value="${target.dir}/package" />
<property name="package.url" value="${package.dir}/phpcmc-${release.version}.tgz" />
<property name="phpcs.standard" value="Angst" />
<property name="phpcpd.min-lines" value="3" />
<property name="phpcpd.min-tokens" value="5" />
<fileset id="php.all" dir = "${basedir}">
<include name="src/**/*.php" />
<include name="tests/**/*.php" />
<include name="*.php" />
</fileset>
<pathconvert property="php.all.arg" refid="php.all" pathsep=" " />
</target>
<target name="phpmc.clean" depends="prepare">
<delete dir="${target.dir}"/>
<mkdir dir="${target.dir}/work" />
<mkdir dir="${target.dir}/logs" />
<mkdir dir="${target.dir}/pirum" />
<mkdir dir="${target.dir}/doc" />
<mkdir dir="${target.dir}/package" />
<mkdir dir="${target.dir}/checkstyle" />
<mkdir dir="${target.dir}/coverage" />
</target>
<target name = "phpunit">
<phpunit config="phpunit.xml" test="tests"/>
</target>
<target name = "phpcs">
<phpcs
standard = "${phpcs.standard}"
outputdir ="build/checkstyle">
<fileset refid="php.all" />
</phpcs>
</target>
<target name = "phpcs-dev" depends = "prepare">
<shell executable="phpcs" failonerror = "true">
<arg value = "--standard=${phpcs.standard}" />
<arg value = "--extensions=php" />
<arg line = "${php.all.arg}" />
</shell>
</target>
<target name = "phpcpd-dev" depends = "prepare">
<shell executable="phpcpd" failonerror = "false">
<arg value = "--min-lines" /><arg value="${phpcpd.min-lines}" />
<arg value = "--min-tokens" /><arg value="${phpcpd.min-tokens}" />
<arg line = "${php.all.arg}" />
</shell>
</target>
<target name="phpdoc" depends = "unimplemented">
<exec dir="${basedir}"
executable="phpdoc"
failonerror="false">
<arg line="-t ${target.dir}/doc/ -o HTML:default:default -d ${basedir}/"/>
</exec>
</target>
<target name = "bump">
<propertyfile file="version.properties">
<entry key="version.minor" operation="+" value="1" default="0" type="int" />
</propertyfile>
</target>
<target name = "explode-pear" depends = "prepare">
<echo message="generating package with version ${release.version}" />
<delete dir="${package.dir}" />
<mkdir dir="${package.dir}" />
<property name="classmap" value="phpcmc.classmap.php" />
<!-- sources -->
<copy todir="${package.dir}">
<fileset dir="${basedir}/src">
<include name="phpcmc/**" />
</fileset>
</copy>
<php file="${basedir}/src/jabbar.php" includepath="${basedir}/src" failonerror="false">
<arg value="-d" /><arg value="auto_prepend_file=${basedir}/bootstrap.php" />
<arg value="--" />
<arg value="${package.dir}" />
<redirector logError = "yes" outputProperty="jabbar.files" />
</php>
<php file="${basedir}/src/phpcmc.php" includepath="${basedir}/src">
<arg value="-d" /><arg value="auto_prepend_file=${basedir}/bootstrap.php" />
<arg value="--" />
<arg value="-fassoc" />
<arg value="-nfilebasename" />
<arg value="-pphpcmc" />
<arg value="${package.dir}/phpcmc" />
<redirector logError = "yes" output = "${package.dir}/${classmap}" />
</php>
<!-- scripts -->
<copy todir="${package.dir}">
<fileset dir="${basedir}/src">
<include name="*.*" />
</fileset>
</copy>
</target>
<target name="package-xml" depends="explode-pear">
<copy tofile="${package.dir}/package.xml" file="${basedir}/jabbar.xml">
<filterchain>
<expandproperties />
</filterchain>
</copy>
</target>
<target name="pear" depends="package-xml">
<pear dir="${package.dir}">
<arg line="package" />
</pear>
</target>
<target name="jabbar-deploy" depends="prepare">
<pear>
<arg line="-v install -f ${package.url}" />
</pear>
</target>
<target name="jabbar-undeploy">
<pear>
<arg line="uninstall pear.meza.hu/phpcmc" />
</pear>
</target>
<target name="pirum-deploy" depends="prepare">
<shell executable="pirum">
<arg value="add" />
<arg value="${pirum.repo.dir}" />
<arg value="${package.dir}/phpcmc-${release.version}.tgz" />
</shell>
</target>
<target name="install-standard">
<mkdir dir="${pear.dir}/PHP/CodeSniffer/Standards/Angst" />
<copy
file = "src/PHP/CodeSniffer/Standards/Angst/AngstCodingStandard.php"
tofile = "${pear.dir}/PHP/CodeSniffer/Standards/Angst/AngstCodingStandard.php" />
</target>
</project>