update dev300-m58
[ooovba.git] / scripting / workben / build.xml
blob1ba7b9666da929d60c19e299518d633b28300cb3
1 <!--
3   DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4   
5   Copyright 2008 by Sun Microsystems, Inc.
6  
7   OpenOffice.org - a multi-platform office productivity suite
8  
9   $RCSfile: build.xml,v $
11   $Revision: 1.31.20.1 $
13   This file is part of OpenOffice.org.
15   OpenOffice.org is free software: you can redistribute it and/or modify
16   it under the terms of the GNU Lesser General Public License version 3
17   only, as published by the Free Software Foundation.
19   OpenOffice.org is distributed in the hope that it will be useful,
20   but WITHOUT ANY WARRANTY; without even the implied warranty of
21   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   GNU Lesser General Public License version 3 for more details
23   (a copy is included in the LICENSE file that accompanied this code).
25   You should have received a copy of the GNU Lesser General Public License
26   version 3 along with OpenOffice.org.  If not, see
27   <http://www.openoffice.org/license.html>
28   for a copy of the LGPLv3 License.
30 -->
31 <project name="Scipting Framework Installer" default="jar" basedir=".">
33   <!-- =================== Environmental Properties ======================= -->
35   <property name="prj" value=".."/>
36   <property file="${prj}/java/build.env"/>
37   <property name="build.compiler"   value="classic"/>
38   <property name="optimize"   value="on"/>
39   <property name="debug"   value="on"/>
40   <property name="installerclasses" value="${out}/class/sframeworkinstall"/>
41   <property name="jardir" value="${out}/class"/>
42   <property name="bindir" value="${out}/bin"/>
43   <property name="sfversion" value="0.3"/>
44   <property name="installerjarname" value="SFrameworkInstall.jar"/>
45   <property environment="env"/>
47   <!-- ==================== classpath setting ============================ -->
48   <path id="idlclasspath">
49     <pathelement location="${solar.jar}/unoil.jar"/> 
50     <!-- <pathelement location="${prj}/../unoil/${inpath}/class/unoil.jar"/>  -->
51     <pathelement location="${solar.jar}/jurt.jar"/>
52     <pathelement location="${solar.jar}/juh.jar"/>
53     <pathelement location="${solar.jar}/java_uno.jar"/>
54     <pathelement location="${solar.jar}/ridl.jar"/>
55   </path> 
56   <path id="scriptexampleclasspath">
57     <pathelement location="${solar.jar}/unoil.jar"/> 
58     <!-- pathelement location="${prj}/../unoil/${inpath}/class/unoil.jar"/ --> 
59     <pathelement location="${solar.jar}/jurt.jar"/>
60     <pathelement location="${solar.jar}/juh.jar"/>
61     <pathelement location="${solar.jar}/java_uno.jar"/>
62     <pathelement location="${solar.jar}/ridl.jar"/>
63     <pathelement location="${out}/class/ScriptRuntimeForJava.jar"/>
64   </path> 
66   <path id="debuggerclasspath">
67     <pathelement location="${out}/class/ScriptRuntimeForJava.jar"/>
68     <pathelement location="${solar.jar}/ridl.jar"/>
69     <pathelement location="${solar.jar}/unoil.jar"/> 
70     <pathelement location="${out}/class/jsruntime/skip_registration/js.jar"/> 
71     <pathelement location="${install.dir}/bsh-1.2b7.jar"/> 
72   </path>
73   <!-- ===================== Set up build conditionals ========================= -->
74   <target name="product.test">
75       <condition property="noproext">
76             <equals arg1="$${env.PROEXT}" arg2="${env.PROEXT}"/>
77       </condition>
78   </target>
79   <target name="nonproduct.set" if="noproext">
80       <echo message="non-product build"/>
81       <property name="proext" value=""/>
82   </target>
83   <target name="product.set" unless="noproext">
84       <echo message="product build"/>
85       <property name="proext" value="${env.PROEXT}"/>
86   </target>
87   <target name="build.conditions" depends="product.test,nonproduct.set,product.set">
88       <condition property="win9.build">
89             <available file="${prj}/wntmsci9${proext}"/>
90       </condition>
91       <condition property="win8.build">
92             <available file="${prj}/wntmsci8${proext}"/>
93       </condition>
94       <condition property="win7.build">
95             <available file="${prj}/wntmsci7${proext}"/>
96       </condition>
97       <condition property="linx86.build">
98             <available file="${prj}/unxlngi5${proext}"/>
99       </condition>
100       <condition property="solsparc.build">
101             <available file="${prj}/unxsols4${proext}"/>
102       </condition>
103       <!-- <condition property="openoffice.build">
104       </condition> -->
105   </target>
106   <!-- ===================== Build the examples ========================= -->
107   <target name="buildexamples">
109     <mkdir dir="${out}/class/examples/java/debugger"/>
110     <javac srcdir="${prj}/examples/java/debugger"
111            destdir="${out}/class/examples/java/debugger"
112               includes="*.java"
113            classpathref="debuggerclasspath"
114        debug="${debug}" optimize="${optimize}" deprecation="on"/>
116     <copy todir="${out}/class/examples/java/debugger">
117         <fileset dir="${prj}/examples/java/debugger">
118             <include name="**/*.java"/>
119             <include name="*.xml"/>
120         </fileset>
121     </copy>
123     <jar jarfile="${out}/class/examples/java/debugger/debugger.jar"
124         basedir="${out}/class/examples/java/debugger" includes="*.class">
125         <manifest>
126             <attribute name="Built-By" value="Sun Microsystems"/>
127             <attribute name="ScriptFramework-Version" value="${sfversion}"/>
128         </manifest>
129     </jar>
131     <delete>
132         <fileset dir="${out}/class/examples/java/debugger" includes="*.class"/>
133     </delete>
135     <mkdir dir="${out}/class/examples/java/Highlight"/>
136     <javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/Highlight/"
137               includes="**/Highlight*.java" classpathref="idlclasspath"
138        debug="${debug}" optimize="${optimize}" deprecation="on"/>
139     <copy todir="${out}/class/examples/java/Highlight/">
140         <fileset dir="${prj}/examples/java/">
141             <include name="**/Highlight*.java"/>
142         </fileset>
143     </copy>
144     <copy file="${prj}/examples/java/HighlightTextParcel.xml" tofile="${out}/class/examples/java/Highlight/parcel-descriptor.xml"/>
145     <jar jarfile="${out}/class/examples/java/Highlight/Highlight.jar"
146         basedir="${out}/class/examples/java/Highlight" 
147         includes="**/*.java,**/*.class,**/*.xml"
148         excludes="${out}/class/examples/java/Highlight/Highlight.jar">
149         <manifest>
150             <attribute name="Built-By" value="Sun Microsystems"/>
151             <attribute name="ScriptFramework-Version" value="${sfversion}"/>
152         </manifest>
153     </jar>
154     <mkdir dir="${out}/class/examples/java/MemoryUsage"/>
155     <javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/MemoryUsage/"
156               includes="**/MemoryUsage.java" classpathref="idlclasspath"
157        debug="${debug}" optimize="${optimize}" deprecation="on"/>
158     <copy file="${prj}/examples/java/MemoryUsage.java" todir="${out}/class/examples/java/MemoryUsage/"/>
159     <copy file="${prj}/examples/java/MemoryUsageParcel.xml" tofile="${out}/class/examples/java/MemoryUsage/parcel-descriptor.xml"/>
160     <copy file="${prj}/examples/java/MemoryUsage.java" todir="${out}/class/examples/java/MemoryUsage/"/>
161     <copy file="${prj}/examples/java/ExampleSpreadSheet.sxc" todir="${out}/class/examples/java/MemoryUsage/"/>
163     <mkdir dir="${out}/class/examples/java/ScriptFrmwrkHelper"/>
164     <javac srcdir="${prj}/examples/java/" destdir="${out}/class/examples/java/ScriptFrmwrkHelper/"
165               includes="**/ScriptFrmwrkHelper.java" classpathref="scriptexampleclasspath"
166        debug="${debug}" optimize="${optimize}" deprecation="on"/>
167     <copy todir="${out}/class/examples/java/ScriptFrmwrkHelper/">
168         <fileset dir="${prj}/examples/java/">
169             <include name="**/ScriptFrmwrkHelper.java"/>
170         </fileset>
171     </copy>
172     <copy file="${prj}/examples/java/ScriptFrameWkHelperParcel.xml" tofile="${out}/class/examples/java/ScriptFrmwrkHelper/parcel-descriptor.xml"/>
173     <jar jarfile="${out}/class/examples/java/ScriptFrmwrkHelper/ScriptFrmwrkHelper.jar"
174         basedir="${out}/class/examples/java/ScriptFrmwrkHelper" 
175         includes="**/*.java,**/*.class,**/*.xml"
176         excludes="${out}/class/examples/java/ScriptFrmwrkHelper/ScriptFrmwrkHelper.jar">
177         <manifest>
178             <attribute name="Built-By" value="Sun Microsystems"/>
179             <attribute name="ScriptFramework-Version" value="${sfversion}"/>
180         </manifest>
181     </jar>
182     <mkdir dir="${out}/class/examples/beanshell"/>
183     <copy todir="${out}/class/examples/beanshell">
184         <fileset dir="${prj}/examples/beanshell" includes="**"/>
185     </copy>
186     <mkdir dir="${out}/class/examples/javascript"/>
187     <copy todir="${out}/class/examples/javascript">
188         <fileset dir="${prj}/examples/javascript" includes="**"/>
189     </copy>
190   </target>
192   <!-- ===================== Build UNO package ========================= -->
193   <target name="buildunopackage_win9" depends="build.conditions" if="win9.build">
194     <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
195     <mkdir dir="${out}/class/sframework"/>
196     <copy file="${solar.bin}/ScriptFramework.rdb"
197         todir="${out}/class/sframework/"/> 
198     <copy file="${out}/class/ScriptRuntimeForJava.jar"
199         todir="${out}/class/sframework/"/>
200     <copy file="${out}/class/ScriptFramework.jar"
201         todir="${out}/class/sframework/"/>
202     <mkdir dir="${out}/class/sframework/windows.plt"/>
203     <copy todir="${out}/class/sframework/windows.plt">
204         <fileset dir="${prj}/wntmsci9${proext}/bin/">
205             <include name="**/*.dll"/>
206         </fileset>
207     </copy>
208     <mkdir dir="${out}/class/sframework/skip_registration"/>
209     <copy file="${solar.jar}/unoil.jar"
210         todir="${out}/class/sframework/skip_registration"/>
211   </target>
212   <target name="buildunopackage_win8" depends="build.conditions" if="win8.build">
213     <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
214     <mkdir dir="${out}/class/sframework"/>
215     <copy file="${solar.bin}/ScriptFramework.rdb"
216         todir="${out}/class/sframework/"/> 
217     <copy file="${out}/class/ScriptRuntimeForJava.jar"
218         todir="${out}/class/sframework/"/>
219     <copy file="${out}/class/ScriptFramework.jar"
220         todir="${out}/class/sframework/"/>
221     <mkdir dir="${out}/class/sframework/windows.plt"/>
222     <copy todir="${out}/class/sframework/windows.plt">
223         <fileset dir="${prj}/wntmsci8${proext}/bin/">
224             <include name="**/*.dll"/>
225         </fileset>
226     </copy>
227     <mkdir dir="${out}/class/sframework/skip_registration"/>
228     <copy file="${solar.jar}/unoil.jar"
229         todir="${out}/class/sframework/skip_registration"/>
230   </target>
231 <!--  <target name="buildunopackage_win7" depends="build.conditions" if="win7.build">
232     <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
233     <mkdir dir="${out}/class/sframework"/>
234     <copy file="${solar.bin}/ScriptFramework.rdb"
235         todir="${out}/class/sframework/"/> 
236     <copy file="${out}/class/ScriptRuntimeForJava.jar"
237         todir="${out}/class/sframework/"/>
238     <copy file="${out}/class/ScriptFramework.jar"
239         todir="${out}/class/sframework/"/>
240     <mkdir dir="${out}/class/sframework/windows.plt"/>
241     <copy todir="${out}/class/sframework/windows.plt">
242         <fileset dir="${prj}/wntmsci7${proext}/bin/">
243             <include name="**/*.dll"/>
244         </fileset>
245     </copy>
246     <mkdir dir="${out}/class/sframework/skip_registration"/>
247     <copy file="${solar.jar}/unoil.jar"
248         todir="${out}/class/sframework/skip_registration"/>
249   </target> -->
250   <target name="buildunopackage_linux" depends="build.conditions" if="linx86.build">
251     <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
252     <mkdir dir="${out}/class/sframework"/>
253     <copy file="${solar.bin}/ScriptFramework.rdb"
254         todir="${out}/class/sframework/"/> 
255     <copy file="${out}/class/ScriptRuntimeForJava.jar"
256         todir="${out}/class/sframework/"/>
257     <copy file="${out}/class/ScriptFramework.jar"
258         todir="${out}/class/sframework/"/>
259     <mkdir dir="${out}/class/sframework/linux_x86.plt"/>
260     <copy todir="${out}/class/sframework/linux_x86.plt">
261         <fileset dir="${prj}/unxlngi5${proext}/lib/">
262             <include name="**/lib*.so"/>
263         </fileset>
264     </copy>
265     <mkdir dir="${out}/class/sframework/skip_registration"/>
266     <copy file="${solar.jar}/unoil.jar"
267         todir="${out}/class/sframework/skip_registration"/>
268   </target>
269   <target name="buildunopackage_solaris" depends="build.conditions" if="solsparc.build">
270     <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
271     <mkdir dir="${out}/class/sframework"/>
272     <copy file="${solar.bin}/ScriptFramework.rdb"
273         todir="${out}/class/sframework/"/> 
274     <copy file="${out}/class/ScriptRuntimeForJava.jar"
275         todir="${out}/class/sframework/"/>
276     <copy file="${out}/class/ScriptFramework.jar"
277         todir="${out}/class/sframework/"/>
278     <mkdir dir="${out}/class/sframework/solaris_sparc.plt"/>
279     <copy todir="${out}/class/sframework/solaris_sparc.plt">
280         <fileset dir="${prj}/unxsols4${proext}/lib/">
281             <include name="**/lib*.so"/>
282         </fileset>
283     </copy>
284     <mkdir dir="${out}/class/sframework/skip_registration"/>
285     <copy file="${solar.jar}/unoil.jar"
286         todir="${out}/class/sframework/skip_registration"/>
287   </target>
288   <target name="buildunopackage" depends="buildunopackage_win8,buildunopackage_linux,buildunopackage_solaris">
289   <!-- <target name="buildunopackage" depends="buildunopackage_win9,buildunopackage_win7,buildunopackage_linux,buildunopackage_solaris"> -->
290     <copy file="installer/ProtocolHandler.xcu"
291         todir="${out}/class/sframework/"/>
292     <zip zipfile="${out}/class/sframeworkinstall/sframework/ooscriptframe.zip"
293         basedir="${out}/class/sframework">
294     </zip>
295   </target>
297   <!-- ================== Build JavaScript UNO package ===================== -->
298   <target name="buildjsuno">
299     <mkdir dir="${out}/class/sframeworkinstall/sframework"/>
301     <mkdir dir="${out}/class/jsruntime"/>
302     <mkdir dir="${out}/class/jsruntime/skip_registration"/>
303     <mkdir dir="${out}/class/jsruntimetmp"/>
305     <copy file="${out}/class/ScriptRuntimeForJavaScript.jar"
306         todir="${out}/class/jsruntime/"/>
307     <copy file="installer/Scripting.JavaScript.xcu"
308         tofile="${out}/class/jsruntime/Scripting.xcu"/>
310     <unzip src="${install.dir}/js.jar"
311         dest="${out}/class/jsruntimetmp"/>
313     <javac srcdir="${prj}/examples/java/debugger"
314            destdir="${out}/class/jsruntimetmp"
315               includes="rhino/Main.java" classpathref="debuggerclasspath"
316        debug="${debug}" optimize="${optimize}" deprecation="on"/>
318     <zip destfile="${out}/class/jsruntime/skip_registration/js.jar"
319         basedir="${out}/class/jsruntimetmp" includes="**"/>
321     <zip zipfile="${out}/class/sframeworkinstall/sframework/jsruntime.zip"
322         basedir="${out}/class/jsruntime">
323     </zip>
324   </target>
326   <!-- =================== Build BeanShell UNO package ===================== -->
327   <target name="buildbshuno">
328     <mkdir dir="${out}/class/bshruntime"/>
329     <copy file="${out}/class/ScriptRuntimeForBeanShell.jar"
330         todir="${out}/class/bshruntime/"/>
331     <copy file="installer/Scripting.BeanShell.xcu"
332         tofile="${out}/class/bshruntime/Scripting.xcu"/>
333     <mkdir dir="${out}/class/bshruntime/skip_registration"/>
334     <copy file="${install.dir}/bsh-1.2b7.jar"
335         todir="${out}/class/bshruntime/skip_registration"/>
336     <zip zipfile="${out}/class/sframeworkinstall/sframework/bshruntime.zip"
337         basedir="${out}/class/bshruntime">
338     </zip>
339   </target>
341   <!-- ========= Package schema, scripts, dialogs & examples =========== -->
342   <target name="packagedialogsandexamples" depends="buildexamples">
343     <mkdir dir="${out}/class/sframeworkinstall/schema"/>
344     <copy file="installer/Scripting.xcs"
345         todir="${out}/class/sframeworkinstall/schema/"/>
346     <mkdir dir="${out}/class/sframeworkinstall/bindingdialog"/>
347     <copy todir="${out}/class/sframeworkinstall/bindingdialog">
348         <fileset dir="bindings/">
349             <include name="**/*.x*"/>
350         </fileset>
351     </copy>
352     <mkdir dir="${out}/class/sframeworkinstall/examples"/>
353     <copy todir="${out}/class/sframeworkinstall/examples">
354         <fileset dir="${out}/class/examples/"/>
355     </copy>
356   </target>
358   <!-- ===================== Package IDEs ================================== -->
359   <target name="packageide">
360     <mkdir dir="${out}/class/sframeworkinstall/ide"/>
361     <copy todir="${out}/class/sframeworkinstall/ide">
362         <fileset dir="${out}/class/">
363             <include name="idesupport.jar"/>
364             <include name="office.jar"/>
365         </fileset>
366     </copy>
367   </target>
369   <!-- ======================== Compile Classes ========================== -->
370   <target name="compileinstaller">
371     <mkdir dir="${installerclasses}"/>
372     <javac srcdir="installer/" destdir="${installerclasses}"
373               includes="**/*.java" classpathref="idlclasspath"
374        debug="${debug}" optimize="${optimize}" deprecation="on"/>
375     <copy file="installer/sidebar.jpg" todir="${out}/class/sframeworkinstall/installer"/>
376   </target>
378   <!-- ===================== jar ========================= -->
379   <target name="jar" depends="buildunopackage,buildbshuno,buildjsuno,compileinstaller,packagedialogsandexamples,packageide">
380     <jar jarfile="${jardir}/${installerjarname}"
381          basedir="${installerclasses}">
382         <manifest>
383             <attribute name="Built-By" value="Sun Microsystems"/>
384             <attribute name="ScriptFramework-Version" value="${sfversion}"/>
385             <attribute name="Main-Class" value="installer.InstallWizard"/>
386         </manifest>
387     </jar>
388   </target>
390   <!-- ====================== Clean Generated Files ===================== -->
391   <target name="clean">
392     <delete dir="${scriptingclasses}"/>
393     <delete dir="${storageclasses}"/>
394     <delete dir="${jardir}/${scriptingjarname}"/>
395   </target>
397   <!-- ========================= All In One Build ======================= -->
398   <target name="all" depends="clean,jar"/>
401 </project>