Skip to main content
summaryrefslogtreecommitdiffstats
blob: e1bd81d39be8f7fc621eb845089a964396ca2865 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<%!
/*  Copyright 2008 IBM Corp.  All rights reserved.  This source code is made available under the terms of the Eclipse Public License, v1.0. */
%>
<project default="run">
	<target name="init">

		<echo message="Set compilerArgs = '-enableJavadoc -encoding ISO-8859-1 -warn:-serial,nls,unused,unchecked,raw,discouraged'" />
		<property name="compilerArg" value="-enableJavadoc -encoding ISO-8859-1 -warn:-serial,nls,unused,unchecked,raw,discouraged" />

		<!-- TODO: set correct source and target levels here -->
<c:choose>
<c:when test="$build/@jre = 'J2SE-1.4'">
		<echo message="Set javacSource and javacTarget = 1.4" />
		<property name="javacSource" value="1.4" />
		<property name="javacTarget" value="1.4" />
</c:when>
<c:when test="$build/@jre = 'J2SE-1.5'">
		<echo message="Set javacSource and javacTarget = 1.5" />
		<property name="javacSource" value="1.5" />
		<property name="javacTarget" value="1.5" />
</c:when>
</c:choose>
		<path id="bc">
			<fileset dir="${java.home}/lib">
				<include name="*.jar" />
			</fileset>
		</path>
		<property name="bootclasspath" refid="bc" />

<c:if test="$build/@jre = 'J2SE-1.5'">
		<echo message="Set J2SE-1.5 = ${bootclasspath}" />
		<property name="J2SE-1.5" value="${bootclasspath}" />
		<condition property="bundleBootClasspath" value="${J2SE-1.5}">
			<isset property="J2SE-1.5" />
		</condition>
		<condition property="bundleJavacSource" value="1.5">
			<isset property="J2SE-1.5" />
		</condition>
		<condition property="bundleJavacTarget" value="1.5">
			<isset property="J2SE-1.5" />
		</condition>

</c:if>
		<property name="buildingOSGi" value="true" />
		<property name="collectingFolder" value="eclipse" />
		<property name="archivePrefix" value="eclipse" />

		<!-- Reduce the amount of info in the build log -->
		<property name="javacVerbose" value="false" />

		<property name="buildDirectory" location="${basedir}/../src/eclipse" />
		<property file="${basedir}/repoInfo.properties" />
		<property name="testBase" location="${buildDirectory}/../testing" />
		<available file="${buildDirectory}/label.properties" property="label.properties.exists" />
		<antcall target="create.label.properties" />
		<property file="${buildDirectory}/label.properties" />

		<echo message="buildAll.xml properties:" />
		<echo message="basedir = ${basedir}" />

		<!-- load a value for ${subprojectName}, among other variables, from build.cfg -->
		<property name="buildConfigFile" value="${basedir}/../build.cfg" />
		<available file="${buildConfigFile}" type="file" property="buildConfigIsAvailable" />
		<fail message="Can't load build properties from ${buildConfigFile}" unless="buildConfigIsAvailable" />
		<!-- TODO: set any special build-related properties here by echoing them into ${buildConfigFile}:
		<echo file="${buildConfigFile}" append="true">

# extra properties specific to just this build
propertyName=propertyValue
</echo>	-->

		<property file="${buildConfigFile}" />

		<echo message="buildVer = ${buildVer}" />
		<echo message="subprojectName = ${subprojectName}" />

		<!-- <echo message="Base OS: ${baseos}; Base Window System: ${basews}"/> -->
		<condition property="isWindows">
			<equals arg1="${baseos}.${basews}" arg2="win32.win32" />
		</condition>
		<condition property="isLinuxGTK">
			<equals arg1="${baseos}.${basews}" arg2="linux.gtk" />
		</condition>
		<condition property="isLinuxMotif">
			<equals arg1="${baseos}.${basews}" arg2="linux.motif" />
		</condition>

	</target>

	<target name="create.label.properties" unless="label.properties.exists">
		<mkdir dir="${buildDirectory}" />
		<tstamp />
		<property name="date" value="${DSTAMP}" />
		<property name="time" value="${TSTAMP}" />
		<property name="timestamp" value="${date}${time}" />
		<property name="buildType" value="I" />

		<!--this naming convention used by php scripts on download server-->
		<property name="buildLabel" value="${buildType}${timestamp}" />

		<property name="buildAlias" value="${buildLabel}" />
		<property name="buildId" value="${buildAlias}" />
		<!-- this will make all plugins/features have the same qualifier, regardless of tag in mapfile -->
		<!-- 
		<property name="forceContextQualifier" value="v${timestamp}"/> 
		-->

		<!--store the build label information in a file-->
		<echo file="${buildDirectory}/label.properties" append="true">
		buildType=${buildType}
		</echo>
		<echo file="${buildDirectory}/label.properties" append="true">
		buildId=${buildId}
		</echo>
		<echo file="${buildDirectory}/label.properties" append="true">
		timestamp=${timestamp}
		</echo>
		<echo file="${buildDirectory}/label.properties" append="true">
		buildLabel=${buildLabel}
		</echo>
		<echo file="${buildDirectory}/label.properties" append="true">
		buildAlias=${buildAlias}
		</echo>
		<!-- this will make all plugins/features have the same qualifier, regardless of tag in mapfile -->
		<!--
		<echo file="${buildDirectory}/label.properties" append="true" >
		forceContextQualifier=${forceContextQualifier}
		</echo>
		-->
	</target>

	<target name="run" depends="init">
		<antcall target="buildAll" />
		<antcall target="test" />
		<antcall target="publish" />
		<antcall target="cleanUp" />
	</target>

	<target name="runTestsOnly" depends="init">
		<delete dir="${buildDirectory}" />
		<mkdir dir="${buildDirectory}/${buildLabel}" />
		<copy todir="${buildDirectory}/${buildLabel}">
			<fileset dir="${buildDirectory}/..">
				<include name="**/*.zip" />
			</fileset>
		</copy>
		<antcall target="test" />
		<antcall target="publish" />
		<antcall target="cleanUp" />
	</target>

	<target name="runWithoutTest" depends="init">
		<antcall target="buildAll" />
		<antcall target="publish" />
		<antcall target="cleanUp" />
	</target>

	<target name="buildOnly" depends="init">
		<antcall target="buildAll" />
		<antcall target="cleanUp" />
	</target>

	<target name="buildAll">
		<ant antfile="build.xml" target="main">
			<property name="component" value="builder/sdk" />
		</ant>

		<ant antfile="build.xml" target="main">
			<property name="component" value="builder/runtime" />
		</ant>

		<ant antfile="build.xml" target="main">
			<property name="component" value="builder/examples" />
		</ant>

		<!-- TODO: add other targets if required -->

		<ant antfile="build.xml" target="main">
			<property name="component" value="builder/tests" />
		</ant>

		<!-- doc must be the last execution -->

		<ant antfile="build.xml" target="main">
			<property name="component" value="builder/doc" />
		</ant>

		<!-- TODO: if necessary, you can copy files from the SDK into the runtime or examples zips here  -->
		<!-- for example, see validation/buildAll.xml or cdo/buildAll.xml -->

		<!-- TODO: if necessary, you can remove 3rd party jars used at build time from the zips here -->
		<!-- for example, see cdo's buildAll.xml -->

		<!-- TODO: you can run extra build scripts here, like for building additional zip bundles -->

		<!-- md5 files generation -->
		<exec executable="bash" dir="${buildDirectory}/${buildLabel}">
			<arg line="${basedir}/../org.eclipse.modeling.common.releng/scripts/createZipCheckSum.sh" />
		</exec>
	</target>

	<target name="cleanUp">
		<echo message="** Copying generated zips to drop folder... **" />
		<copy todir="${buildDirectory}/.." failonerror="false" overwrite="true">
			<fileset dir="${buildDirectory}/${buildLabel}" />
		</copy>
	</target>

	<target name="test">

		<property name="test.xml" value="../org.eclipse.releng.basebuilder/plugins/org.eclipse.build.tools/scripts/test.xml" />
		<antcall target="test-win32-local" />
		<antcall target="test-linux-gtk-local" />
		<antcall target="test-linux-motif-local" />
	</target>

	<target name="test-win32-local" if="isWindows">
		<ant antfile="${test.xml}">
			<property name="shell" value="relengbuildwin2.bat" />
			<property name="tester" value="${basedir}/builder/tests/configs/local" />
		</ant>
	</target>

	<target name="test-linux-gtk-local" if="isLinuxGTK">
		<ant antfile="${test.xml}">
			<property name="shell" value="relengbuildgtk.sh" />
			<property name="tester" value="${basedir}/builder/tests/configs/local" />
		</ant>
	</target>

	<target name="test-linux-motif-local" if="isLinuxMotif">
		<ant antfile="${test.xml}">
			<property name="shell" value="relengbuildmotif.sh" />
			<property name="tester" value="${basedir}/builder/tests/configs/local" />
		</ant>
	</target>

	<target name="publish">
		<copy todir="${buildDirectory}/${buildLabel}" overwrite="true">
			<fileset dir="${buildDirectory}/../org.eclipse.modeling.common.releng/staticDropFiles" />
		</copy>
	</target>

</project>

Back to the top