blob: 5519ddca3d12cc089c54aa0c97de4c2617bd0bc5 [file] [log] [blame]
david_williams49f39c52010-06-08 10:57:04 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!--
david_williams3424cbb2010-09-13 03:16:53 +00003 create final build repo.
4 Eventually may want to "move" this to each component, in "post build" step?
5 See http://aniefer.blogspot.com/2009/08/versioning-p2-slides-from-eclipsecon.html
6 for example of comparator.
david_williams49f39c52010-06-08 10:57:04 +00007-->
david_williamse93df372010-09-13 03:53:24 +00008<project
david_williams7ef7ab62010-09-15 00:15:21 +00009 name="createFinalRepo"
david_williamse93df372010-09-13 03:53:24 +000010 default="build"
11 basedir=".">
david_williamse602f422010-09-13 00:16:52 +000012
david_williams3c47de32010-10-05 06:34:50 +000013 <!-- = = = standard properties pattern = = = -->
14 <!--
david_williams7ef7ab62010-09-15 00:15:21 +000015 Note to be cross-platform, "environment variables" are only
16 appropriate for some variables, e.g. ones we set, since
17 properties are case sensitive, even if the environment variables
18 on your operating system are not, e.g. it will be ${env.Path}
19 not ${env.PATH} on Windows
20 -->
21 <property
22 environment="env"/>
david_williams3c47de32010-10-05 06:34:50 +000023 <!--
david_williams7ef7ab62010-09-15 00:15:21 +000024 Let users override standard properties, if desired. If
25 directory, file, or some properties do not exist, then standard
26 properties will be used.
27 -->
28 <property
29 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
30
david_williams3c47de32010-10-05 06:34:50 +000031 <!-- = = = end standard properties pattern = = = -->
david_williams7ef7ab62010-09-15 00:15:21 +000032
33
34
david_williamse93df372010-09-13 03:53:24 +000035 <fail
36 unless="wtp.builder.home"/>
37 <property
38 file="${wtp.builder.home}/build.properties"/>
david_williamse602f422010-09-13 00:16:52 +000039
david_williams7ef7ab62010-09-15 00:15:21 +000040
david_williams3cf93412010-10-04 04:31:27 +000041 <!-- required to get proper value of branch specific values, for example,
42 baseComparatorRepoDir, since can vary from forward "integration" stream,
43 and "maintenance" branch -->
david_williamse93df372010-09-13 03:53:24 +000044 <property
45 name="keyCfgFile"
46 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
47 <echo
48 level="info"
49 message="keyCfgFile: ${keyCfgFile}"/>
50 <property
51 file="${keyCfgFile}"/>
david_williamse602f422010-09-13 00:16:52 +000052
david_williamse93df372010-09-13 03:53:24 +000053 <fail
54 unless="baseComparatorRepoDir"
55 message="baseComparatorRepoDir must be defined for this ant script"/>
david_williams3c47de32010-10-05 06:34:50 +000056
david_williamsacd369a2010-10-11 13:36:59 +000057 <property name="baseComparatorRepoDirTests" value="${baseComparatorRepoDir}"/>
david_williams3c47de32010-10-05 06:34:50 +000058
59 <!-- if not otherwise set, use these default properties
david_williams7ef7ab62010-09-15 00:15:21 +000060 <property
61 name="repoDownloadBaseURL"
david_williams0594e3d2010-09-15 13:20:42 +000062 value="http://build.eclipse.org/webtools/committers"/> -->
63 <property
david_williamsa9da34a2010-09-17 16:57:46 +000064 name="repoDownloadBaseURL"
65 value=".."/>
david_williams7ef7ab62010-09-15 00:15:21 +000066
david_williamsa9da34a2010-09-17 16:57:46 +000067 <fail
68 unless="env.PROJECT_PROJECTS"/>
69 <fail
70 unless="projectname"/>
71 <property
72 name="labelfile"
73 value="${env.PROJECT_PROJECTS}/${projectname}/workdir/label.properties"/>
74 <available
75 file="${labelfile}"
76 property="labelfileavailable"/>
77 <fail
78 unless="labelfileavailable"/>
79 <property
80 file="${labelfile}"/>
david_williamseb966632010-09-17 06:06:09 +000081
david_williamsa9da34a2010-09-17 16:57:46 +000082
83 <target
david_williamse93df372010-09-13 03:53:24 +000084 name="build"
david_williamsa0ca4372010-10-04 20:15:34 +000085 depends="doMirror,doMirrorTests">
david_williams49f39c52010-06-08 10:57:04 +000086
david_williams3c47de32010-10-05 06:34:50 +000087 <!-- add the new build to the composite -->
88 <!--
david_williamsf445b272010-09-14 02:22:19 +000089 TODO: after promotion, do we need to delete repo's as directories removed? Or just do occasional cleanup,
90 if non-existent child repos are ignored
91 TODO: ok to use absolute file system locations for child repos? (And still access via http, later?
david_williams7ef7ab62010-09-15 00:15:21 +000092-->
david_williams3c47de32010-10-05 06:34:50 +000093 <!--
david_williams7ef7ab62010-09-15 00:15:21 +000094
95 On build machine, URL's to repositories will look similar to following URL:
96
97 http://build.eclipse.org/webtools/committers/wtp-R3.3.0-I/20100914034658/I-3.3.0-20100914034658/repository/
98
99 which we translate as follows
100
101 repoDownloadBaseURL=http://build.eclipse.org/webtools/committers
102
david_williams9983b892010-09-17 10:07:23 +0000103 ${repoDownloadBaseURL}/${projectname}/${timestamp}/${buildLabel}/repository/
david_williams7ef7ab62010-09-15 00:15:21 +0000104
105 repoDownloadBaseURL is machine dependent (will differ from one build machine to another).
106
107 Will be different on "download server", as well.
108
109 -->
110
david_williams3c47de32010-10-05 06:34:50 +0000111 <!-- remember, repoLocation won't exist until later, since it is at the "site", not the
david_williamsa0ca4372010-10-04 20:15:34 +0000112 working directory -->
david_williamsacd369a2010-10-11 13:36:59 +0000113
114 <!-- remember that repos are added to comparator set only when they are promoted to download location -->
david_williamseb966632010-09-17 06:06:09 +0000115 <property
116 name="repoLocation"
david_williams9983b892010-09-17 10:07:23 +0000117 value="${repoDownloadBaseURL}/committers/${projectname}/${timestamp}/${buildLabel}/repository/"/>
david_williamsf445b272010-09-14 02:22:19 +0000118 <echo
david_williamsa0ca4372010-10-04 20:15:34 +0000119 message="${line.separator}
david_williamsacd369a2010-10-11 13:36:59 +0000120 created final build repoository at location:${line.separator}
david_williamsa0ca4372010-10-04 20:15:34 +0000121 ${repoLocation}${line.separator}
david_williamsacd369a2010-10-11 13:36:59 +0000122 "/>
123<!--
david_williamse93df372010-09-13 03:53:24 +0000124 <p2.composite.repository
david_williamsbf7c2732010-09-13 06:50:47 +0000125 destination="file:/${baseComparatorRepoDir}">
david_williamse93df372010-09-13 03:53:24 +0000126 <add>
127 <repository
david_williamseb966632010-09-17 06:06:09 +0000128 location="${repoLocation}"/>
david_williamse93df372010-09-13 03:53:24 +0000129 </add>
130 </p2.composite.repository>
david_williamsacd369a2010-10-11 13:36:59 +0000131-->
david_williamse93df372010-09-13 03:53:24 +0000132 </target>
133 <target
134 name="init">
135 <available
136 file="${baseComparatorRepoDir}"
137 type="dir"
138 property="baseComparatorRepoDirExists"/>
139 </target>
david_williamsbca4b322010-09-13 04:50:34 +0000140 <!-- normally, the "prime repository" should be created from previous release,
141 or similar, but if that hasn't been done, we'll automatically create an empty
david_williams8eeb8622010-09-14 03:07:16 +0000142 composite repo which we've stored away for simplicity.-->
david_williamse93df372010-09-13 03:53:24 +0000143 <target
144 name="primeRepo"
david_williamsbca4b322010-09-13 04:50:34 +0000145 depends="init"
david_williamse93df372010-09-13 03:53:24 +0000146 unless="baseComparatorRepoDirExists">
147 <mkdir
148 dir="${baseComparatorRepoDir}"/>
149 <copy
150 todir="${baseComparatorRepoDir}">
151 <fileset
152 dir="${wtp.builder.home}/emptyRepository/"/>
153 </copy>
david_williams3c47de32010-10-05 06:34:50 +0000154 <!-- could probably just set to true, but we'll use same logic as in init, just in case -->
david_williamsbca4b322010-09-13 04:50:34 +0000155 <available
156 file="${baseComparatorRepoDir}"
157 type="dir"
158 property="baseComparatorRepoDirExists"/>
david_williamse93df372010-09-13 03:53:24 +0000159 </target>
david_williamsacd369a2010-10-11 13:36:59 +0000160 <!-- normally, the "prime repository" should be created from previous release,
161 or similar, but if that hasn't been done, we'll automatically create an empty
162 composite repo which we've stored away for simplicity.-->
163 <target
164 name="primeTestRepo"
165 depends="init"
166 unless="baseComparatorTestRepoDirExists">
167 <mkdir
168 dir="${baseComparatorTestRepoDir}"/>
169 <copy
170 todir="${baseComparatorTestRepoDir}">
171 <fileset
172 dir="${wtp.builder.home}/emptyRepository/"/>
173 </copy>
174 <!-- could probably just set to true, but we'll use same logic as in init, just in case -->
175 <available
176 file="${baseComparatorTestRepoDir}"
177 type="dir"
178 property="baseComparatorTestRepoDirExists"/>
179 </target>
david_williamse93df372010-09-13 03:53:24 +0000180 <target
david_williams0594e3d2010-09-15 13:20:42 +0000181 name="doMirror"
david_williamsa9da34a2010-09-17 16:57:46 +0000182 depends="primeRepo">
david_williamsde688d72010-09-17 18:27:09 +0000183 <property
184 name="destinationDir"
185 value="${buildDirectory}/${buildLabel}/repository"/>
186 <echo
187 message="destinationDir: ${destinationDir}"/>
david_williamse8bb4a82010-09-27 20:58:02 +0000188
david_williamse93df372010-09-13 03:53:24 +0000189 <p2.mirror
david_williams5af61f72010-09-15 02:07:51 +0000190 ignoreErrors="true"
david_williams8eeb8622010-09-14 03:07:16 +0000191 verbose="true"
192 log="${buildDirectory}/${buildLabel}/finalMirrorRepo.log">
david_williamsde688d72010-09-17 18:27:09 +0000193
194
david_williamsa9da34a2010-09-17 16:57:46 +0000195 <destination
196 kind="metadata"
197 location="file:/${destinationDir}"
david_williamse93df372010-09-13 03:53:24 +0000198 name="Web Tools Platform Repository ${buildLabel}"/>
david_williamsa9da34a2010-09-17 16:57:46 +0000199 <destination
200 kind="artifact"
201 location="file:/${destinationDir}"
202 name="Web Tools Platform Repository ${buildLabel}"/>
203
204
david_williamse93df372010-09-13 03:53:24 +0000205 <source>
206 <repository
david_williamsa9da34a2010-09-17 16:57:46 +0000207 location="file:/${buildDirectory}/${buildLabel}/buildrepository/"/>
david_williamse93df372010-09-13 03:53:24 +0000208 </source>
david_williams851c8ee2010-09-17 06:13:45 +0000209
david_williamse93df372010-09-13 03:53:24 +0000210 <comparator
211 comparator="org.eclipse.equinox.p2.repository.tools.jar.comparator"
212 comparatorLog="${buildDirectory}/${buildLabel}/comparator.log">
213 <repository
214 location="file:/${baseComparatorRepoDir}"/>
david_williams1fa62622010-09-15 04:06:10 +0000215 <exclude>
216 <artifact
david_williamsfbc4c372010-09-15 14:44:03 +0000217 id="org.eclipse.jpt.eclipselink.ui"/>
david_williams96297a52010-09-17 15:27:38 +0000218 <artifact
219 id="org.eclipse.jpt.ui"/>
david_williamsa9da34a2010-09-17 16:57:46 +0000220
221 <artifact
222 id="org.eclipse.jst.jsp.core.tests"/>
david_williams1fa62622010-09-15 04:06:10 +0000223 </exclude>
david_williamse93df372010-09-13 03:53:24 +0000224 </comparator>
david_williams3791dfd2010-10-05 02:38:05 +0000225
david_williams3c47de32010-10-05 06:34:50 +0000226 <!--
227 followStrict is sort of a safety measure. All our features should be strict, but in case not,
228 will show up early if not mirrored.
229
230
231 -->
david_williamse93df372010-09-13 03:53:24 +0000232 <slicingoptions
david_williams3c47de32010-10-05 06:34:50 +0000233 followStrict="true"
234 includeNonGreedy="false"
235 includeOptional="false"/>
david_williams3791dfd2010-10-05 02:38:05 +0000236
david_williams3c47de32010-10-05 06:34:50 +0000237 <!--
238 Specify category and let it pull in its features.
239 TODO: would be best to make "property[@name='org.eclipse.equinox.p2.type.category']" part of the query,
240 but a) not sure if/how it will work and b) our names are distinct enough now this suffices.
241 -->
david_williams3424cbb2010-09-13 03:16:53 +0000242
david_williamse93df372010-09-13 03:53:24 +0000243 <iu
david_williamsda951f02010-10-05 06:45:49 +0000244 query="property[@name='org.eclipse.equinox.p2.name' and @value='Web Tools Platform (WTP) ${buildId}']"/>
245
246 <iu
247 query="property[@name='org.eclipse.equinox.p2.name' and @value='Web Tools Platform SDK (WTP SDK) ${buildId}']"/>
david_williams3791dfd2010-10-05 02:38:05 +0000248
david_williamsa0ca4372010-10-04 20:15:34 +0000249 </p2.mirror>
david_williams3c47de32010-10-05 06:34:50 +0000250
251 <!-- create archived repo from contents of 'repository' at this point -->
david_williams062d2f22010-10-04 23:51:53 +0000252 <property
253 name="zippedrepo"
254 value="${build.distribution}-repo-${buildLabel}.zip"/>
david_williamsa0ca4372010-10-04 20:15:34 +0000255 <zip
256 destfile="${buildDirectory}/${buildLabel}/${zippedrepo}"
257 basedir="${buildDirectory}/${buildLabel}/repository"/>
david_williams062d2f22010-10-04 23:51:53 +0000258
david_williamsa0ca4372010-10-04 20:15:34 +0000259 <ant
260 antfile="${wtp.builder.home}/scripts/build/buildutilitiesp2.xml"
261 target="createChecksums">
262 <property
263 name="archiveName"
264 value="${zippedrepo}"/>
265 </ant>
david_williams062d2f22010-10-04 23:51:53 +0000266
david_williamsa0ca4372010-10-04 20:15:34 +0000267 </target>
268 <target
269 name="doMirrorTests"
david_williamsacd369a2010-10-11 13:36:59 +0000270 depends="primeTestRepo">
david_williamsa0ca4372010-10-04 20:15:34 +0000271 <property
272 name="destinationDir"
david_williamsacd369a2010-10-11 13:36:59 +0000273 value="${buildDirectory}/${buildLabel}/unittestrepository"/>
david_williamsa0ca4372010-10-04 20:15:34 +0000274 <echo
275 message="destinationDir: ${destinationDir}"/>
276
277 <p2.mirror
278 ignoreErrors="true"
279 verbose="true"
david_williamsacd369a2010-10-11 13:36:59 +0000280 log="${buildDirectory}/${buildLabel}/finalMirror-unittestrepository.log">
david_williamsa0ca4372010-10-04 20:15:34 +0000281
282
283 <destination
284 kind="metadata"
285 location="file:/${destinationDir}"
286 name="Web Tools Platform Repository ${buildLabel}"/>
287 <destination
288 kind="artifact"
289 location="file:/${destinationDir}"
290 name="Web Tools Platform Repository ${buildLabel}"/>
291
292
293 <source>
294 <repository
295 location="file:/${buildDirectory}/${buildLabel}/buildrepository/"/>
296 </source>
297
298 <comparator
299 comparator="org.eclipse.equinox.p2.repository.tools.jar.comparator"
300 comparatorLog="${buildDirectory}/${buildLabel}/comparator.log">
301 <repository
302 location="file:/${baseComparatorRepoDir}"/>
303 <exclude>
304 <artifact
305 id="org.eclipse.jpt.eclipselink.ui"/>
306 <artifact
307 id="org.eclipse.jpt.ui"/>
david_williamsa0ca4372010-10-04 20:15:34 +0000308 <artifact
309 id="org.eclipse.jst.jsp.core.tests"/>
310 </exclude>
311 </comparator>
312
313 <slicingoptions
david_williams3c47de32010-10-05 06:34:50 +0000314 followStrict="true"
315 includeNonGreedy="false"
316 includeOptional="false"/>
david_williams49f39c52010-06-08 10:57:04 +0000317
david_williams3c47de32010-10-05 06:34:50 +0000318 <!--
319 Specify category and let it pull in its features.
320 -->
david_williamse93df372010-09-13 03:53:24 +0000321 <iu
david_williams3c47de32010-10-05 06:34:50 +0000322 query="property[@name='org.eclipse.equinox.p2.name' and (@value='Web Tools Platform Tests (WTP Tests) ${buildId}')]"/>
323
david_williamsf850edc2010-09-12 02:48:12 +0000324
david_williamse93df372010-09-13 03:53:24 +0000325 </p2.mirror>
david_williams3c47de32010-10-05 06:34:50 +0000326
327 <!-- create archived repo from contents of 'repository' at this point -->
david_williams062d2f22010-10-04 23:51:53 +0000328 <property
329 name="zippedtestsrepo"
330 value="${build.distribution}-and-tests-repo-${buildLabel}.zip"/>
david_williamsa0ca4372010-10-04 20:15:34 +0000331 <zip
david_williamsf8cac6d2010-10-04 22:18:26 +0000332 destfile="${buildDirectory}/${buildLabel}/${zippedtestsrepo}"
david_williamsa0ca4372010-10-04 20:15:34 +0000333 basedir="${buildDirectory}/${buildLabel}/repository"/>
david_williams062d2f22010-10-04 23:51:53 +0000334
david_williamsa0ca4372010-10-04 20:15:34 +0000335 <ant
336 antfile="${wtp.builder.home}/scripts/build/buildutilitiesp2.xml"
337 target="createChecksums">
338 <property
339 name="archiveName"
david_williamsf8cac6d2010-10-04 22:18:26 +0000340 value="${zippedtestsrepo}"/>
david_williamsa0ca4372010-10-04 20:15:34 +0000341 </ant>
david_williams062d2f22010-10-04 23:51:53 +0000342
david_williams3c47de32010-10-05 06:34:50 +0000343
344
david_williamse93df372010-09-13 03:53:24 +0000345 </target>
david_williams3c47de32010-10-05 06:34:50 +0000346
david_williams49f39c52010-06-08 10:57:04 +0000347</project>