blob: b28ae028b898b7d130e99bc8761c9f5641c00749 [file] [log] [blame]
david_williams33f76202010-09-19 04:11:05 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 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.
7-->
8<project
9 name="createFinalRepo"
10 default="build"
11 basedir=".">
12
13 <!-- = = = standard properties pattern = = = -->
14 <!--
15 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"/>
23 <!--
24 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
31 <!-- = = = end standard properties pattern = = = -->
32
33
34
35 <fail
36 unless="wtp.builder.home"/>
37 <property
38 file="${wtp.builder.home}/build.properties"/>
39
40
david_williams9c32af12010-09-26 04:46:26 +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_williams33f76202010-09-19 04:11:05 +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}"/>
52
53 <fail
54 unless="baseComparatorRepoDir"
55 message="baseComparatorRepoDir must be defined for this ant script"/>
56
57
58 <!-- if not otherwise set, use these default properties
59 <property
60 name="repoDownloadBaseURL"
61 value="http://build.eclipse.org/webtools/committers"/> -->
62 <property
63 name="repoDownloadBaseURL"
64 value=".."/>
65
66 <fail
67 unless="env.PROJECT_PROJECTS"/>
68 <fail
69 unless="projectname"/>
70 <property
71 name="labelfile"
72 value="${env.PROJECT_PROJECTS}/${projectname}/workdir/label.properties"/>
73 <available
74 file="${labelfile}"
75 property="labelfileavailable"/>
76 <fail
77 unless="labelfileavailable"/>
78 <property
79 file="${labelfile}"/>
80
81
82 <target
83 name="build"
david_williamsc039dcb2010-10-05 01:44:20 +000084 depends="doMirror,doMirrorTests">
david_williams33f76202010-09-19 04:11:05 +000085
86 <!-- add the new build to the composite -->
87 <!--
88 TODO: after promotion, do we need to delete repo's as directories removed? Or just do occasional cleanup,
89 if non-existent child repos are ignored
90 TODO: ok to use absolute file system locations for child repos? (And still access via http, later?
91-->
92 <!--
93
94 On build machine, URL's to repositories will look similar to following URL:
95
96 http://build.eclipse.org/webtools/committers/wtp-R3.3.0-I/20100914034658/I-3.3.0-20100914034658/repository/
97
98 which we translate as follows
99
100 repoDownloadBaseURL=http://build.eclipse.org/webtools/committers
101
david_williamsbceee742010-09-19 05:43:20 +0000102 ${repoDownloadBaseURL}/${projectname}/${timestamp}/${buildLabel}/repository/
david_williams33f76202010-09-19 04:11:05 +0000103
104 repoDownloadBaseURL is machine dependent (will differ from one build machine to another).
105
106 Will be different on "download server", as well.
107
108 -->
109
david_williamsc039dcb2010-10-05 01:44:20 +0000110 <!-- remember, repoLocation won't exist until later, since it is at the "site", not the
111 working directory -->
david_williams33f76202010-09-19 04:11:05 +0000112 <property
113 name="repoLocation"
david_williamsbceee742010-09-19 05:43:20 +0000114 value="${repoDownloadBaseURL}/committers/${projectname}/${timestamp}/${buildLabel}/repository/"/>
david_williams33f76202010-09-19 04:11:05 +0000115 <echo
david_williamsc039dcb2010-10-05 01:44:20 +0000116 message="${line.separator}
117 adding final build repoository location:${line.separator}
118 ${repoLocation}${line.separator}
119 to composite repo: ${line.separator}
david_williams33f76202010-09-19 04:11:05 +0000120 ${baseComparatorRepoDir}"/>
121
122 <p2.composite.repository
123 destination="file:/${baseComparatorRepoDir}">
124 <add>
125 <repository
126 location="${repoLocation}"/>
127 </add>
128 </p2.composite.repository>
129
130 </target>
131 <target
132 name="init">
133 <available
134 file="${baseComparatorRepoDir}"
135 type="dir"
136 property="baseComparatorRepoDirExists"/>
137 </target>
138 <!-- normally, the "prime repository" should be created from previous release,
139 or similar, but if that hasn't been done, we'll automatically create an empty
140 composite repo which we've stored away for simplicity.-->
141 <target
142 name="primeRepo"
143 depends="init"
144 unless="baseComparatorRepoDirExists">
145 <mkdir
146 dir="${baseComparatorRepoDir}"/>
147 <copy
148 todir="${baseComparatorRepoDir}">
149 <fileset
150 dir="${wtp.builder.home}/emptyRepository/"/>
151 </copy>
152 <!-- could probably just set to true, but we'll use same logic as in init, just in case -->
153 <available
154 file="${baseComparatorRepoDir}"
155 type="dir"
156 property="baseComparatorRepoDirExists"/>
157 </target>
158 <target
159 name="doMirror"
160 depends="primeRepo">
david_williamsbceee742010-09-19 05:43:20 +0000161 <property
162 name="destinationDir"
163 value="${buildDirectory}/${buildLabel}/repository"/>
164 <echo
165 message="destinationDir: ${destinationDir}"/>
166
david_williams33f76202010-09-19 04:11:05 +0000167 <p2.mirror
168 ignoreErrors="true"
169 verbose="true"
170 log="${buildDirectory}/${buildLabel}/finalMirrorRepo.log">
david_williamsbceee742010-09-19 05:43:20 +0000171
172
173 <destination
174 kind="metadata"
175 location="file:/${destinationDir}"
176 name="Web Tools Platform Repository ${buildLabel}"/>
177 <destination
178 kind="artifact"
179 location="file:/${destinationDir}"
david_williams33f76202010-09-19 04:11:05 +0000180 name="Web Tools Platform Repository ${buildLabel}"/>
david_williamsc039dcb2010-10-05 01:44:20 +0000181
182
183 <source>
184 <repository
185 location="file:/${buildDirectory}/${buildLabel}/buildrepository/"/>
186 </source>
187
188 <comparator
189 comparator="org.eclipse.equinox.p2.repository.tools.jar.comparator"
190 comparatorLog="${buildDirectory}/${buildLabel}/comparator.log">
191 <repository
192 location="file:/${baseComparatorRepoDir}"/>
193 <exclude>
194 <artifact
195 id="org.eclipse.jpt.eclipselink.ui"/>
196 <artifact
197 id="org.eclipse.jpt.ui"/>
198
199 <artifact
200 id="org.eclipse.jst.jsp.core.tests"/>
201 </exclude>
202 </comparator>
203<!--
204 <slicingoptions
205 followStrict="true"/>
206 -->
207 <iu
208 id="org.eclipse.wst.jsdt_sdk.feature.feature.group"/>
209
210<!--
211 <iu
212 query="property[@name='org.eclipse.equinox.p2.type.category']"/>
213-->
214 </p2.mirror>
215
216 <!-- create archived repo from contents of 'repository' at this point -->
217 <property
218 name="zippedrepo"
219 value="${build.distribution}-repo-${buildLabel}.zip"/>
220 <zip
221 destfile="${buildDirectory}/${buildLabel}/${zippedrepo}"
222 basedir="${buildDirectory}/${buildLabel}/repository"/>
223
224 <ant
225 antfile="${wtp.builder.home}/scripts/build/buildutilitiesp2.xml"
226 target="createChecksums">
227 <property
228 name="archiveName"
229 value="${zippedrepo}"/>
230 </ant>
231
232 </target>
233 <target
234 name="doMirrorTests"
235 depends="primeRepo">
236 <property
237 name="destinationDir"
238 value="${buildDirectory}/${buildLabel}/repository"/>
239 <echo
240 message="destinationDir: ${destinationDir}"/>
241
242 <p2.mirror
243 ignoreErrors="true"
244 verbose="true"
245 log="${buildDirectory}/${buildLabel}/finalMirrorTestsRepo.log">
246
247
248 <destination
249 kind="metadata"
250 location="file:/${destinationDir}"
251 name="Web Tools Platform Repository ${buildLabel}"/>
252 <destination
253 kind="artifact"
254 location="file:/${destinationDir}"
255 name="Web Tools Platform Repository ${buildLabel}"/>
256
257
david_williams33f76202010-09-19 04:11:05 +0000258 <source>
259 <repository
david_williamsbceee742010-09-19 05:43:20 +0000260 location="file:/${buildDirectory}/${buildLabel}/buildrepository/"/>
david_williams33f76202010-09-19 04:11:05 +0000261 </source>
262
263 <comparator
264 comparator="org.eclipse.equinox.p2.repository.tools.jar.comparator"
265 comparatorLog="${buildDirectory}/${buildLabel}/comparator.log">
266 <repository
267 location="file:/${baseComparatorRepoDir}"/>
268 <exclude>
269 <artifact
270 id="org.eclipse.jpt.eclipselink.ui"/>
271 <artifact
david_williamsbceee742010-09-19 05:43:20 +0000272 id="org.eclipse.jpt.ui"/>
david_williamsbceee742010-09-19 05:43:20 +0000273 <artifact
david_williams586c05f2010-09-19 06:54:10 +0000274 id="org.eclipse.jst.jsp.core.tests"/>
david_williams33f76202010-09-19 04:11:05 +0000275 </exclude>
276 </comparator>
277
278 <slicingoptions
279 followStrict="true"/>
david_williamsc039dcb2010-10-05 01:44:20 +0000280
david_williams33f76202010-09-19 04:11:05 +0000281 <iu
282 id="org.eclipse.wst.jsdt_tests.feature.feature.group"/>
david_williams33f76202010-09-19 04:11:05 +0000283 <iu
david_williams33f76202010-09-19 04:11:05 +0000284 query="property[@name='org.eclipse.equinox.p2.type.category']"/>
285
286 </p2.mirror>
287 </target>
288
289</project>