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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
<!--
OpenOffice.org - a multi-platform office productivity suite
$RCSfile: build.xml,v $
$Revision: 1.30 $
last change: $Author: rt $ $Date: 2005-09-09 02:41:02 $
The Contents of this file are made available subject to
the terms of GNU Lesser General Public License Version 2.1.
GNU Lesser General Public License Version 2.1
=============================================
Copyright 2005 by Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, CA 94303, USA
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1, as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
-->
<project name="Scipting Framework Installer" default="jar" basedir=".">
<!-- =================== Environmental Properties ======================= -->
<property name="prj" value=".."/>
<property file="${prj}/java/build.env"/>
<property name="build.compiler" value="classic"/>
<property name="optimize" value="on"/>
<property name="debug" value="on"/>
<property name="installerclasses" value="${out}/class/sframeworkinstall"/>
<property name="jardir" value="${out}/class"/>
<property name="bindir" value="${out}/bin"/>
<property name="sfversion" value="0.3"/>
<property name="installerjarname" value="SFrameworkInstall.jar"/>
<property environment="env"/>
<!-- ==================== classpath setting ============================ -->
<path id="idlclasspath">
<pathelement location="${solar.jar}/unoil.jar"/>
<!-- <pathelement location="${prj}/../unoil/${inpath}/class/unoil.jar"/> -->
<pathelement location="${solar.jar}/jurt.jar"/>
<pathelement location="${solar.jar}/jut.jar"/>
<pathelement location="${solar.jar}/juh.jar"/>
<pathelement location="${solar.jar}/java_uno.jar"/>
<pathelement location="${solar.jar}/ridl.jar"/>
</path>
<path id="scriptexampleclasspath">
<pathelement location="${solar.jar}/unoil.jar"/>
<!-- pathelement location="${prj}/../unoil/${inpath}/class/unoil.jar"/ -->
<pathelement location="${solar.jar}/jurt.jar"/>
<pathelement location="${solar.jar}/jut.jar"/>
<pathelement location="${solar.jar}/juh.jar"/>
<pathelement location="${solar.jar}/java_uno.jar"/>
<pathelement location="${solar.jar}/ridl.jar"/>
<pathelement location="${out}/class/ScriptRuntimeForJava.jar"/>
</path>
<path id="debuggerclasspath">
<pathelement location="${out}/class/ScriptRuntimeForJava.jar"/>
<pathelement location="${solar.jar}/ridl.jar"/>
<pathelement location="${solar.jar}/unoil.jar"/>
<pathelement location="${out}/class/jsruntime/skip_registration/js.jar"/>
<pathelement location="${install.dir}/bsh-1.2b7.jar"/>
</path>
<!-- ===================== Set up build conditionals ========================= -->
<target name="product.test">
<condition property="noproext">
<equals arg1="$${env.PROEXT}" arg2="${env.PROEXT}"/>
</condition>
</target>
<target name="nonproduct.set" if="noproext">
<echo message="non-product build"/>
<property name="proext" value=""/>
</target>
<target name="product.set" unless="noproext">
<echo message="product build"/>
<property name="proext" value="${env.PROEXT}"/>
</target>
<target name="build.conditions" depends="product.test,nonproduct.set,product.set">
<condition property="win9.build">
<available file="${prj}/wntmsci9${proext}"/>
</condition>
<condition property="win8.build">
<available file="${prj}/wntmsci8${proext}"/>
</condition>
<condition property="win7.build">
<available file="${prj}/wntmsci7${proext}"/>
</condition>
<condition property="linx86.build">
<available file="${prj}/unxlngi5${proext}"/>
</condition>
<condition property="solsparc.build">
<available file="${prj}/unxsols4${proext}"/>
</condition>
<!-- <condition property="openoffice.build">
</condition> -->
</target>
<!-- ===================== Build the examples ========================= -->
<target name="buildexamples">
<mkdir dir="${out}/class/examples/java/debugger"/>
<javac srcdir="${prj}/examples/java/debugger"
destdir="${out}/class/examples/java/debugger"
includes="*.java"
classpathref="debuggerclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<copy todir="${out}/class/examples/java/debugger">
<fileset dir="${prj}/examples/java/debugger">
<include name="**/*.java"/>
<include name="*.xml"/>
</fileset>
</copy>
<jar jarfile="${out}/class/examples/java/debugger/debugger.jar"
basedir="${out}/class/examples/java/debugger" includes="*.class">
<manifest>
<attribute name="Built-By" value="Sun Microsystems"/>
<attribute name="ScriptFramework-Version" value="${sfversion}"/>
</manifest>
</jar>
<delete>
<fileset dir="${out}/class/examples/java/debugger" includes="*.class"/>
</delete>
<mkdir dir="${out}/class/examples/java/Highlight"/>
<javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/Highlight/"
includes="**/Highlight*.java" classpathref="idlclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<copy todir="${out}/class/examples/java/Highlight/">
<fileset dir="${prj}/examples/java/">
<include name="**/Highlight*.java"/>
</fileset>
</copy>
<copy file="${prj}/examples/java/HighlightTextParcel.xml" tofile="${out}/class/examples/java/Highlight/parcel-descriptor.xml"/>
<jar jarfile="${out}/class/examples/java/Highlight/Highlight.jar"
basedir="${out}/class/examples/java/Highlight"
includes="**/*.java,**/*.class,**/*.xml"
excludes="${out}/class/examples/java/Highlight/Highlight.jar">
<manifest>
<attribute name="Built-By" value="Sun Microsystems"/>
<attribute name="ScriptFramework-Version" value="${sfversion}"/>
</manifest>
</jar>
<mkdir dir="${out}/class/examples/java/MemoryUsage"/>
<javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/MemoryUsage/"
includes="**/MemoryUsage.java" classpathref="idlclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<copy file="${prj}/examples/java/MemoryUsage.java" todir="${out}/class/examples/java/MemoryUsage/"/>
<copy file="${prj}/examples/java/MemoryUsageParcel.xml" tofile="${out}/class/examples/java/MemoryUsage/parcel-descriptor.xml"/>
<copy file="${prj}/examples/java/MemoryUsage.java" todir="${out}/class/examples/java/MemoryUsage/"/>
<copy file="${prj}/examples/java/ExampleSpreadSheet.sxc" todir="${out}/class/examples/java/MemoryUsage/"/>
<mkdir dir="${out}/class/examples/java/ScriptFrmwrkHelper"/>
<javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/ScriptFrmwrkHelper/"
includes="**/ScriptFrmwrkHelper.java" classpathref="scriptexampleclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<copy todir="${out}/class/examples/java/ScriptFrmwrkHelper/">
<fileset dir="${prj}/examples/java/">
<include name="**/ScriptFrmwrkHelper.java"/>
</fileset>
</copy>
<copy file="${prj}/examples/java/ScriptFrameWkHelperParcel.xml" tofile="${out}/class/examples/java/ScriptFrmwrkHelper/parcel-descriptor.xml"/>
<jar jarfile="${out}/class/examples/java/ScriptFrmwrkHelper/ScriptFrmwrkHelper.jar"
basedir="${out}/class/examples/java/ScriptFrmwrkHelper"
includes="**/*.java,**/*.class,**/*.xml"
excludes="${out}/class/examples/java/ScriptFrmwrkHelper/ScriptFrmwrkHelper.jar">
<manifest>
<attribute name="Built-By" value="Sun Microsystems"/>
<attribute name="ScriptFramework-Version" value="${sfversion}"/>
</manifest>
</jar>
<mkdir dir="${out}/class/examples/beanshell"/>
<copy todir="${out}/class/examples/beanshell">
<fileset dir="${prj}/examples/beanshell" includes="**"/>
</copy>
<mkdir dir="${out}/class/examples/javascript"/>
<copy todir="${out}/class/examples/javascript">
<fileset dir="${prj}/examples/javascript" includes="**"/>
</copy>
</target>
<!-- ===================== Build UNO package ========================= -->
<target name="buildunopackage_win9" depends="build.conditions" if="win9.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<copy file="${solar.bin}/ScriptFramework.rdb"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptFramework.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/windows.plt"/>
<copy todir="${out}/class/sframework/windows.plt">
<fileset dir="${prj}/wntmsci9${proext}/bin/">
<include name="**/*.dll"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${solar.jar}/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target>
<target name="buildunopackage_win8" depends="build.conditions" if="win8.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<copy file="${solar.bin}/ScriptFramework.rdb"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptFramework.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/windows.plt"/>
<copy todir="${out}/class/sframework/windows.plt">
<fileset dir="${prj}/wntmsci8${proext}/bin/">
<include name="**/*.dll"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${solar.jar}/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target>
<!-- <target name="buildunopackage_win7" depends="build.conditions" if="win7.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<copy file="${solar.bin}/ScriptFramework.rdb"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptFramework.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/windows.plt"/>
<copy todir="${out}/class/sframework/windows.plt">
<fileset dir="${prj}/wntmsci7${proext}/bin/">
<include name="**/*.dll"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${solar.jar}/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target> -->
<target name="buildunopackage_linux" depends="build.conditions" if="linx86.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<copy file="${solar.bin}/ScriptFramework.rdb"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptFramework.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/linux_x86.plt"/>
<copy todir="${out}/class/sframework/linux_x86.plt">
<fileset dir="${prj}/unxlngi5${proext}/lib/">
<include name="**/lib*.so"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${solar.jar}/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target>
<target name="buildunopackage_solaris" depends="build.conditions" if="solsparc.build">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/sframework"/>
<copy file="${solar.bin}/ScriptFramework.rdb"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptRuntimeForJava.jar"
todir="${out}/class/sframework/"/>
<copy file="${out}/class/ScriptFramework.jar"
todir="${out}/class/sframework/"/>
<mkdir dir="${out}/class/sframework/solaris_sparc.plt"/>
<copy todir="${out}/class/sframework/solaris_sparc.plt">
<fileset dir="${prj}/unxsols4${proext}/lib/">
<include name="**/lib*.so"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframework/skip_registration"/>
<copy file="${solar.jar}/unoil.jar"
todir="${out}/class/sframework/skip_registration"/>
</target>
<target name="buildunopackage" depends="buildunopackage_win8,buildunopackage_linux,buildunopackage_solaris">
<!-- <target name="buildunopackage" depends="buildunopackage_win9,buildunopackage_win7,buildunopackage_linux,buildunopackage_solaris"> -->
<copy file="installer/ProtocolHandler.xcu"
todir="${out}/class/sframework/"/>
<zip zipfile="${out}/class/sframeworkinstall/sframework/ooscriptframe.zip"
basedir="${out}/class/sframework">
</zip>
</target>
<!-- ================== Build JavaScript UNO package ===================== -->
<target name="buildjsuno">
<mkdir dir="${out}/class/sframeworkinstall/sframework"/>
<mkdir dir="${out}/class/jsruntime"/>
<mkdir dir="${out}/class/jsruntime/skip_registration"/>
<mkdir dir="${out}/class/jsruntimetmp"/>
<copy file="${out}/class/ScriptRuntimeForJavaScript.jar"
todir="${out}/class/jsruntime/"/>
<copy file="installer/Scripting.JavaScript.xcu"
tofile="${out}/class/jsruntime/Scripting.xcu"/>
<unzip src="${install.dir}/js.jar"
dest="${out}/class/jsruntimetmp"/>
<javac srcdir="${prj}/examples/java/debugger"
destdir="${out}/class/jsruntimetmp"
includes="rhino/Main.java" classpathref="debuggerclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<zip destfile="${out}/class/jsruntime/skip_registration/js.jar"
basedir="${out}/class/jsruntimetmp" includes="**"/>
<zip zipfile="${out}/class/sframeworkinstall/sframework/jsruntime.zip"
basedir="${out}/class/jsruntime">
</zip>
</target>
<!-- =================== Build BeanShell UNO package ===================== -->
<target name="buildbshuno">
<mkdir dir="${out}/class/bshruntime"/>
<copy file="${out}/class/ScriptRuntimeForBeanShell.jar"
todir="${out}/class/bshruntime/"/>
<copy file="installer/Scripting.BeanShell.xcu"
tofile="${out}/class/bshruntime/Scripting.xcu"/>
<mkdir dir="${out}/class/bshruntime/skip_registration"/>
<copy file="${install.dir}/bsh-1.2b7.jar"
todir="${out}/class/bshruntime/skip_registration"/>
<zip zipfile="${out}/class/sframeworkinstall/sframework/bshruntime.zip"
basedir="${out}/class/bshruntime">
</zip>
</target>
<!-- ========= Package schema, scripts, dialogs & examples =========== -->
<target name="packagedialogsandexamples" depends="buildexamples">
<mkdir dir="${out}/class/sframeworkinstall/schema"/>
<copy file="installer/Scripting.xcs"
todir="${out}/class/sframeworkinstall/schema/"/>
<mkdir dir="${out}/class/sframeworkinstall/bindingdialog"/>
<copy todir="${out}/class/sframeworkinstall/bindingdialog">
<fileset dir="bindings/">
<include name="**/*.x*"/>
</fileset>
</copy>
<mkdir dir="${out}/class/sframeworkinstall/examples"/>
<copy todir="${out}/class/sframeworkinstall/examples">
<fileset dir="${out}/class/examples/"/>
</copy>
</target>
<!-- ===================== Package IDEs ================================== -->
<target name="packageide">
<mkdir dir="${out}/class/sframeworkinstall/ide"/>
<copy todir="${out}/class/sframeworkinstall/ide">
<fileset dir="${out}/class/">
<include name="idesupport.jar"/>
<include name="office.jar"/>
</fileset>
</copy>
</target>
<!-- ======================== Compile Classes ========================== -->
<target name="compileinstaller">
<mkdir dir="${installerclasses}"/>
<javac srcdir="installer/" destdir="${installerclasses}"
includes="**/*.java" classpathref="idlclasspath"
debug="${debug}" optimize="${optimize}" deprecation="on"/>
<copy file="installer/sidebar.jpg" todir="${out}/class/sframeworkinstall/installer"/>
</target>
<!-- ===================== jar ========================= -->
<target name="jar" depends="buildunopackage,buildbshuno,buildjsuno,compileinstaller,packagedialogsandexamples,packageide">
<jar jarfile="${jardir}/${installerjarname}"
basedir="${installerclasses}">
<manifest>
<attribute name="Built-By" value="Sun Microsystems"/>
<attribute name="ScriptFramework-Version" value="${sfversion}"/>
<attribute name="Main-Class" value="installer.InstallWizard"/>
</manifest>
</jar>
</target>
<!-- ====================== Clean Generated Files ===================== -->
<target name="clean">
<delete dir="${scriptingclasses}"/>
<delete dir="${storageclasses}"/>
<delete dir="${jardir}/${scriptingjarname}"/>
</target>
<!-- ========================= All In One Build ======================= -->
<target name="all" depends="clean,jar"/>
</project>
|