Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 187d641ad23371497a2952f3cdd77eae83fc2a42 (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
<?xml version="1.0"?>
<project name="project" default="build.site">
	<property name="director.url" value="http://www.eclipse.org/downloads/download.php?file=/tools/buckminster/products/org.eclipse.equinox.p2.director.product_1.4.0.v20110313-0656.zip&amp;r=1" />

	<!--Property file containing overrides for the default properties -->
	<property name="build.root" location="${user.home}/epp.build" />
	<property file="${build.root}/build.properties" />
	<property name="bm.headless.site" value="http://download.eclipse.org/tools/buckminster/headless-3.5/" />
	<property name="simrelease.site" value="http://download.eclipse.org/releases/staging" />
	<property name="buildtools" location="${build.root}/tools" />
	<property name="workspace" location="${build.root}/ws" />
	<property name="targetPlatformPath" location="${build.root}/TP" />
	<property name="cquery.url" location="${basedir}/epp.cquery" />
	<property name="tp.mspec" location="${basedir}/epp-tp.mspec" />

	<!-- This macro executes the default application of an eclipse installation that resides
	     in the folder ${buildtools}/@app
	  -->
	<macrodef name="eclipse.launch">
		<attribute name="app" />
		<element name="args" optional="true" />
		<sequential>
			<!-- We assume that the eclipse installation is beneath ${buildtools} -->
			<property name="@{app}.deploy.dir" value="${buildtools}/@{app}" />

			<!-- Find the Eclipse launcher and assing its location to the @{app}.launcher property -->
			<pathconvert property="@{app}.launcher">
				<first count="1">
					<sort>
						<fileset dir="${@{app}.deploy.dir}/plugins" includes="**/org.eclipse.equinox.launcher_*.jar" />
						<reverse xmlns="antlib:org.apache.tools.ant.types.resources.comparators">
							<date />
						</reverse>
					</sort>
				</first>
			</pathconvert>

			<!-- Launch the eclipse application -->
			<java fork="true" jar="${@{app}.launcher}" dir="${@{app}.deploy.dir}" failonerror="true">
				<!-- Uncomment to debug <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/> -->
				<jvmarg value="-Declipse.p2.mirrors=false" />
				<args />
			</java>
		</sequential>
	</macrodef>

	<!-- Fetch and unzip the director -->
	<available file="${buildtools}/director/director" property="director.exists" />
	<target name="get.director" unless="director.exists">
		<tempfile destdir="${java.io.tmpdir}" prefix="director-" suffix=".zip" property="director.zip" deleteonexit="true" />
		<get src="${director.url}" dest="${director.zip}" />
		<unzip src="${director.zip}" dest="${buildtools}" />
	</target>

	<!-- Configure the Buckminster product with needed features -->
	<target name="install.buckminster" depends="get.director">
		<eclipse.launch app="director">
			<args>
				<arg value="-consoleLog" />
				<arg value="-r" />
				<arg value="${bm.headless.site}" />
				<arg value="-d" />
				<arg value="${buildtools}/buckminster" />
				<arg value="-p" />
				<arg value="Buckminster" />
				<arg value="-i" />
				<arg value="org.eclipse.buckminster.cmdline.product" />
				<arg value="-i" />
				<arg value="org.eclipse.buckminster.core.headless.feature.feature.group" />
				<arg value="-i" />
				<arg value="org.eclipse.buckminster.git.headless.feature.feature.group" />
				<arg value="-i" />
				<arg value="org.eclipse.buckminster.pde.headless.feature.feature.group" />
			</args>
		</eclipse.launch>
	</target>

	<target name="build.tp" depends="install.buckminster">
		<eclipse.launch app="buckminster">
			<args>
				<arg value="-data" />
				<arg value="${workspace}" />
				<arg value="setpref" />
				<arg value="targetPlatformPath=${targetPlatformPath}" />
			</args>
		</eclipse.launch>
		<eclipse.launch app="buckminster">
			<args>
				<jvmarg value="-Dsimrelease.site=${simrelease.site}" />
				<arg value="-data" />
				<arg value="${workspace}" />
				<arg value="import" />
				<arg value="${tp.mspec}" />
			</args>
		</eclipse.launch>
	    <!--
		<copy todir="${targetPlatformPath}/plugins">
			<fileset dir="/home/data/httpd/download.eclipse.org/releases/staging/aggregate/plugins">
				<include name="**/org.eclipse*intro*" />
				<include name="**/org.eclipse*capabilities*" />
			</fileset>
		</copy>
		-->
	</target>

	<target name="build.workspace" depends="build.tp">
		<eclipse.launch app="buckminster">
			<args>
				<jvmarg value="-Dsimrelease.site=${simrelease.site}" />
				<arg value="-data" />
				<arg value="${workspace}" />
				<arg value="import" />
				<arg value="${cquery.url}" />
			</args>
		</eclipse.launch>
	</target>

	<target name="build.site" depends="build.workspace">

		<tstamp>
			<format property="build.id" pattern="yyyyMMdd-HHmm" timezone="GMT" />
		</tstamp>

		<eclipse.launch app="buckminster">
			<args>
				<jvmarg value="-Dqualifier.replacement.*=generator:lastModified" />
				<jvmarg value="-Dgenerator.lastModified.format=yyyyMMdd-HHmm" />
				<jvmarg value="-Dtarget.os=*" />
				<jvmarg value="-Dtarget.ws=*" />
				<jvmarg value="-Dtarget.arch=*" />
				<jvmarg value="-Dbuckminster.output.root=${build.root}/buildresult" />
				<jvmarg value="-Dbuckminster.temp.root=${build.root}/temp" />
				<jvmarg value="-Dbuild.id=${build.id}" />
				<jvmarg value="-Dcbi.include.source=false" />
				<arg value="-data" />
				<arg value="${workspace}" />
				<arg value="build" />
				<arg value="--clean" />
				<arg value="--thorough" />
			</args>
		</eclipse.launch>

		<eclipse.launch app="buckminster">
			<args>
				<jvmarg value="-Dqualifier.replacement.*=generator:lastModified" />
				<jvmarg value="-Dgenerator.lastModified.format=yyyyMMdd-HHmm" />
                <jvmarg value="-Dtarget.os=*" />
                <jvmarg value="-Dtarget.ws=*" />
                <jvmarg value="-Dtarget.arch=*" />
				<jvmarg value="-Dbuckminster.output.root=${build.root}/buildresult" />
				<jvmarg value="-Dbuckminster.temp.root=${build.root}/temp" />
				<jvmarg value="-Dbuild.id=${build.id}" />
				<jvmarg value="-Dcbi.include.source=false" />
                <jvmarg value="-Dsite.pack200=true" />
                <jvmarg value="-Dsite.signing=true" />
                <jvmarg value="-Dstaging.area=/home/data/httpd/download-staging.priv/technology/epp/" />
                <jvmarg value="-Dsigning.type=eclipse.local" />
				<arg value="-data" />
				<arg value="${workspace}" />
				<arg value="perform" />
				<arg value="org.eclipse.epp.allpackages.feature#site.p2.zip" />
			</args>
		</eclipse.launch>

	</target>
	
	<!-- ================================= 
          target: archiveArtifacts              
         ================================= -->
    <target name="archiveArtifacts" description="Copy artifacts to central location.">
		<copy todir="${env.WORKSPACE}/repositories/${env.BUILD_NUMBER}" preservelastmodified="true" verbose="true">
			<fileset dir="${build.root}/buildresult/org.eclipse.epp.allpackages.feature_4.4.0-eclipse.feature/site.p2/**" />
		</copy>
    </target>

	

	<target name="clean.all" depends="clean.buckminster,clean.workspace,clean.build,clean.tp">
		<delete dir="${buildtools}/director" />
	</target>

	<target name="clean.workspace">
		<delete dir="${workspace}" />
	</target>

	<target name="clean.build">
		<delete dir="${build.root}/buildresult" />
	</target>

	<target name="clean.tp">
		<delete dir="${targetPlatformPath}" />
	</target>

	<target name="clean.buckminster">
		<delete dir="${buildtools}/buckminster" />
	</target>
</project>

Back to the top