2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 <project name="Scripting Framework Installer" default="jar" basedir=".">
20 <!-- =================== Environmental Properties ======================= -->
22 <property name="prj" value=".."/>
23 <property file="${prj}/java/build.env"/>
24 <property name="optimize" value="on"/>
25 <property name="debug" value="on"/>
26 <property name="installerclasses" value="${out}/class/sframeworkinstall"/>
27 <property name="jardir" value="${out}/class"/>
28 <property name="bindir" value="${out}/bin"/>
29 <property name="sfversion" value="0.3"/>
30 <property name="installerjarname" value="SFrameworkInstall.jar"/>
31 <property environment="env"/>
33 <!-- ==================== classpath setting ============================ -->
34 <path id="idlclasspath">
35 <pathelement location="${solar.jar}/unoil.jar"/>
36 <!-- <pathelement location="${prj}/../unoil/${inpath}/class/unoil.jar"/> -->
37 <pathelement location="${solar.jar}/jurt.jar"/>
38 <pathelement location="${solar.jar}/juh.jar"/>
39 <pathelement location="${solar.jar}/java_uno.jar"/>
40 <pathelement location="${solar.jar}/ridl.jar"/>
42 <path id="scriptexampleclasspath">
43 <pathelement location="${solar.jar}/unoil.jar"/>
44 <!-- pathelement location="${prj}/../unoil/${inpath}/class/unoil.jar"/ -->
45 <pathelement location="${solar.jar}/jurt.jar"/>
46 <pathelement location="${solar.jar}/juh.jar"/>
47 <pathelement location="${solar.jar}/java_uno.jar"/>
48 <pathelement location="${solar.jar}/ridl.jar"/>
49 <pathelement location="${out}/class/ScriptRuntimeForJava.jar"/>
52 <path id="debuggerclasspath">
53 <pathelement location="${out}/class/ScriptRuntimeForJava.jar"/>
54 <pathelement location="${solar.jar}/ridl.jar"/>
55 <pathelement location="${solar.jar}/unoil.jar"/>
56 <pathelement location="${out}/class/jsruntime/skip_registration/js.jar"/>
57 <pathelement location="${install.dir}/bsh-1.2b7.jar"/>
59 <!-- ===================== Set up build conditionals ========================= -->
60 <target name="product.test">
61 <condition property="noproext">
62 <equals arg1="$${env.PROEXT}" arg2="${env.PROEXT}"/>
65 <target name="nonproduct.set" if="noproext">
66 <echo message="non-product build"/>
67 <property name="proext" value=""/>
69 <target name="product.set" unless="noproext">
70 <echo message="product build"/>
71 <property name="proext" value="${env.PROEXT}"/>
73 <target name="build.conditions" depends="product.test,nonproduct.set,product.set">
74 <condition property="win9.build">
75 <available file="${prj}/wntmsci9${proext}"/>
77 <condition property="win8.build">
78 <available file="${prj}/wntmsci8${proext}"/>
80 <condition property="win7.build">
81 <available file="${prj}/wntmsci7${proext}"/>
83 <condition property="linx86.build">
84 <available file="${prj}/unxlngi5${proext}"/>
86 <condition property="solsparc.build">
87 <available file="${prj}/unxsols4${proext}"/>
89 <!-- <condition property="openoffice.build">
92 <!-- ===================== Build the examples ========================= -->
93 <target name="buildexamples">
95 <mkdir dir="${out}/class/examples/java/debugger"/>
96 <javac srcdir="${prj}/examples/java/debugger"
97 destdir="${out}/class/examples/java/debugger"
99 classpathref="debuggerclasspath"
100 debug="${debug}" optimize="${optimize}" deprecation="on"/>
102 <copy todir="${out}/class/examples/java/debugger">
103 <fileset dir="${prj}/examples/java/debugger">
104 <include name="**/*.java"/>
105 <include name="*.xml"/>
109 <jar jarfile="${out}/class/examples/java/debugger/debugger.jar"
110 basedir="${out}/class/examples/java/debugger" includes="*.class">
112 <attribute name="Built-By" value="Sun Microsystems"/>
113 <attribute name="ScriptFramework-Version" value="${sfversion}"/>
118 <fileset dir="${out}/class/examples/java/debugger" includes="*.class"/>
121 <mkdir dir="${out}/class/examples/java/Highlight"/>
122 <javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/Highlight/"
123 includes="**/Highlight*.java" classpathref="idlclasspath"
124 debug="${debug}" optimize="${optimize}" deprecation="on"/>
125 <copy todir="${out}/class/examples/java/Highlight/">
126 <fileset dir="${prj}/examples/java/">
127 <include name="**/Highlight*.java"/>
130 <copy file="${prj}/examples/java/HighlightTextParcel.xml" tofile="${out}/class/examples/java/Highlight/parcel-descriptor.xml"/>
131 <jar jarfile="${out}/class/examples/java/Highlight/Highlight.jar"
132 basedir="${out}/class/examples/java/Highlight"
133 includes="**/*.java,**/*.class,**/*.xml"
134 excludes="${out}/class/examples/java/Highlight/Highlight.jar">
136 <attribute name="Built-By" value="Sun Microsystems"/>
137 <attribute name="ScriptFramework-Version" value="${sfversion}"/>
140 <mkdir dir="${out}/class/examples/java/MemoryUsage"/>
141 <javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/MemoryUsage/"
142 includes="**/MemoryUsage.java" classpathref="idlclasspath"
143 debug="${debug}" optimize="${optimize}" deprecation="on"/>
144 <copy file="${prj}/examples/java/MemoryUsage.java" todir="${out}/class/examples/java/MemoryUsage/"/>
145 <copy file="${prj}/examples/java/MemoryUsageParcel.xml" tofile="${out}/class/examples/java/MemoryUsage/parcel-descriptor.xml"/>
146 <copy file="${prj}/examples/java/MemoryUsage.java" todir="${out}/class/examples/java/MemoryUsage/"/>
147 <copy file="${prj}/examples/java/ExampleSpreadSheet.sxc" todir="${out}/class/examples/java/MemoryUsage/"/>
149 <mkdir dir="${out}/class/examples/java/ScriptFrmwrkHelper"/>
150 <javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/ScriptFrmwrkHelper/"
151 includes="**/ScriptFrmwrkHelper.java" classpathref="scriptexampleclasspath"
152 debug="${debug}" optimize="${optimize}" deprecation="on"/>
153 <copy todir="${out}/class/examples/java/ScriptFrmwrkHelper/">
154 <fileset dir="${prj}/examples/java/">
155 <include name="**/ScriptFrmwrkHelper.java"/>
158 <copy file="${prj}/examples/java/ScriptFrameWkHelperParcel.xml" tofile="${out}/class/examples/java/ScriptFrmwrkHelper/parcel-descriptor.xml"/>
159 <jar jarfile="${out}/class/examples/java/ScriptFrmwrkHelper/ScriptFrmwrkHelper.jar"
160 basedir="${out}/class/examples/java/ScriptFrmwrkHelper"
161 includes="**/*.java,**/*.class,**/*.xml"
162 excludes="${out}/class/examples/java/ScriptFrmwrkHelper/ScriptFrmwrkHelper.jar">
164 <attribute name="Built-By" value="Sun Microsystems"/>
165 <attribute name="ScriptFramework-Version" value="${sfversion}"/>
168 <mkdir dir="${out}/class/examples/beanshell"/>
169 <copy todir="${out}/class/examples/beanshell">
170 <fileset dir="${prj}/examples/beanshell" includes="**"/>
172 <mkdir dir="${out}/class/examples/javascript"/>
173 <copy todir="${out}/class/examples/javascript">
174 <fileset dir="${prj}/examples/javascript" includes="**"/>
178 <!-- ===================== Build UNO package ========================= -->
179 <target name="buildunopackage_win9" depends="build.conditions" if="win9.build">
180 <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
181 <mkdir dir="${out}/class/sframework"/>
182 <copy file="${solar.bin}/ScriptFramework.rdb"
183 todir="${out}/class/sframework/"/>
184 <copy file="${out}/class/ScriptRuntimeForJava.jar"
185 todir="${out}/class/sframework/"/>
186 <copy file="${out}/class/ScriptFramework.jar"
187 todir="${out}/class/sframework/"/>
188 <mkdir dir="${out}/class/sframework/windows.plt"/>
189 <copy todir="${out}/class/sframework/windows.plt">
190 <fileset dir="${prj}/wntmsci9${proext}/bin/">
191 <include name="**/*.dll"/>
194 <mkdir dir="${out}/class/sframework/skip_registration"/>
195 <copy file="${solar.jar}/unoil.jar"
196 todir="${out}/class/sframework/skip_registration"/>
198 <target name="buildunopackage_win8" depends="build.conditions" if="win8.build">
199 <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
200 <mkdir dir="${out}/class/sframework"/>
201 <copy file="${solar.bin}/ScriptFramework.rdb"
202 todir="${out}/class/sframework/"/>
203 <copy file="${out}/class/ScriptRuntimeForJava.jar"
204 todir="${out}/class/sframework/"/>
205 <copy file="${out}/class/ScriptFramework.jar"
206 todir="${out}/class/sframework/"/>
207 <mkdir dir="${out}/class/sframework/windows.plt"/>
208 <copy todir="${out}/class/sframework/windows.plt">
209 <fileset dir="${prj}/wntmsci8${proext}/bin/">
210 <include name="**/*.dll"/>
213 <mkdir dir="${out}/class/sframework/skip_registration"/>
214 <copy file="${solar.jar}/unoil.jar"
215 todir="${out}/class/sframework/skip_registration"/>
217 <!-- <target name="buildunopackage_win7" depends="build.conditions" if="win7.build">
218 <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
219 <mkdir dir="${out}/class/sframework"/>
220 <copy file="${solar.bin}/ScriptFramework.rdb"
221 todir="${out}/class/sframework/"/>
222 <copy file="${out}/class/ScriptRuntimeForJava.jar"
223 todir="${out}/class/sframework/"/>
224 <copy file="${out}/class/ScriptFramework.jar"
225 todir="${out}/class/sframework/"/>
226 <mkdir dir="${out}/class/sframework/windows.plt"/>
227 <copy todir="${out}/class/sframework/windows.plt">
228 <fileset dir="${prj}/wntmsci7${proext}/bin/">
229 <include name="**/*.dll"/>
232 <mkdir dir="${out}/class/sframework/skip_registration"/>
233 <copy file="${solar.jar}/unoil.jar"
234 todir="${out}/class/sframework/skip_registration"/>
236 <target name="buildunopackage_linux" depends="build.conditions" if="linx86.build">
237 <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
238 <mkdir dir="${out}/class/sframework"/>
239 <copy file="${solar.bin}/ScriptFramework.rdb"
240 todir="${out}/class/sframework/"/>
241 <copy file="${out}/class/ScriptRuntimeForJava.jar"
242 todir="${out}/class/sframework/"/>
243 <copy file="${out}/class/ScriptFramework.jar"
244 todir="${out}/class/sframework/"/>
245 <mkdir dir="${out}/class/sframework/linux_x86.plt"/>
246 <copy todir="${out}/class/sframework/linux_x86.plt">
247 <fileset dir="${prj}/unxlngi5${proext}/lib/">
248 <include name="**/lib*.so"/>
251 <mkdir dir="${out}/class/sframework/skip_registration"/>
252 <copy file="${solar.jar}/unoil.jar"
253 todir="${out}/class/sframework/skip_registration"/>
255 <target name="buildunopackage_solaris" depends="build.conditions" if="solsparc.build">
256 <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
257 <mkdir dir="${out}/class/sframework"/>
258 <copy file="${solar.bin}/ScriptFramework.rdb"
259 todir="${out}/class/sframework/"/>
260 <copy file="${out}/class/ScriptRuntimeForJava.jar"
261 todir="${out}/class/sframework/"/>
262 <copy file="${out}/class/ScriptFramework.jar"
263 todir="${out}/class/sframework/"/>
264 <mkdir dir="${out}/class/sframework/solaris_sparc.plt"/>
265 <copy todir="${out}/class/sframework/solaris_sparc.plt">
266 <fileset dir="${prj}/unxsols4${proext}/lib/">
267 <include name="**/lib*.so"/>
270 <mkdir dir="${out}/class/sframework/skip_registration"/>
271 <copy file="${solar.jar}/unoil.jar"
272 todir="${out}/class/sframework/skip_registration"/>
274 <target name="buildunopackage" depends="buildunopackage_win8,buildunopackage_linux,buildunopackage_solaris">
275 <!-- <target name="buildunopackage" depends="buildunopackage_win9,buildunopackage_win7,buildunopackage_linux,buildunopackage_solaris"> -->
276 <copy file="installer/ProtocolHandler.xcu"
277 todir="${out}/class/sframework/"/>
278 <zip zipfile="${out}/class/sframeworkinstall/sframework/ooscriptframe.zip"
279 basedir="${out}/class/sframework">
283 <!-- ================== Build JavaScript UNO package ===================== -->
284 <target name="buildjsuno">
285 <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
287 <mkdir dir="${out}/class/jsruntime"/>
288 <mkdir dir="${out}/class/jsruntime/skip_registration"/>
289 <mkdir dir="${out}/class/jsruntimetmp"/>
291 <copy file="${out}/class/ScriptRuntimeForJavaScript.jar"
292 todir="${out}/class/jsruntime/"/>
293 <copy file="installer/Scripting.JavaScript.xcu"
294 tofile="${out}/class/jsruntime/Scripting.xcu"/>
296 <unzip src="${install.dir}/js.jar"
297 dest="${out}/class/jsruntimetmp"/>
299 <javac srcdir="${prj}/examples/java/debugger"
300 destdir="${out}/class/jsruntimetmp"
301 includes="rhino/Main.java" classpathref="debuggerclasspath"
302 debug="${debug}" optimize="${optimize}" deprecation="on"/>
304 <zip destfile="${out}/class/jsruntime/skip_registration/js.jar"
305 basedir="${out}/class/jsruntimetmp" includes="**"/>
307 <zip zipfile="${out}/class/sframeworkinstall/sframework/jsruntime.zip"
308 basedir="${out}/class/jsruntime">
312 <!-- =================== Build BeanShell UNO package ===================== -->
313 <target name="buildbshuno">
314 <mkdir dir="${out}/class/bshruntime"/>
315 <copy file="${out}/class/ScriptRuntimeForBeanShell.jar"
316 todir="${out}/class/bshruntime/"/>
317 <copy file="installer/Scripting.BeanShell.xcu"
318 tofile="${out}/class/bshruntime/Scripting.xcu"/>
319 <mkdir dir="${out}/class/bshruntime/skip_registration"/>
320 <copy file="${install.dir}/bsh-1.2b7.jar"
321 todir="${out}/class/bshruntime/skip_registration"/>
322 <zip zipfile="${out}/class/sframeworkinstall/sframework/bshruntime.zip"
323 basedir="${out}/class/bshruntime">
327 <!-- ========= Package schema, scripts, dialogs & examples =========== -->
328 <target name="packagedialogsandexamples" depends="buildexamples">
329 <mkdir dir="${out}/class/sframeworkinstall/schema"/>
330 <copy file="installer/Scripting.xcs"
331 todir="${out}/class/sframeworkinstall/schema/"/>
332 <mkdir dir="${out}/class/sframeworkinstall/bindingdialog"/>
333 <copy todir="${out}/class/sframeworkinstall/bindingdialog">
334 <fileset dir="bindings/">
335 <include name="**/*.x*"/>
338 <mkdir dir="${out}/class/sframeworkinstall/examples"/>
339 <copy todir="${out}/class/sframeworkinstall/examples">
340 <fileset dir="${out}/class/examples/"/>
344 <!-- ===================== Package IDEs ================================== -->
345 <target name="packageide">
346 <mkdir dir="${out}/class/sframeworkinstall/ide"/>
347 <copy todir="${out}/class/sframeworkinstall/ide">
348 <fileset dir="${out}/class/">
349 <include name="idesupport.jar"/>
350 <include name="office.jar"/>
355 <!-- ======================== Compile Classes ========================== -->
356 <target name="compileinstaller">
357 <mkdir dir="${installerclasses}"/>
358 <javac srcdir="installer/" destdir="${installerclasses}"
359 includes="**/*.java" classpathref="idlclasspath"
360 debug="${debug}" optimize="${optimize}" deprecation="on"/>
361 <copy file="installer/sidebar.jpg" todir="${out}/class/sframeworkinstall/installer"/>
364 <!-- ===================== jar ========================= -->
365 <target name="jar" depends="buildunopackage,buildbshuno,buildjsuno,compileinstaller,packagedialogsandexamples,packageide">
366 <jar jarfile="${jardir}/${installerjarname}"
367 basedir="${installerclasses}">
369 <attribute name="Built-By" value="Sun Microsystems"/>
370 <attribute name="ScriptFramework-Version" value="${sfversion}"/>
371 <attribute name="Main-Class" value="installer.InstallWizard"/>
376 <!-- ====================== Clean Generated Files ===================== -->
377 <target name="clean">
378 <delete dir="${scriptingclasses}"/>
379 <delete dir="${storageclasses}"/>
380 <delete dir="${jardir}/${scriptingjarname}"/>
383 <!-- ========================= All In One Build ======================= -->
384 <target name="all" depends="clean,jar"/>