-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcommon.xml
201 lines (171 loc) · 6.47 KB
/
common.xml
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
<!-- Common definitions. -->
<project name="polyglot-ide.common" xmlns:if="ant:if" xmlns:unless="ant:unless">
<dirname property="polyglot-ide.home" file="${ant.file.polyglot-ide.common}"/>
<!-- Ensure config.properties exists. -->
<copy todir="${polyglot-ide.home}">
<fileset file="${polyglot-ide.home}/config.properties.in">
<present targetdir="${polyglot-ide.home}" present="srconly">
<mapper type="glob" from="*.in" to="*"/>
</present>
</fileset>
<mapper type="glob" from="*.in" to="*"/>
</copy>
<!-- Import common definitions. -->
<property file="${polyglot-ide.home}/config.properties" prefix="config"/>
<!-- Read in version information. -->
<property file="${polyglot-ide.home}/version.properties"
prefix="polyglot-ide"/>
<property name="polyglot-ide.version"
value="${polyglot-ide.version.major}.${polyglot-ide.version.minor}.${polyglot-ide.version.patch}"/>
<!--
Polyglot location
If polyglot.home is not defined in the properties file, default
to ${polyglot-ide.home}/../polyglot
-->
<dirname property="polyglot-ide.home.parent" file="${polyglot-ide.home}"/>
<condition property="polyglot.home"
value="${config.polyglot.home}"
else="${polyglot-ide.home.parent}/polyglot">
<isset property="config.polyglot.home"/>
</condition>
<!--
Eclipse location
If eclipse.home is not defined in the properties file, default to
/usr/lib/eclipse.
-->
<condition property="eclipse.home"
value="${config.eclipse.home}"
else="/usr/lib/eclipse">
<isset property="config.eclipse.home"/>
</condition>
<!-- Polyglot classpath -->
<path id="polyglot.classpath">
<pathelement path="${polyglot.home}/classes"/>
<pathelement path="${polyglot.home}/lib/polyglot.jar"/>
<pathelement path="${polyglot.home}/lib/ppg.jar"/>
<pathelement path="${polyglot.home}/lib/java_cup.jar"/>
<pathelement path="${polyglot.home}/lib/jflex.jar"/>
</path>
<!-- Eclipse plugins classpath -->
<!-- TODO: Handle case where JARs are installed in user's workspace. -->
<path id="eclipse.classpath">
<fileset dir="${eclipse.home}/plugins">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Polyglot IDE classpath (includes dependencies) -->
<path id="polyglot-ide.classpath">
<pathelement path="${polyglot-ide.home}/base/classes"/>
<path refid="polyglot.classpath"/>
<path refid="eclipse.classpath"/>
</path>
<!-- JL5 IDE classpath (includes dependencies) -->
<path id="jl5-ide.classpath">
<pathelement path="${polyglot-ide.home}/jl5/classes"/>
<path refid="polyglot-ide.classpath"/>
</path>
<!-- JL7 IDE classpath (includes dependencies) -->
<path id="jl7-ide.classpath">
<pathelement path="${polyglot-ide.home}/jl7/classes"/>
<path refid="jl5-ide.classpath"/>
</path>
<!-- Directory for emitting features JARs for the Eclipse update site -->
<property name="features"
location="${polyglot-ide.home}/eclipse/features"/>
<!-- Directory for emitting plugins JARs for the Eclipse update site -->
<property name="plugins"
location="${polyglot-ide.home}/eclipse/plugins"/>
<!-- Scratch for building JARs for the Eclipse update site -->
<property name="tmp"
location="${polyglot-ide.home}/tmp"/>
<!-- File set to be shipped with all plugins -->
<fileset id="common-dist"
dir="${polyglot-ide.home}">
<include name="CHANGES"/>
<include name="COPYING.in"/>
<include name="LICENSE.LGPL"/>
<include name="README.in"/>
</fileset>
<!--
________________________________________________________________________
Check configuration.
-->
<!-- Check for presence of Polyglot. -->
<condition property="polyglot.exists" value="true">
<available classname="polyglot.main.Version"
classpathref="polyglot.classpath"/>
</condition>
<!-- If Polyglot not found, print out the Polyglot home for debugging. -->
<echo unless:true="${polyglot.exists}"
message="Polyglot home directory is ${polyglot.home}"/>
<!--
Error handling: Polyglot not found and polyglot.home not set in
config.properties.
-->
<fail message="Failed to find Polyglot. Set the 'polyglot.home' property in ${polyglot-ide.home}/config.properties, and make sure Polyglot is built.">
<condition>
<and>
<isfalse value="${polyglot.exists}"/>
<not><isset property="config.polyglot.home"/></not>
</and>
</condition>
</fail>
<!-- Error handling: Polyglot not found. -->
<fail message="Failed to find Polyglot. Ensure the 'polyglot.home' property is correct in '${polyglot-ide.home}/config.properties' and make sure Polyglot is built.">
<condition>
<isfalse value="${polyglot.exists}"/>
</condition>
</fail>
<!-- Check for presence of Eclipse. -->
<condition property="eclipse.exists" value="true">
<available file="${eclipse.home}/plugins" type="dir"/>
</condition>
<!-- If Eclipse not found, print out the Eclipse home for debugging. -->
<echo unless:true="${eclipse.exists}"
message="Eclipse home directory is ${eclipse.home}"/>
<!--
Error handling: Eclipse not found and eclipse.home not set in
config.properties.
-->
<fail message="Failed to find Eclipse. Set the 'eclipse.home' property in '${polyglot-ide.home}/config.properties'.">
<condition>
<and>
<isfalse value="${eclipse.exists}"/>
<not><isset property="config.eclipse.home"/></not>
</and>
</condition>
</fail>
<!-- Error handling: Eclipse not found. -->
<fail message="Failed to find Eclipse. Ensure the 'eclipse.home' property is correct in '${polyglot-ide.home}/config.properties'.">
<condition>
<isfalse value="${eclipse.exists}"/>
</condition>
</fail>
<!-- Configure build string. -->
<tstamp>
<format property="now" timezone="America/New_York"
pattern="yyyy-MM-dd HH:mm:ss z"/>
</tstamp>
<property name="polyglot-ide.version.build"
value="${polyglot-ide.version} (${now})"/>
<tstamp>
<format property="timestamp" pattern="yyyyMMddHHmm" timezone="UTC"/>
</tstamp>
<tstamp>
<format property="year" pattern="yyyy" timezone="UTC"/>
</tstamp>
<property name="plugin.version" value="${polyglot-ide.version}.${timestamp}"/>
<!-- Utility targets -->
<target name="mkdir-tmp">
<clear-tmp/>
</target>
<macrodef name="clear-tmp">
<sequential>
<delete dir="${tmp}"/>
<mkdir dir="${tmp}"/>
</sequential>
</macrodef>
</project>
<!--
vim: ts=2 sw=2 ai et
-->