3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 Copyright 2008 by Sun Microsystems, Inc.
7 OpenOffice.org - a multi-platform office productivity suite
9 $RCSfile: build.xml,v $
11 $Revision: 1.36.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.
31 <project name="Scipting Framework" default="all" basedir=".">
33 <!-- =================== Environmental Properties ======================= -->
35 <property name="prj" value=".."/>
36 <property name="build.compiler" value="classic"/>
37 <property name="optimize" value="off"/>
38 <property name="debug" value="on"/>
39 <property name="jardir" value="${out}/class"/>
40 <property name="bindir" value="${out}/bin"/>
41 <property name="idesupport.dir" value="org/openoffice/idesupport"/>
42 <property name="netbeans.dir" value="org/openoffice/netbeans/modules/office"/>
43 <property name="framework.dir" value="Framework/com/sun/star/script/framework/security"/>
45 <!-- Change this property if you are building NetBeans editor support jar.
46 Not needed in default build -->
47 <property name="netbeans.install.path" value="/export/home/netbeans"/>
49 <property environment="env"/>
50 <property name="env.BSH_JAR" value="${solar.jar}/bsh.jar"/>
52 <!-- ==================== classpath setting ============================ -->
53 <path id="idlclasspath">
54 <pathelement location="${solar.jar}/jurt.jar"/>
55 <pathelement location="${solar.jar}/unoil.jar"/>
56 <pathelement location="${solar.jar}/juh.jar"/>
57 <pathelement location="${solar.jar}/java_uno.jar"/>
58 <pathelement location="${solar.jar}/ridl.jar"/>
59 <pathelement location="${env.BSH_JAR}"/>
60 <pathelement location="${solar.jar}/js.jar"/>
61 <pathelement location="${jardir}"/>
64 <path id="idesupport.class.path">
65 <pathelement path="${jardir}"/>
68 <path id="openide.class.path">
69 <pathelement path="${jardir}"/>
70 <pathelement path="${solar.jar}/openide.jar"/>
73 <path id="netbeans.editor.support.classpath">
74 <pathelement path="${jardir}"/>
75 <pathelement path="${netbeans.install.path}/modules/ext/nb-editor.jar"/>
78 <condition property="boot_refID" value="macPath" else="nonMacPath">
84 <path id="macPath" location="${java.home}/../Classes/classes.jar"/>
85 <!-- rhino.jar from OpenJDK breaks build -->
86 <path id="nonMacPath">
87 <fileset dir="${java.home}/">
88 <include name="jre/lib/*.jar"/>
89 <include name="lib/*.jar"/>
90 <exclude name="jre/lib/rhino.jar"/>
91 <exclude name="lib/rhino.jar"/>
94 <path id="my.bootstrap.classpath" refID="${boot_refID}"/>
96 <!-- ===================== Prepare Directories ========================= -->
97 <target name="prepare">
98 <mkdir dir="${jardir}"/>
101 <!-- ======================== Compile Classes ========================== -->
102 <target name="compile" depends="prepare">
103 <javac srcdir="com" destdir="${jardir}"
104 includes="**/*.java" classpathref="idlclasspath"
105 debug="${debug}" optimize="${optimize}" deprecation="off">
106 <compilerarg value="-Xbootclasspath:${toString:my.bootstrap.classpath}"/>
108 <javac srcdir="Framework/" destdir="${jardir}"
109 includes="**/*.java" classpathref="idlclasspath" debug="${debug}"
110 optimize="${optimize}" deprecation="off">
111 <compilerarg value="-Xbootclasspath:${toString:my.bootstrap.classpath}"/>
115 <target name="idesupport.compile" depends="compile, prepare">
116 <javac srcdir="." destdir="${jardir}"
117 debug="${debug}" deprecation="on">
118 <classpath refid="idesupport.class.path"/>
119 <exclude name="${idesupport.dir}/**/.*/*"/>
120 <exclude name="${idesupport.dir}/localoffice/**/*"/>
121 <exclude name="${idesupport.dir}/LocalOffice.java"/>
122 <include name="${idesupport.dir}/*.java"/>
123 <include name="${idesupport.dir}/*/*.java"/>
127 <target name="localoffice.compile" depends="prepare">
128 <javac srcdir="." destdir="${jardir}"
129 debug="${debug}" deprecation="on">
130 <classpath refid="idlclasspath"/>
131 <exclude name="${idesupport.dir}/localoffice/.*/*"/>
132 <include name="${idesupport.dir}/localoffice/*.java"/>
136 <target name="netbeans.compile" depends="idesupport.compile, prepare">
137 <javac srcdir="." destdir="${jardir}"
138 debug="${debug}" deprecation="on">
139 <classpath refid="openide.class.path"/>
140 <exclude name="${netbeans.dir}/**/.*/*"/>
141 <include name="${netbeans.dir}/**/*.java"/>
145 <target name="netbeans.editor.support" depends="prepare">
146 <javac srcdir="." destdir="${jardir}"
147 debug="${debug}" deprecation="on">
148 <classpath refid="netbeans.editor.support.classpath"/>
149 <include name="org/openoffice/netbeans/editor/*.java"/>
151 <jar jarfile="${jardir}/nb-editorsupport.jar">
152 <fileset dir="${jardir}">
153 <include name="org/openoffice/netbeans/editor/*.class"/>
156 <include name="org/openoffice/netbeans/editor/OOo.jcs"/>
157 <include name="org/openoffice/netbeans/editor/OOo.jcb"/>
162 <!-- ===================== jar ========================= -->
163 <target name="jar" depends="compile">
164 <jar jarfile="${jardir}/ScriptProviderForJava.jar"
167 <attribute name="Built-By" value="Sun Microsystems"/>
168 <attribute name="RegistrationClassName"
169 value="com.sun.star.script.framework.provider.java.ScriptProviderForJava"/>
170 <attribute name="Class-Path" value="ScriptFramework.jar"/>
171 <attribute name="UNO-Type-Path" value=""/>
173 <include name="**/provider/java/*.class"/>
176 <jar jarfile="${jardir}/ScriptProviderForBeanShell.jar"
179 <attribute name="Built-By" value="Sun Microsystems"/>
180 <attribute name="RegistrationClassName"
181 value="com.sun.star.script.framework.provider.beanshell.ScriptProviderForBeanShell"/>
182 <attribute name="Class-Path" value="ScriptFramework.jar bsh.jar"/>
183 <attribute name="UNO-Type-Path" value=""/>
185 <include name="**/provider/beanshell/*.class"/>
187 <include name="**/provider/beanshell/*.bsh"/>
191 <jar jarfile="${jardir}/ScriptProviderForJavaScript.jar"
194 <attribute name="Built-By" value="Sun Microsystems"/>
195 <attribute name="RegistrationClassName"
196 value="com.sun.star.script.framework.provider.javascript.ScriptProviderForJavaScript"/>
197 <attribute name="Class-Path" value="ScriptFramework.jar js.jar"/>
198 <attribute name="UNO-Type-Path" value=""/>
200 <include name="**/provider/javascript/*.class"/>
202 <include name="**/provider/javascript/*.js"/>
206 <jar jarfile="${jardir}/ScriptFramework.jar"
209 <attribute name="Built-By" value="Sun Microsystems"/>
210 <attribute name="RegistrationClassName"
211 value="com.sun.star.script.framework.security.SecurityDialog"/>
212 <attribute name="UNO-Type-Path" value=""/>
214 <include name="**/security/*"/>
215 <include name="**/log/*.class"/>
216 <include name="**/provider/*.class"/>
217 <include name="**/browse/*.class"/>
218 <include name="**/container/*.class"/>
219 <include name="**/io/*.class"/>
224 <target name="idesupport.jar" depends="idesupport.compile">
225 <jar jarfile="${jardir}/idesupport.jar">
226 <fileset dir="${jardir}">
227 <include name="${idesupport.dir}/**/*.class"/>
228 <include name="CommandLineTools*"/>
229 <exclude name="${idesupport.dir}/localoffice/*.class"/>
232 <include name="${idesupport.dir}/ui/add.gif"/>
237 <target name="localoffice.jar" depends="localoffice.compile">
239 src="${solar.jar}/unoil.jar"
241 <jar jarfile="${jardir}/localoffice.jar">
242 <fileset dir="${jardir}">
243 <include name="${idesupport.dir}/localoffice/*.class"/>
244 <include name="drafts/com/sun/star/script/framework/storage/*.class"/>
249 <target name="netbeans.jar" depends="netbeans.compile">
250 <jar jarfile="${jardir}/office.jar" manifest="manifest.mf">
251 <fileset dir="${jardir}">
252 <include name="${netbeans.dir}/**/*.class"/>
253 <exclude name="${netbeans.dir}/**/ParcelDescriptorChildren.class"/>
254 <exclude name="${netbeans.dir}/**/ScriptNode.class"/>
255 <include name="${idesupport.dir}/**/*.class"/>
256 <include name="CommandLineTools*"/>
259 <include name="${idesupport.dir}/ui/add.gif"/>
260 <include name="${netbeans.dir}/resources/*"/>
261 <include name="${netbeans.dir}/resources/templates/*"/>
262 <include name="${netbeans.dir}/**/Bundle*"/>
267 <!-- Uncomment this target when building within NetBeans to reinstall the
269 <target name="netbeans.install" depends="netbeans.package">
270 <copy file="${jardir}/localoffice.jar"
271 tofile="${netbeans.home}/modules/ext/localoffice.jar"/>
272 <nbinstaller action="reinstall" module="${jardir}/office.jar"/>
276 <!-- ====================== Clean Generated Files ===================== -->
277 <target name="clean">
278 <delete file="${jardir}/ScriptProviderForJava.jar"/>
279 <delete file="${jardir}/ScriptProviderForJavaScript.jar"/>
280 <delete file="${jardir}/ScriptProviderForBeanShell.jar"/>
281 <delete file="${jardir}/ScriptFramework.jar"/>
282 <delete file="${jardir}/office.jar"/>
283 <delete file="${jardir}/localoffice.jar"/>
284 <delete file="${jardir}/idesupport.jar"/>
287 <!-- ========================= All In One Build ======================= -->
288 <target name="all" depends="jar"/>