Skip to main content
summaryrefslogtreecommitdiffstats
blob: 159d183cd76a234fa6544af27b8afcb6181a4bb5 (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
<?xml version="1.0" encoding="UTF-8" ?>
<!-- 
Copyright (c) 2010 Cloudsmith Inc, Martin Taal (Doorn, The Netherlands) and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:
  Cloudsmith Inc - build.xml for Buckminster project
   Martin Taal - changes for Texo

Some important parts have been copied from Buckminster's own
build setup:
http://dev.eclipse.org/viewsvn/index.cgi/trunk/org.eclipse.buckminster.releng/build.xml?root=Tools_BUCKMINSTER&view=markup
-->
<project>

	<!--
	Computes the version qualifier on the basis of the filename of a generated jar file.
	It is difficult to get this information directly from buckminster, therefore
	computing it from a filename. 
	-->
	<macrodef name="computeVersionQualifier">
		<attribute name="directory" />
		<attribute name="pattern" />
		<sequential>

			<path id="versionQualifierFileName.id">
				<fileset dir="@{directory}">
					<include name="@{pattern}" />
				</fileset>
			</path>

			<property name="versionQualifierFileName" refid="versionQualifierFileName.id" />

			<script language="javascript">
				<![CDATA[
		 	var lastIndex = versionQualifierFileName.lastIndexOf('.');
			var version = versionQualifierFileName.substring(0, lastIndex);
			lastIndex = version.lastIndexOf('.');
			version = version.substring(lastIndex + 1);
			project.setProperty('versionQualifier', version);
  	  	]]>
			</script>
		</sequential>
	</macrodef>

	<!-- 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="${toolsPath}/@{app}" />

			<!-- Find the Eclipse launcher and adding 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 -->
			<!-- removed  failonerror="true" because run always returned error code -->
			<java fork="true" jar="${@{app}.launcher}" dir="${@{app}.deploy.dir}">
				<env key="no_proxy" value="${no.proxy}" />
				<!-- Uncomment to debug <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/> -->
				<args />
			</java>
		</sequential>
	</macrodef>

	<macrodef name="buckminster">
		<attribute name="command" />
		<attribute name="workspace" />
		<element name="globargs" optional="true" />
		<element name="cmdargs" optional="true" />
		<sequential>
			<eclipse.launch app="buckminster">
				<args>
					<jvmarg value="-Xmx1024m" />
					<jvmarg value="-Declipse.p2.mirrors=false" />
					<jvmarg value="-Declipse.p2.unsignedPolicy=allow" />
					<jvmarg value="-Dbugfix.288796=true" />
					<arg value="-data" />
					<arg value="@{workspace}" />
					<arg value="--loglevel" />
					<arg value="${buckminster.loglevel}" />
					<arg value="--displaystacktrace" />
					<arg value="@{command}" />
					<globargs />
					<arg value="-P" />
					<arg value="${properties.tmp}" />
					<cmdargs />
				</args>
			</eclipse.launch>
		</sequential>
	</macrodef>

</project>

Back to the top