-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcommon.xml
More file actions
286 lines (252 loc) · 8.6 KB
/
Copy pathcommon.xml
File metadata and controls
286 lines (252 loc) · 8.6 KB
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!-- Common definitions. -->
<project name="fabric.common">
<dirname property="fabric.home" file="${ant.file.fabric.common}" />
<!-- set the prefix for accessing environment variables -->
<property environment="env" />
<property name="build.sysclasspath" value="ignore" />
<property file="${fabric.home}/config.properties" />
<property file="${fabric.home}/extra.properties" />
<!-- Polyglot installation location -->
<!-- If polyglot.home is not defined in the properties file, try to use
polyglot.jar from the distribution -->
<condition property="polyglot.home" value="${fabric.home}">
<not><isset property="polyglot.home" /></not>
</condition>
<!-- Polyglot configuration file -->
<property file="${polyglot.home}/config.properties" prefix="polyglot" />
<!-- Jif installation -->
<!-- If jif.home is not defined in the properties file, try to use jif.jar
from the distribution -->
<condition property="jif.home" value="${fabric.home}">
<not><isset property="jif.home" /></not>
</condition>
<!-- jif configuration file -->
<property file="${jif.home}/config.properties" prefix="jif" />
<!-- Java installation -->
<!-- First choice: jdk.home in config.properties
Second choice: jdk.home in ${jif.home}/config.properties
Third choice: JAVA_HOME environment variable
Fourth choice: output of the BASH command (if successful):
readlink -f $(which javac) \
| sed '/\/bin\/javac$/{s|/bin/javac$||;q}; q1'
(The above sed expression is the same as
's|/bin/javac$||', except it returns with exit code 1 if
the substitution is unsuccessful.)
Fifth choice: Ant's built-in java.home
-->
<condition property="jdk.home" value="${jif.jdk.home}">
<and>
<isset property="jif.jdk.home" />
<not>
<isset property="jdk.home" />
</not>
</and>
</condition>
<condition property="jdk.home" value="${env.JAVA_HOME}">
<and>
<isset property="env.JAVA_HOME" />
<not>
<isset property="jdk.home" />
</not>
</and>
</condition>
<exec executable="bash"
failifexecutionfails="false"
outputproperty="jdk.home.detected"
resultproperty="jdk.home.detected-result">
<arg value="-c"/>
<arg value="-o"/> <arg value="pipefail"/>
<arg value="readlink -f $(which javac) | sed '/\/bin\/javac$/{s|/bin/javac$||;q}; q1'"/>
</exec>
<condition property="jdk.home" value="${jdk.home.detected}">
<and>
<equals arg1="${jdk.home.detected-result}" arg2="0"/>
<isset property="jdk.home.detected"/>
<not>
<isset property="jdk.home" />
</not>
</and>
</condition>
<condition property="jdk.home" value="${java.home}">
<not>
<isset property="jdk.home" />
</not>
</condition>
<!-- Directories for class file targets -->
<property name="classes" location="${fabric.home}/classes"/>
<property name="runtime.classes" location="${fabric.home}/rt-classes"/>
<!-- Binaries directory -->
<property name="bin" location="${fabric.home}/bin"/>
<!-- Library directory -->
<property name="lib" location="${fabric.home}/lib"/>
<!-- fabc executable -->
<property name="fabc" location="${bin}/fabc" />
<!-- fabc-in-worker executable -->
<property name="fabc-in-worker" location="${bin}/fabc-in-worker" />
<!-- jpa2fab executable -->
<property name="jpa2fab" location="${fabric.home}/tools/jpa2fab/bin/jpa2fab" />
<!-- filc executable -->
<property name="filc" location="${bin}/filc" />
<!-- jifc executable -->
<property name="jifc" location="${jif.home}/bin/jifc"/>
<!-- jif executable -->
<property name="jif" location="${jif.home}/bin/jif"/>
<!-- Debug flag to be passed to fabc and filc. -->
<property name="debug.flag" value="-g" />
<!-- 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" />
<pathelement path="${jdk.home}/lib/tools.jar" />
</path>
<!-- Jif classpath -->
<path id="jif.classpath">
<path refid="polyglot.classpath" />
<pathelement location="${jif.home}/classes" />
<pathelement location="${jif.home}/lib/jif.jar" />
</path>
<!-- Classpath consisting of libraries on which the system depends. -->
<path id="lib.classpath">
<fileset dir="${lib}">
<include name="**/*.jar" />
<exclude name="fabric*.jar" />
</fileset>
</path>
<!-- Classpath for building Fabric applications. -->
<path id="fabric.classpath">
<pathelement location="${classes}" />
<pathelement location="${lib}/fabric.jar" />
<pathelement location="${runtime.classes}" />
<pathelement location="${lib}/fabric-rt.jar" />
</path>
<!-- Some useful Ant macros for invoking our compilers. -->
<macrodef name="fabc">
<attribute
name="dest"
description="The output directory."/>
<element name="extra-args" implicit="true"/>
<sequential>
<apply executable="bash"
parallel="true"
failonerror="true"
dest="@{dest}"
relative="false"
skipemptyfilesets="true"
vmlauncher="false">
<arg value="${fabc}"/>
<arg line="${debug.flag}"/>
<arg value="-d"/> <arg value="@{dest}"/>
<arg value="-e"/>
<arg value="-no-warnings"/>
<extra-args/>
<srcfile/>
<globmapper from="*.fab" to="*.class"/>
</apply>
</sequential>
</macrodef>
<macrodef name="fabc-in-worker">
<attribute
name="dest"
description="The output directory."/>
<attribute
name="worker"
description="The name of the worker."/>
<attribute
name="app-home"
description="The home directory of the application."/>
<element name="extra-args" implicit="true"/>
<sequential>
<apply executable="bash"
parallel="true"
failonerror="true"
dest="@{dest}"
relative="false"
skipemptyfilesets="true"
vmlauncher="false">
<arg value="${fabc-in-worker}"/>
<arg value="--name"/> <arg value="@{worker}"/>
<arg value="--app-home"/> <arg value="@{app-home}"/>
<arg line="${debug.flag}"/>
<arg value="-d"/> <arg value="@{dest}"/>
<arg value="-e"/>
<arg value="-no-warnings"/>
<extra-args/>
<srcfile/>
<globmapper from="*.fab" to="*.class"/>
</apply>
</sequential>
</macrodef>
<macrodef name="fabsigc">
<attribute
name="dest"
description="The output directory."/>
<element name="extra-args" implicit="true"/>
<sequential>
<fabc dest="@{dest}">
<arg value="-sig"/>
<extra-args/>
</fabc>
</sequential>
</macrodef>
<macrodef name="filc">
<attribute
name="dest"
description="The output directory."/>
<element name="extra-args" implicit="true"/>
<sequential>
<apply executable="bash"
parallel="true"
failonerror="true"
dest="@{dest}"
relative="false"
skipemptyfilesets="true"
vmlauncher="false">
<arg value="${filc}"/>
<arg line="${debug.flag}"/>
<arg value="-d"/> <arg value="@{dest}"/>
<extra-args/>
<srcfile/>
<globmapper from="*.fil" to="*.class"/>
</apply>
</sequential>
</macrodef>
<macrodef name="filsigc">
<attribute
name="dest"
description="The output directory."/>
<element name="extra-args" implicit="true"/>
<sequential>
<filc dest="@{dest}">
<arg value="-sig"/>
<extra-args/>
</filc>
</sequential>
</macrodef>
<macrodef name="jpa2fab">
<attribute name="destdir" default="classes"/>
<element name="extra-args" implicit="true"/>
<sequential>
<apply executable="bash"
parallel="true"
failonerror="true"
dest="@{destdir}"
relative="false"
skipemptyfilesets="true"
vmlauncher="false">
<arg value="${jpa2fab}"/>
<arg line="${debug.flag}"/>
<arg value="-d"/> <arg value="@{destdir}"/>
<arg value="-output-fabil"/>
<extra-args/>
<srcfile/>
<globmapper from="*.java" to="*.fil"/>
</apply>
</sequential>
</macrodef>
</project>
<!--
vim: ts=2 sw=2 ai et
-->