Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 265 lines (225 sloc) 11.329 kB
332a64c @sebastianbergmann Refactor build system.
authored
1 <?xml version="1.0" encoding="UTF-8"?>
a9c55dc @sebastianbergmann Cleanup
authored
2 <project name="phpunit" default="setup">
3 <target name="setup" depends="clean,composer"/>
4
5 <target name="clean" description="Cleanup build artifacts">
6 <delete dir="${basedir}/bin"/>
7 <delete dir="${basedir}/vendor"/>
8 <delete file="${basedir}/composer.lock"/>
9 <delete dir="${basedir}/build/phar"/>
10 <delete>
11 <fileset dir="${basedir}/build">
12 <include name="**/*.phar" />
13 <include name="**/*.phar.asc" />
14 </fileset>
15 </delete>
16 </target>
17
18 <target name="composer" description="Install dependencies with Composer">
19 <tstamp>
20 <format property="thirty.days.ago" pattern="MM/dd/yyyy hh:mm aa" offset="-30" unit="day"/>
21 </tstamp>
22 <delete>
23 <fileset dir="${basedir}">
24 <include name="composer.phar" />
25 <date datetime="${thirty.days.ago}" when="before"/>
26 </fileset>
27 </delete>
28
29 <get src="https://getcomposer.org/composer.phar" dest="${basedir}/composer.phar" skipexisting="true"/>
30
31 <exec executable="php">
32 <arg value="composer.phar"/>
33 <arg value="install"/>
34 </exec>
35 </target>
36
37 <target name="signed-phar"
38 description="Create signed PHAR archive of PHPUnit and all its dependencies (release)"
39 depends="phar">
40 <exec executable="bash" outputproperty="version">
41 <arg value="-c" />
42 <arg value="${basedir}/phpunit --version | awk 'BEGIN { ORS = &quot;&quot;; } {print $2}'" />
43 </exec>
44
45 <exec executable="gpg" failonerror="true">
46 <arg value="--armor" />
47 <arg value="--detach-sign" />
48 <arg path="${basedir}/build/phpunit-${version}.phar" />
49 </exec>
50 </target>
51
52 <target name="phar"
53 description="Create PHAR archive of PHPUnit and all its dependencies (release)"
54 depends="phar-prepare">
55 <exec executable="bash" outputproperty="version">
56 <arg value="-c" />
57 <arg value="${basedir}/phpunit --version | awk 'BEGIN { ORS = &quot;&quot;; } {print $2}'" />
58 </exec>
59
60 <antcall target="phar-build">
61 <param name="version" value="${version}"/>
62 </antcall>
63 </target>
64
65 <target name="phar-alpha"
66 description="Create PHAR archive of PHPUnit and all its dependencies (alpha)"
67 depends="phar-prepare">
68 <antcall target="phar-build">
69 <param name="version" value="alpha"/>
70 </antcall>
71 </target>
72
73 <target name="phar-beta"
74 description="Create PHAR archive of PHPUnit and all its dependencies (beta)"
75 depends="phar-prepare">
76 <antcall target="phar-build">
77 <param name="version" value="beta"/>
78 </antcall>
79 </target>
80
81 <target name="phar-prepare" depends="clean,composer">
82 <mkdir dir="${basedir}/build/phar"/>
83 <copy file="${basedir}/composer.json" tofile="${basedir}/composer.json.bak"/>
84
85 <exec executable="php">
86 <arg value="composer.phar"/>
87 <arg value="require"/>
88 <arg value="phpunit/dbunit:~1.4"/>
89 <arg value="phpunit/php-invoker:~1.1"/>
90 </exec>
91
92 <move file="${basedir}/composer.json.bak" tofile="${basedir}/composer.json"/>
93
94 <exec executable="${basedir}/build/phar-manifest.php" output="${basedir}/build/phar/manifest.txt"/>
95 <copy todir="${basedir}/build/phar" file="${basedir}/build/ca.pem" />
96
97 <copy file="${basedir}/vendor/phpunit/php-code-coverage/LICENSE" tofile="${basedir}/build/phar/php-code-coverage/LICENSE"/>
98 <copy todir="${basedir}/build/phar/php-code-coverage">
99 <fileset dir="${basedir}/vendor/phpunit/php-code-coverage/src">
100 <include name="**/*" />
101 </fileset>
102 </copy>
103
104 <copy file="${basedir}/vendor/phpunit/php-file-iterator/LICENSE" tofile="${basedir}/build/phar/php-file-iterator/LICENSE"/>
105 <copy todir="${basedir}/build/phar/php-file-iterator">
106 <fileset dir="${basedir}/vendor/phpunit/php-file-iterator/src">
107 <include name="**/*.php" />
108 </fileset>
109 </copy>
110
111 <copy file="${basedir}/vendor/phpunit/php-text-template/LICENSE" tofile="${basedir}/build/phar/php-text-template/LICENSE"/>
112 <copy todir="${basedir}/build/phar/php-text-template">
692db16 @sebastianbergmann Sync with https://github.com/sebastianbergmann/php-text-template/comm…
authored
113 <fileset dir="${basedir}/vendor/phpunit/php-text-template/src">
a9c55dc @sebastianbergmann Cleanup
authored
114 <include name="**/*.php" />
115 </fileset>
116 </copy>
117
118 <copy file="${basedir}/vendor/phpunit/php-timer/LICENSE" tofile="${basedir}/build/phar/php-timer/LICENSE"/>
119 <copy todir="${basedir}/build/phar/php-timer">
120 <fileset dir="${basedir}/vendor/phpunit/php-timer/src">
121 <include name="**/*.php" />
122 </fileset>
123 </copy>
124
125 <copy file="${basedir}/vendor/phpunit/php-token-stream/LICENSE" tofile="${basedir}/build/phar/php-token-stream/LICENSE"/>
126 <copy todir="${basedir}/build/phar/php-token-stream">
127 <fileset dir="${basedir}/vendor/phpunit/php-token-stream/src">
128 <include name="**/*.php" />
129 </fileset>
130 </copy>
131
132 <copy file="${basedir}/vendor/phpunit/phpunit-mock-objects/LICENSE" tofile="${basedir}/build/phar/phpunit-mock-objects/LICENSE"/>
133 <copy todir="${basedir}/build/phar/phpunit-mock-objects">
134 <fileset dir="${basedir}/vendor/phpunit/phpunit-mock-objects/src">
135 <include name="**/*" />
136 </fileset>
137 </copy>
138
139 <copy file="${basedir}/vendor/sebastian/comparator/LICENSE" tofile="${basedir}/build/phar/sebastian-comparator/LICENSE"/>
140 <copy todir="${basedir}/build/phar/sebastian-comparator">
141 <fileset dir="${basedir}/vendor/sebastian/comparator/src">
142 <include name="**/*.php" />
143 </fileset>
144 </copy>
145
146 <copy file="${basedir}/vendor/sebastian/diff/LICENSE" tofile="${basedir}/build/phar/sebastian-diff/LICENSE"/>
147 <copy todir="${basedir}/build/phar/sebastian-diff">
148 <fileset dir="${basedir}/vendor/sebastian/diff/src">
149 <include name="**/*.php" />
150 </fileset>
151 </copy>
152
153 <copy file="${basedir}/vendor/sebastian/environment/LICENSE" tofile="${basedir}/build/phar/sebastian-environment/LICENSE"/>
154 <copy todir="${basedir}/build/phar/sebastian-environment">
155 <fileset dir="${basedir}/vendor/sebastian/environment/src">
156 <include name="**/*.php" />
157 </fileset>
158 </copy>
159
160 <copy file="${basedir}/vendor/sebastian/exporter/LICENSE" tofile="${basedir}/build/phar/sebastian-exporter/LICENSE"/>
161 <copy todir="${basedir}/build/phar/sebastian-exporter">
162 <fileset dir="${basedir}/vendor/sebastian/exporter/src">
163 <include name="**/*.php" />
164 </fileset>
165 </copy>
166
167 <copy file="${basedir}/vendor/sebastian/recursion-context/LICENSE" tofile="${basedir}/build/phar/sebastian-recursion-context/LICENSE"/>
168 <copy todir="${basedir}/build/phar/sebastian-recursion-context">
169 <fileset dir="${basedir}/vendor/sebastian/recursion-context/src">
170 <include name="**/*.php" />
171 </fileset>
172 </copy>
173
174 <copy file="${basedir}/vendor/sebastian/global-state/LICENSE" tofile="${basedir}/build/phar/sebastian-global-state/LICENSE"/>
175 <copy todir="${basedir}/build/phar/sebastian-global-state">
176 <fileset dir="${basedir}/vendor/sebastian/global-state/src">
177 <include name="**/*.php" />
178 </fileset>
179 </copy>
180
181 <copy file="${basedir}/vendor/sebastian/version/LICENSE" tofile="${basedir}/build/phar/sebastian-version/LICENSE"/>
182 <copy todir="${basedir}/build/phar/sebastian-version">
183 <fileset dir="${basedir}/vendor/sebastian/version/src">
184 <include name="**/*.php" />
185 </fileset>
186 </copy>
187
188 <copy file="${basedir}/vendor/doctrine/instantiator/LICENSE" tofile="${basedir}/build/phar/doctrine-instantiator/LICENSE"/>
189 <copy todir="${basedir}/build/phar/doctrine-instantiator">
190 <fileset dir="${basedir}/vendor/doctrine/instantiator/src">
191 <include name="**/*.php" />
192 </fileset>
193 </copy>
194
195 <copy file="${basedir}/vendor/symfony/yaml/LICENSE" tofile="${basedir}/build/phar/symfony/LICENSE"/>
196 <copy todir="${basedir}/build/phar/symfony">
197 <fileset dir="${basedir}/vendor/symfony">
198 <include name="**/*.php" />
199 <exclude name="**/Tests/**" />
200 </fileset>
201 </copy>
202
203 <copy todir="${basedir}/build/phar/dbunit">
204 <fileset dir="${basedir}/vendor/phpunit/dbunit/PHPUnit">
205 <include name="**/*.php" />
206 <exclude name="**/Autoload.*" />
207 </fileset>
208 </copy>
209
210 <copy todir="${basedir}/build/phar/php-invoker">
1c3c819 @sebastianbergmann Sync with https://github.com/sebastianbergmann/php-invoker/commit/860…
authored
211 <fileset dir="${basedir}/vendor/phpunit/php-invoker/src">
a9c55dc @sebastianbergmann Cleanup
authored
212 <include name="**/*.php" />
213 </fileset>
214 </copy>
215
216 <copy file="${basedir}/vendor/phpdocumentor/reflection-docblock/LICENSE" tofile="${basedir}/build/phar/phpdocumentor-reflection-docblock/LICENSE"/>
217 <copy todir="${basedir}/build/phar/phpdocumentor-reflection-docblock">
218 <fileset dir="${basedir}/vendor/phpdocumentor/reflection-docblock/src">
219 <include name="**/*.php" />
220 </fileset>
221 </copy>
222
223 <copy file="${basedir}/vendor/phpspec/prophecy/LICENSE" tofile="${basedir}/build/phar/phpspec-prophecy/LICENSE"/>
224 <copy todir="${basedir}/build/phar/phpspec-prophecy">
225 <fileset dir="${basedir}/vendor/phpspec/prophecy/src">
aefd452 @sebastianbergmann Closes #1780
authored
226 <include name="**/*.php" />
227 </fileset>
228 </copy>
229
230 <copy file="${basedir}/vendor/myclabs/deep-copy/LICENSE" tofile="${basedir}/build/phar/myclabs-deep-copy/LICENSE"/>
231 <copy todir="${basedir}/build/phar/myclabs-deep-copy">
232 <fileset dir="${basedir}/vendor/myclabs/deep-copy/src">
a9c55dc @sebastianbergmann Cleanup
authored
233 <include name="**/*.php" />
234 </fileset>
235 </copy>
236 </target>
237
238 <target name="phar-build">
239 <copy todir="${basedir}/build/phar/phpunit">
240 <fileset dir="${basedir}/src">
241 <include name="**/*.php" />
242 <include name="**/*.tpl*" />
243 </fileset>
244 </copy>
245
246 <exec executable="${basedir}/build/phar-version.php" outputproperty="_version">
247 <arg value="${version}" />
248 </exec>
249
250 <exec executable="phpab">
251 <arg value="--all" />
252 <arg value="--static" />
253 <arg value="--phar" />
254 <arg value="--output" />
255 <arg path="${basedir}/build/phpunit-${_version}.phar" />
256 <arg value="--template" />
257 <arg path="${basedir}/build/phar-autoload.php.in" />
258 <arg path="${basedir}/build/phar" />
259 </exec>
260
261 <chmod file="${basedir}/build/phpunit-${_version}.phar" perm="ugo+rx"/>
262 </target>
4397e73 @sebastianbergmann Add build script.
authored
263 </project>
0528e8a @sebastianbergmann Fix PHAR build (after removal of PEAR references)
authored
264
Something went wrong with that request. Please try again.