blob: c3ba4042a278f3dee9fac5c532c67af807aaa729 [file] [log] [blame]
mwenza3bacde2010-07-07 14:11:25 +00001<?xml version="1.0" encoding="UTF-8" ?>
2<!--
3Copyright (c) 2010 SAP AG.
4All rights reserved. This program and the accompanying materials
5are made available under the terms of the Eclipse Public License v1.0
6which accompanies this distribution, and is available at
7http://www.eclipse.org/legal/epl-v10.html
8
9Contributors:
10 Cloudsmith Inc - build.xml for Buckminster project
11 Martin Taal - changes for Teneo
12 Michael Wenz - changes Graphiti
13
14The Teneo build.xml was used as a template for creating this file:
15http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf.teneo/releng/org.eclipse.emf.teneo.releng.buckminster/build.xml?root=Modeling_Project&view=log
16
17Some important parts have been copied from Buckminster's own build setup:
18http://dev.eclipse.org/viewsvn/index.cgi/trunk/org.eclipse.buckminster.releng/build.xml?root=Tools_BUCKMINSTER&view=markup
19-->
20
21<project default="build.and.test" name="Graphiti Build and Test Run">
22 <!-- load properties and set timestamp for the build -->
23 <property environment="env" />
24
25 <tstamp>
26 <format property="buildTimestamp" pattern="yyyyMMddHHmm" />
27 </tstamp>
28
29 <property file="buckminster.properties" />
30
31 <condition property="hudsonWorkSpacePath" value="${env.WORKSPACE}" else="${basedir}/../">
32 <isset property="env.WORKSPACE" />
33 </condition>
34
35 <condition property="graphiti.update.site.type" value="${env.GRAPHITI_UPDATE_SITE_TYPE}" else="interim">
36 <isset property="env.GRAPHITI_UPDATE_SITE_TYPE" />
37 </condition>
38
39 <condition property="site.pack200" value="${env.SITE_PACK200}" else="false">
40 <isset property="env.SITE_PACK200" />
41 </condition>
42
43 <condition property="site.signing" value="${env.SITE_SIGNING}" else="false">
44 <isset property="env.SITE_SIGNING" />
45 </condition>
46
47 <condition property="buckminster.loglevel" value="${env.BUCKMINSTER_LOGLEVEL}" else="info">
48 <isset property="env.BUCKMINSTER_LOGLEVEL" />
49 </condition>
50
51 <!-- Is used in buck.minster also -->
52 <condition property="build.type" value="${env.BUILDTYPE}" else="N">
53 <isset property="env.BUILDTYPE" />
54 </condition>
55
56 <condition property="graphiti.version" value="${env.VERSION}" else="0.7.0">
57 <isset property="env.VERSION" />
58 </condition>
59
60 <condition property="clean.tools" value="true">
61 <equals arg1="${env.CLEAN_TOOLS}" arg2="true" />
62 </condition>
63
64 <property name="buildsPath" location="${hudsonWorkSpacePath}/build" />
65
66 <!--property name="rootPath" location="${buildsPath}/${build.type}${buildTimestamp}"/-->
67 <property name="rootPath" location="${buildsPath}" />
68
69 <property name="buildRoot" location="${rootPath}/build" />
70 <property name="testRoot" location="${rootPath}/test" />
71 <property name="toolsPath" location="${rootPath}/tools" />
72 <property name="buildSitePath" location="${rootPath}/result/p2site" />
73 <property name="buildZipsPath" location="${rootPath}/result/zips" />
74 <property name="testResultsPath" location="${rootPath}/result/test" />
75
76 <property name="promoteUpdateSite" location="${graphiti.download.area}/updates/${graphiti.update.site.type}" />
77 <property name="promoteDropsLocation" location="${graphiti.download.area}/downloads/drops" />
78
79 <property name="buckminster.output.root" location="${rootPath}/output" />
80 <property name="buckminster.temp.root" location="${rootPath}/temp" />
81
82 <import file="ant_common.xml" />
83
84 <target name="build.and.test" depends="init, init.checks, install.buckminster">
85 <echo message=""/>
86 <echo message="=========================================================================================="/>
87 <echo message="Building" />
88 <ant dir="${basedir}/build" antfile="graphiti_build.xml" target="run" inheritRefs="true" />
89
90 <echo message=""/>
91 <echo message="=========================================================================================="/>
92 <echo message="Testing" />
93 <ant dir="${basedir}/test" antfile="graphiti_test.xml" target="run" inheritRefs="true" />
94 </target>
95
96 <target name="promote" depends="init.build.properties">
97 <echo message="Promoting build update site" />
98 <echo message="from ${buildSitePath}" />
99 <echo message="to ${promoteUpdateSite}" />
100
101 <delete dir="${promoteUpdateSite}" />
102 <mkdir dir="${promoteUpdateSite}"/>
103 <mkdir dir="${promoteUpdateSite}/plugins"/>
104 <mkdir dir="${promoteUpdateSite}/features"/>
105
106 <copy todir="${promoteUpdateSite}">
107 <fileset dir="${buildSitePath}">
108 <include name="**/*" />
109 <include name="**" />
110 </fileset>
111 </copy>
112
113 <mkdir dir="${promoteDropsLocation}"/>
114 <mkdir dir="${promoteDropsLocation}/${graphiti.version}"/>
115 <mkdir dir="${promoteDropsLocation}/${graphiti.version}/${build.type}${buildTimestamp}"/>
116 <copy todir="${promoteDropsLocation}/${graphiti.version}/${build.type}${buildTimestamp}">
117 <fileset dir="${buildZipsPath}">
118 <include name="*.zip" />
119 </fileset>
120 </copy>
121 </target>
122
123 <target name="clean.all">
124 <echo message="Removing previous build" />
125 <delete dir="${buildsPath}" quiet="true" />
126 </target>
127
128 <target name="init.clean.tools" if="clean.tools">
129 <delete dir="${toolsPath}" failonerror="true" quiet="true" />
130 </target>
131
132 <target name="init.checks" depends="init.clean.tools">
133 <available file="${toolsPath}/director/director" property="director.exists" />
134 <available file="${toolsPath}/buckminster/buckminster" property="buckminster.exists" />
135 </target>
136
137 <target name="init" depends="clean.all">
138
139 <echo message="Creating main directories" />
140 <echo message="rootPath: ${rootPath}" />
141 <echo message="buildRoot: ${buildRoot}" />
142 <echo message="testRoot: ${testRoot}" />
143 <echo message="buildSitePath: ${buildSitePath}" />
144 <echo message="buildZipsPath: ${buildZipsPath}" />
145 <echo message="testResultsPath: ${testResultsPath}" />
146 <mkdir dir="${rootPath}" />
147 <mkdir dir="${buildRoot}" />
148 <mkdir dir="${testRoot}" />
149 <mkdir dir="${toolsPath}" />
150 <mkdir dir="${buildSitePath}" />
151 <mkdir dir="${buildZipsPath}" />
152 <mkdir dir="${testResultsPath}" />
153 <mkdir dir="${testResultsPath}/output" />
154
155 <available file="${tools}/director/director" property="director.exists" />
156 <available file="${tools}/buckminster/buckminster" property="buckminster.exists" />
157
158 </target>
159
160 <target name="get.director" unless="director.exists">
161 <echo message="Fetching headless director application" />
162 <tempfile destdir="${java.io.tmpdir}" prefix="director-" suffix=".zip" property="director.zip" deleteonexit="true" />
163 <get src="${director.url}" dest="${director.zip}" />
164 <mkdir dir="${tools}" />
165 <unzip src="${director.zip}" dest="${toolsPath}" />
166 <delete file="${director.zip}" />
167 </target>
168
169 <target name="install.buckminster" unless="buckminster.exists" depends="get.director">
170 <echo message="Configuring headless buckminster with needed features" />
171 <eclipse.launch app="director">
172 <args>
173 <jvmarg value="-Declipse.p2.mirrors=false" />
174 <!--jvmarg value="-Dorg.eclipse.update.jarprocessor.pack200=${org.eclipse.update.jarprocessor.pack200}" /-->
175 <arg value="-r" />
176 <arg value="${buckminster.p2.site}" />
177 <arg value="-d" />
178 <arg value="${toolsPath}/buckminster" />
179 <arg value="-p" />
180 <arg value="Buckminster" />
181 <arg value="-i" />
182 <arg value="org.eclipse.buckminster.cmdline.product" />
183 <arg value="-i" />
184 <arg value="org.eclipse.buckminster.core.headless.feature.feature.group" />
185 <arg value="-i" />
186 <arg value="org.eclipse.buckminster.pde.headless.feature.feature.group" />
187 <arg value="-i" />
188 <arg value="org.eclipse.buckminster.cvs.headless.feature.feature.group" />
189 <arg value="-i" />
190 <arg value="org.eclipse.buckminster.emma.headless.feature.feature.group" />
191 </args>
192 </eclipse.launch>
193 </target>
194
195 <target name="init.build.properties">
196 <!-- Echo relevant properties to a temporary file so that Buckminster can read them
197 -->
198 <tempfile destdir="${java.io.tmpdir}" prefix="build-" suffix=".properties" deleteonexit="true" property="properties.tmp" />
199 <echoproperties destfile="${properties.tmp}">
200 <!-- We don't want these. basedir in particular will cause problems if passed explicitly -->
201 <propertyset negate="true">
202 <propertyref name="basedir" />
203 <propertyref name="eclipse.home" />
204 <propertyref name="properties.tmp" />
205 <propertyref name="line.separator" />
206 <propertyref name="path.separator" />
207 <propertyref prefix="ant." />
208 <propertyref prefix="file." />
209 <propertyref prefix="java." />
210 <propertyref prefix="sun." />
211 <propertyref prefix="user." />
212 </propertyset>
213 </echoproperties>
214 </target>
215</project>