blob: 042c0aac625005d329999e3af5a0120733a957f0 [file] [log] [blame]
mwenzae0eceb2010-07-30 12:25:50 +00001<?xml version="1.0"?>
mwenz18308ab2010-08-02 08:39:48 +00002<project name="Graphiti">
mwenza3bacde2010-07-07 14:11:25 +00003
mwenzae0eceb2010-07-30 12:25:50 +00004 <condition property="properties.file" value="build.properties" else="local.properties">
5 <isset property="server.build" />
6 </condition>
mwenza3bacde2010-07-07 14:11:25 +00007
mwenzae0eceb2010-07-30 12:25:50 +00008 <condition property="mspec.file" value="build.mspec" else="local.mspec">
9 <isset property="server.build" />
10 </condition>
mwenza3bacde2010-07-07 14:11:25 +000011
mwenzae0eceb2010-07-30 12:25:50 +000012 <property file="${properties.file}" />
mwenza3bacde2010-07-07 14:11:25 +000013 <property environment="env" />
14
mwenzae0eceb2010-07-30 12:25:50 +000015 <condition property="build.root" value="${env.WORKSPACE}" else="${basedir}/../build">
mwenza3bacde2010-07-07 14:11:25 +000016 <isset property="env.WORKSPACE" />
17 </condition>
18
mwenzae0eceb2010-07-30 12:25:50 +000019 <condition property="buckminster.loglevel" value="${env.BUCKMINSTER_LOGLEVEL}" else="INFO">
mwenza3bacde2010-07-07 14:11:25 +000020 <isset property="env.BUCKMINSTER_LOGLEVEL" />
21 </condition>
22
mwenza3bacde2010-07-07 14:11:25 +000023 <condition property="clean.tools" value="true">
24 <equals arg1="${env.CLEAN_TOOLS}" arg2="true" />
25 </condition>
26
mwenzae0eceb2010-07-30 12:25:50 +000027 <condition property="clean.tp" value="true">
28 <equals arg1="${env.CLEAN_TP}" arg2="true" />
29 </condition>
mwenza3bacde2010-07-07 14:11:25 +000030
mwenzae0eceb2010-07-30 12:25:50 +000031 <condition property="clean.workspace" value="true">
32 <equals arg1="${env.CLEAN_WORKSPACE}" arg2="true" />
33 </condition>
mwenza3bacde2010-07-07 14:11:25 +000034
mwenzae0eceb2010-07-30 12:25:50 +000035 <condition property="clean.output" value="true">
36 <equals arg1="${env.CLEAN_OUTPUT}" arg2="true" />
37 </condition>
mwenza3bacde2010-07-07 14:11:25 +000038
mwenzae0eceb2010-07-30 12:25:50 +000039 <condition property="build.type" value="${env.BUILD_TYPE}" else="N">
40 <isset property="env.BUILD_TYPE" />
41 </condition>
mwenza3bacde2010-07-07 14:11:25 +000042
mwenzae0eceb2010-07-30 12:25:50 +000043 <condition property="build.nightly" value="true">
44 <equals arg1="${build.type}" arg2="N" />
45 </condition>
mwenza3bacde2010-07-07 14:11:25 +000046
mwenzae0eceb2010-07-30 12:25:50 +000047 <condition property="site.pack200" value="${env.SITE_PACK200}" else="true">
48 <isset property="env.SITE_PACK200" />
49 </condition>
mwenza3bacde2010-07-07 14:11:25 +000050
mwenzae0eceb2010-07-30 12:25:50 +000051 <condition property="site.signing" value="false" else="true">
52 <isset property="build.nightly" />
53 </condition>
mwenza3bacde2010-07-07 14:11:25 +000054
mwenzae0eceb2010-07-30 12:25:50 +000055 <!-- Default properties intended to be overridden by entries in the above property file -->
56 <property name="tools" location="${build.root}/tools" />
57 <property name="result" location="${build.root}/result" />
58 <property name="workspace" location="${result}/workspace" />
59 <property name="targetPlatformPath" location="${result}/tp" />
60 <property name="buckminster.output.root" location="${result}/output" />
61 <property name="buckminster.temp.root" location="${result}/temp" />
62 <property name="site.p2.dir" location="${workspace}/_temp/org.eclipse.graphiti.site_1.0.0-eclipse.feature/site.p2" />
mwenza3bacde2010-07-07 14:11:25 +000063
mwenzae0eceb2010-07-30 12:25:50 +000064 <!-- This macro executes the default application of an eclipse installation
65 that resides in the folder ${buildtools}/@app -->
66 <macrodef name="eclipse.launch">
67 <attribute name="app" />
68 <element name="args" optional="true" />
69 <sequential>
70 <!-- We assume that the eclipse installation is beneath ${buildtools} -->
71 <property name="@{app}.deploy.dir" value="${tools}/@{app}" />
mwenza3bacde2010-07-07 14:11:25 +000072
mwenzae0eceb2010-07-30 12:25:50 +000073 <!-- Find the Eclipse launcher and assing its location to the @{app}.launcher property -->
74 <pathconvert property="@{app}.launcher">
75 <first count="1">
76 <sort>
77 <fileset dir="${@{app}.deploy.dir}/plugins" includes="**/org.eclipse.equinox.launcher_*.jar" />
78 <reverse xmlns="antlib:org.apache.tools.ant.types.resources.comparators">
79 <date />
80 </reverse>
81 </sort>
82 </first>
83 </pathconvert>
mwenza3bacde2010-07-07 14:11:25 +000084
mwenzae0eceb2010-07-30 12:25:50 +000085 <!-- Launch the eclipse application -->
86 <java fork="true" jar="${@{app}.launcher}" dir="${@{app}.deploy.dir}" failonerror="true">
87 <!-- Uncomment to debug <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/> -->
88 <args />
89 </java>
90 </sequential>
91 </macrodef>
mwenza3bacde2010-07-07 14:11:25 +000092
mwenzae0eceb2010-07-30 12:25:50 +000093 <macrodef name="buckminster">
94 <attribute name="command" />
95 <attribute name="workspace" default="${workspace}" />
96 <element name="globargs" optional="true" />
97 <element name="cmdargs" optional="true" />
98 <sequential>
99 <eclipse.launch app="buckminster">
100 <args>
101 <jvmarg value="-Dbugfix.288796=true" />
mwenz66a90742010-08-02 08:48:03 +0000102 <jvmarg value="-Xmx4096m" />
mwenzae0eceb2010-07-30 12:25:50 +0000103 <arg value="-data" />
104 <arg value="@{workspace}" />
105 <arg value="--loglevel" />
106 <arg value="${buckminster.loglevel}" />
107 <arg value="--displaystacktrace" />
108 <globargs />
109 <arg value="@{command}" />
110 <arg value="-P" />
111 <arg value="${properties.tmp}" />
112 <cmdargs />
113 </args>
114 </eclipse.launch>
115 </sequential>
116 </macrodef>
tkaiserf7c1ff12010-08-26 08:55:38 +0000117
118 <macrodef name="buckminsterDirect">
119 <attribute name="workspace" default="${workspace}" />
120 <element name="globargs" optional="true" />
121 <element name="cmdargs" optional="true" />
122 <sequential>
123 <eclipse.launch app="buckminster">
124 <args>
125 <jvmarg value="-Dbugfix.288796=true" />
126 <jvmarg value="-Xmx4096m" />
127 <arg value="-data" />
128 <arg value="@{workspace}" />
129 <arg value="--loglevel" />
130 <arg value="${buckminster.loglevel}" />
131 <arg value="--displaystacktrace" />
132 <globargs />
133 <arg value="-P" />
134 <arg value="${properties.tmp}" />
135 <cmdargs />
136 </args>
137 </eclipse.launch>
138 </sequential>
139 </macrodef>
mwenza3bacde2010-07-07 14:11:25 +0000140
141 <target name="init.clean.tools" if="clean.tools">
mwenzae0eceb2010-07-30 12:25:50 +0000142 <antcall target="clean.tools" />
mwenza3bacde2010-07-07 14:11:25 +0000143 </target>
144
mwenzae0eceb2010-07-30 12:25:50 +0000145 <target name="init.clean.tp" if="clean.tp">
146 <antcall target="clean.tp" />
mwenza3bacde2010-07-07 14:11:25 +0000147 </target>
148
mwenzae0eceb2010-07-30 12:25:50 +0000149 <target name="init.clean.workspace" if="clean.workspace">
150 <antcall target="clean.workspace" />
151 </target>
mwenza3bacde2010-07-07 14:11:25 +0000152
mwenzae0eceb2010-07-30 12:25:50 +0000153 <target name="init.clean.output" if="clean.output">
154 <antcall target="clean.output" />
155 </target>
mwenza3bacde2010-07-07 14:11:25 +0000156
mwenzae0eceb2010-07-30 12:25:50 +0000157 <target name="init.checks" depends="init.clean.tools,init.clean.tp,init.clean.workspace,init.clean.output">
158 <echo message="Sourcing ${properties.file}" />
mwenza3bacde2010-07-07 14:11:25 +0000159 <available file="${tools}/director/director" property="director.exists" />
160 <available file="${tools}/buckminster/buckminster" property="buckminster.exists" />
mwenza3bacde2010-07-07 14:11:25 +0000161 </target>
162
163 <target name="get.director" unless="director.exists">
164 <echo message="Fetching headless director application" />
mwenz66a90742010-08-02 08:48:03 +0000165 <tempfile destdir="${java.io.tmpdir}"
mwenzae0eceb2010-07-30 12:25:50 +0000166 prefix="director-"
167 suffix=".zip"
168 property="director.zip"
169 deleteonexit="true" />
170 <get src="${eclipse.downloads}/${director.path}" dest="${director.zip}" />
mwenza3bacde2010-07-07 14:11:25 +0000171 <mkdir dir="${tools}" />
mwenzae0eceb2010-07-30 12:25:50 +0000172 <unzip src="${director.zip}" dest="${tools}" />
mwenza3bacde2010-07-07 14:11:25 +0000173 <delete file="${director.zip}" />
174 </target>
175
176 <target name="install.buckminster" unless="buckminster.exists" depends="get.director">
177 <echo message="Configuring headless buckminster with needed features" />
178 <eclipse.launch app="director">
179 <args>
180 <jvmarg value="-Declipse.p2.mirrors=false" />
mwenzae0eceb2010-07-30 12:25:50 +0000181 <!--
182 Hudson Ant property: org.eclipse.update.jarprocessor.pack200=/shared/common/ibm-java2-ppc-50/jre/bin
183 <jvmarg value="-Dorg.eclipse.update.jarprocessor.pack200=${org.eclipse.update.jarprocessor.pack200}" />
184 -->
mwenza3bacde2010-07-07 14:11:25 +0000185 <arg value="-r" />
mwenzae0eceb2010-07-30 12:25:50 +0000186 <arg value="${eclipse.downloads}/${bm.headless.path}" />
mwenza3bacde2010-07-07 14:11:25 +0000187 <arg value="-d" />
mwenzae0eceb2010-07-30 12:25:50 +0000188 <arg value="${tools}/buckminster" />
mwenza3bacde2010-07-07 14:11:25 +0000189 <arg value="-p" />
190 <arg value="Buckminster" />
191 <arg value="-i" />
192 <arg value="org.eclipse.buckminster.cmdline.product" />
193 <arg value="-i" />
194 <arg value="org.eclipse.buckminster.core.headless.feature.feature.group" />
195 <arg value="-i" />
196 <arg value="org.eclipse.buckminster.pde.headless.feature.feature.group" />
197 <arg value="-i" />
198 <arg value="org.eclipse.buckminster.cvs.headless.feature.feature.group" />
199 <arg value="-i" />
200 <arg value="org.eclipse.buckminster.emma.headless.feature.feature.group" />
201 </args>
202 </eclipse.launch>
203 </target>
204
mwenzae0eceb2010-07-30 12:25:50 +0000205 <target name="init.workspace" unless="workspace.exists">
206 <mkdir dir="${workspace}" />
207 </target>
208
mwenza3bacde2010-07-07 14:11:25 +0000209 <target name="init.build.properties">
mwenzae0eceb2010-07-30 12:25:50 +0000210 <!-- Echo relevant properties to a temporary file so that Buckminster can read them -->
mwenz66a90742010-08-02 08:48:03 +0000211 <tempfile destdir="${java.io.tmpdir}"
mwenzae0eceb2010-07-30 12:25:50 +0000212 prefix="build-"
213 suffix=".properties"
214 deleteonexit="true"
215 property="properties.tmp" />
216 <echo message="Properties file is: ${properties.tmp}" />
mwenza3bacde2010-07-07 14:11:25 +0000217 <echoproperties destfile="${properties.tmp}">
218 <!-- We don't want these. basedir in particular will cause problems if passed explicitly -->
219 <propertyset negate="true">
220 <propertyref name="basedir" />
221 <propertyref name="eclipse.home" />
222 <propertyref name="properties.tmp" />
223 <propertyref name="line.separator" />
224 <propertyref name="path.separator" />
225 <propertyref prefix="ant." />
226 <propertyref prefix="file." />
227 <propertyref prefix="java." />
228 <propertyref prefix="sun." />
229 <propertyref prefix="user." />
230 </propertyset>
231 </echoproperties>
232 </target>
mwenzae0eceb2010-07-30 12:25:50 +0000233
mwenz8e5b57b2010-08-26 12:38:35 +0000234 <target name="import">
mwenzae0eceb2010-07-30 12:25:50 +0000235 <echo message="Importing projects into workspace ${workspace} and binaries into target platform ${targetPlatformPath}" />
236 <buckminster command="setpref">
237 <cmdargs>
238 <arg value="targetPlatformPath=${targetPlatformPath}" />
239 </cmdargs>
240 </buckminster>
241
242 <buckminster command="import">
243 <cmdargs>
244 <arg value="-P" />
245 <arg value="${basedir}/${properties.file}" />
mwenz9554c632010-08-25 14:14:11 +0000246 <arg value="-B" />
247 <arg value="${result}/Graphiti.bom" />
mwenzae0eceb2010-07-30 12:25:50 +0000248 <arg value="${basedir}/${mspec.file}" />
249 </cmdargs>
250 </buckminster>
251 </target>
252
mwenz8e5b57b2010-08-26 12:38:35 +0000253 <target name="provision" depends="init.checks,init.workspace,install.buckminster,init.build.properties,import">
254 <echo message="Do the provisioning" />
255 </target>
256
mwenzae0eceb2010-07-30 12:25:50 +0000257 <target name="site.p2" depends="provision">
258 <echo message="Building all projects in workspace ${workspace}" />
259 <buckminster command="build">
260 <cmdargs>
261 <arg value="--thorough" />
262 </cmdargs>
263 </buckminster>
264
265 <echo message="Performing org.eclipse.graphiti.site#site.p2" />
266 <buckminster command="perform">
267 <cmdargs>
268 <arg value="org.eclipse.graphiti.site#site.p2" />
269 </cmdargs>
270 </buckminster>
271
272 <echo message="Creating human readable index.html" />
273 <unzip src="${site.p2.dir}/content.jar" dest="${site.p2.dir}" />
274 <xslt style="xsl/content2html.xsl" in="${site.p2.dir}/content.xml" out="${site.p2.dir}/index.html" />
275 <xslt style="xsl/content2xml.xsl" in="${site.p2.dir}/content.xml" out="${site.p2.dir}/index.xml" />
276 <delete file="${site.p2.dir}/content.xml" />
mwenze118d1c2010-08-26 06:55:05 +0000277
278 <echo message="Performing org.eclipse.graphiti.site#site.p2.zip" />
279 <buckminster command="perform">
280 <cmdargs>
281 <arg value="org.eclipse.graphiti.site#site.p2.zip" />
282 </cmdargs>
283 </buckminster>
jpaschb526a472010-09-08 08:47:55 +0000284 </target>
285
286 <target name="create.javadoc" depends="site.p2" description="Generate the JavaDoc for the sources">
287 <echo message="Generate the JavaDoc for the sources"></echo>
288 <echo message="javadoc source ${workspace}" />
289
290 <!-- set targetPlatformPath as classpath -->
291 <path id="files-classpath">
292 <fileset dir="${targetPlatformPath}">
293 <include name="*.jar"/>
294 </fileset>
295 </path>
296
297 <!-- clean and create output location -->
298 <delete dir="${workspace}/plugins/org.eclipse.graphiti.doc/javadoc"/>
299 <mkdir dir="${workspace}/plugins/org.eclipse.graphiti.doc/javadoc"/>
300
301 <!-- generate the javadoc -->
302 <javadoc destdir="${workspace}/plugins/org.eclipse.graphiti.doc/javadoc"
303 classpathref="files-classpath"
304 author="true"
305 version="true"
306 nodeprecated="false"
307 nodeprecatedlist="false"
308 access="public"
309 maxmemory="4096m"
310 useexternalfile="true"
311 sourcepath="src"
312 verbose="true"
313 use="true"
314 noindex="false"
315 nonavbar="false"
316 notree="false"
317 splitindex="true"
318 windowtitle="Graphiti Documentation">
319
320 <!-- Graphiti sources -->
321 <fileset dir="${workspace}/plugins/" defaultexcludes="true">
322 <include name="**/*.java"/>
323 <exclude name="**/internal/**"/>
324 <exclude name="**/tests/**"/>
325 <exclude name="**/examples/**"/>
326 <exclude name="**/testtool/**"/>
327 </fileset>
328 <bottom><![CDATA[ <a href="http://www.eclipse.org/legal/epl-v10.html" shape="rect">Copyright (c) SAP AG 2005, 2010.</a>]]></bottom>
329 </javadoc>
mwenzae0eceb2010-07-30 12:25:50 +0000330 </target>
331
jpaschb526a472010-09-08 08:47:55 +0000332 <target name="test" depends="create.javadoc">
mwenzd32f13b2010-08-12 09:00:02 +0000333 <echo message="Running JUnit tests for Graphiti" />
tkaiserf7c1ff12010-08-26 08:55:38 +0000334 <buckminsterDirect>
mwenzd32f13b2010-08-12 09:00:02 +0000335 <cmdargs>
tkaiser63b2cb52010-08-26 07:42:28 +0000336 <arg value="--script" />
tkaiser8c53a6f2010-08-26 09:16:09 +0000337 <arg value="${basedir}/emma.script" />
mwenzae0eceb2010-07-30 12:25:50 +0000338 </cmdargs>
tkaiserf7c1ff12010-08-26 08:55:38 +0000339 </buckminsterDirect>
mwenzae0eceb2010-07-30 12:25:50 +0000340 </target>
341
mwenzf0034682010-08-26 13:33:54 +0000342 <target name="promote.sites" depends="init.build.properties">
mwenz8e5b57b2010-08-26 12:38:35 +0000343 <echo message="Deleting old update site from downloads area" />
344 <delete dir="${graphiti.download.area}/updates/nightly/" failonerror="true" />
345
346 <echo message="Promoting site.p2" />
347 <copydir dest="${graphiti.download.area}/updates/nightly/" src="${result}/site.p2" />
348
349 <echo message="Deleting old ZIP archive from downloads area" />
350 <delete dir="${graphiti.download.area}/archives/nightly/" failonerror="true" />
351
352 <echo message="Promoting site.p2.zip" />
353 <copydir dest="${graphiti.download.area}/archives/nightly/" src="${result}/site.p2.zip" />
mwenzae0eceb2010-07-30 12:25:50 +0000354 </target>
355
356 <target name="clean.tools">
357 <delete dir="${tools}/director" failonerror="true" quiet="true" />
358 <delete dir="${tools}/buckminster" failonerror="true" quiet="true" />
359 </target>
360
361 <target name="clean.tp">
362 <delete dir="${targetPlatformPath}" failonerror="true" quiet="true" />
363 </target>
364
365 <target name="clean.workspace">
366 <delete dir="${workspace}" failonerror="true" quiet="true" />
367 </target>
368
369 <target name="clean.output">
370 <delete dir="${buckminster.output.root}" failonerror="true" quiet="true" />
371 <delete dir="${buckminster.temp.root}" failonerror="true" quiet="true" />
372 </target>
373
374 <target name="clean.all" depends="clean.tools,clean.workspace,clean.tp,clean.output" />
375
mwenza3bacde2010-07-07 14:11:25 +0000376</project>