1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--***********************************************************************
4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 Copyright 2008 by Sun Microsystems, Inc.
8 OpenOffice.org - a multi-platform office productivity suite
10 $RCSfile: build.xml,v $
14 This file is part of OpenOffice.org.
16 OpenOffice.org is free software: you can redistribute it and/or modify
17 it under the terms of the GNU Lesser General Public License version 3
18 only, as published by the Free Software Foundation.
20 OpenOffice.org is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU Lesser General Public License version 3 for more details
24 (a copy is included in the LICENSE file that accompanied this code).
26 You should have received a copy of the GNU Lesser General Public License
27 version 3 along with OpenOffice.org. If not, see
28 <http://www.openoffice.org/license.html>
29 for a copy of the LGPLv3 License.
31 ************************************************************************ -->
32 <project default="all">
34 <property environment="env"/>
35 <property name="ext" value="oxt"/>
36 <property name="officeroot" value="/export/home/mav/OFFICES/OOG680/m5_netbeans_pro"/>
37 <property name="office.home" value="${officeroot}"/>
39 <!-- fallbacks for locations, when solenv is not used -->
40 <condition property="target" value="wikiaddon">
41 <not><isset property="target"/></not>
43 <condition property="out" value="./build">
44 <not><isset property="out"/></not>
46 <condition property="solar.jar" value="${officeroot}/program/classes">
47 <not><isset property="solar.jar"/></not>
50 <!-- locations used throughout the build -->
51 <property name="name" value="wiki-publisher"/>
52 <property name="dist" value="${out}/bin"/>
53 <property name="classes" value="${out}/class"/>
54 <property name="classes.test" value="${out}/class-test"/>
55 <property name="officeclasses" value="${solar.jar}"/>
57 <!-- build options -->
58 <property name="sourcelevel" value="1.4"/>
59 <property name="verbose" value="false"/>
60 <property name="debug" value="true"/>
62 <!-- build classpath -->
64 <pathelement location="${officeclasses}/juh.jar"/>
65 <pathelement location="${officeclasses}/jurt.jar"/>
66 <pathelement location="${officeclasses}/ridl.jar"/>
67 <pathelement location="${officeclasses}/unoil.jar"/>
68 <!-- 3rd party libs -->
69 <pathelement location="${commons-codec-jar}"/>
70 <pathelement location="${commons-httpclient-jar}"/>
71 <pathelement location="${commons-lang-jar}"/>
72 <pathelement location="${commons-logging-jar}"/>
75 <!-- create output directories -->
76 <mkdir dir="${classes}"/>
77 <mkdir dir="${classes.test}"/>
78 <mkdir dir="${dist}"/>
81 <target name="compile" depends="init">
82 <javac debug="${debug}" destdir="${classes}" classpathref="classpath"
83 source="${sourcelevel}" verbose="${verbose}">
88 <target name="xcucheck" depends="init">
89 <condition property="no.merge.present">
91 <available file="${out}/misc/${target}/merge/org/openoffice/Office/Custom/WikiExtension.xcu" type="file"/>
96 <target name="xcumerge" depends="xcucheck, init" if="no.merge.present">
97 <copy todir="${out}/misc/${target}/merge">
98 <fileset dir="${out}/misc/${target}/registry/data" includes="**/*.xcu" casesensitive="yes"/>
102 <target name="jar" depends="compile, init">
103 <jar basedir="${classes}" compress="true" jarfile="${dist}/${target}.jar">
105 <!-- FIXME: Set Class-Path correctly for the system case !-->
106 <attribute name="Class-Path" value="commons-codec-1.3.jar commons-lang-2.3.jar commons-httpclient-3.1.jar commons-logging-1.1.1.jar"/>
107 <attribute name="RegistrationClassName" value="com.sun.star.wiki.WikiEditorImpl"/>
112 <target name="tmpdir" depends="xcumerge, jar, init">
113 <copy todir="${out}/misc/${target}/package_tmp" overwrite="true" encoding="UTF-8">
114 <fileset dir="${out}/misc/${target}" includes="description.xml" casesensitive="yes"/>
115 <fileset dir="${out}/misc/${target}/registry/schema/org/openoffice/Office/Custom" includes="*.xcs" casesensitive="yes"/>
116 <fileset dir="${out}/misc/${target}/registry/data/org/openoffice/Office" includes="ProtocolHandler.xcu,Paths.xcu" casesensitive="yes"/>
117 <fileset dir="${out}/misc/${target}/merge/org/openoffice/Office/Custom" includes="*.xcu" casesensitive="yes"/>
118 <fileset dir="${out}/misc/${target}/merge/org/openoffice/Office" includes="*.xcu" casesensitive="yes"/>
119 <!-- FIXME: currently the build xcu files can not be used since the tag containing x-default attribute is thrown away, issue 99378
120 <fileset dir="${out}/misc/${target}/merge/org/openoffice/TypeDetection" includes="*.xcu" casesensitive="yes"/>
122 <fileset dir="src/registry/data/org/openoffice/TypeDetection" includes="*.xcu" casesensitive="yes"/>
123 <fileset dir="${out}/misc/${target}" includes="help/component.txt" casesensitive="yes"/>
125 <filter token="WIKIEXTENSIONPRODUCTNAME" value="Wiki Publisher"/>
126 <filter token="WIKIEXTENSIONID" value="com.sun.wiki-publisher"/>
127 <filter token="WIKIEXTENSIONFILENAME" value="${name}"/>
130 <copy todir="${out}/misc/${target}/package_tmp/help" overwrite="true" encoding="UTF-8">
131 <fileset dir="${out}/misc/${target}/help" includes="**/*.xhp" casesensitive="yes"/>
133 <filter token="WIKIEXTENSIONPRODUCTNAME" value="Wiki Publisher"/>
134 <filter token="WIKIEXTENSIONID" value="com.sun.wiki-publisher"/>
135 <filter token="WIKIEXTENSIONFILENAME" value="${name}"/>
137 <mapper type="regexp" from="^(.*[/\\])com.sun.sun-mediawiki([/\\].*)" to="\1com.sun.wiki-publisher\2"/>
141 <target name="uno-package" depends="tmpdir, xcumerge, jar, init">
142 <delete file="${dist}/${name}.${ext}"/>
143 <zip destfile="${dist}/${name}.${ext}">
144 <fileset dir="${out}/misc/${target}/package_tmp" casesensitive="yes"/>
145 <fileset dir="${dist}" includes="${target}.jar" casesensitive="yes"/>
146 <file file="${commons-codec-jar}"/>
147 <file file="${commons-httpclient-jar}"/>
148 <file file="${commons-lang-jar}"/>
149 <file file="${commons-logging-jar}"/>
150 <zipfileset file="${solar.bin}/xslt/export/wiki/odt2mediawiki.xsl" casesensitive="yes" fullpath="filter/odt2mediawiki.xsl"/>
151 <zipfileset file="${solar.bin}/xslt/export/wiki/mediawiki.ott" casesensitive="yes" fullpath="templates/MediaWiki/mediawiki.ott"/>
152 <zipfileset dir="${solar.bin}/xslt/export/xsltml" casesensitive="yes" prefix="filter/math"/>
153 <zipfileset dir="src" includes="uno-extension-manifest.xml" casesensitive="yes" fullpath="META-INF/manifest.xml"/>
154 <zipfileset dir="dialogs" includes="**/*.xdl,**/*.xba,**/*.xlb" casesensitive="yes" prefix="WikiEditor"/>
155 <zipfileset dir="src" includes="THIRDPARTYLICENSEREADME.html" casesensitive="yes" prefix="license"/>
159 <target name="development-package" depends="jar, init">
160 <delete file="${dist}/${target}_develop.zip"/>
161 <zip destfile="${dist}/${target}_develop.zip">
162 <fileset dir="${dist}" includes="${target}.jar" casesensitive="yes"/>
163 <fileset dir="${out}/misc/${target}" includes="description.xml" casesensitive="yes"/>
164 <fileset dir="${out}/misc/${target}/registry/schema/org/openoffice/Office/Custom" includes="*.xcs" casesensitive="yes"/>
165 <fileset dir="${out}/misc/${target}/registry/data/org/openoffice/Office" includes="ProtocolHandler.xcu,Paths.xcu" casesensitive="yes"/>
166 <fileset dir="${out}/misc/${target}/merge/org/openoffice/Office/Custom" includes="*.xcu" casesensitive="yes"/>
167 <fileset dir="${out}/misc/${target}/merge/org/openoffice/Office" includes="*.xcu" casesensitive="yes"/>
168 <!-- FIXME: currently the build xcu files can not be used since the tag containing x-default attribute is thrown away, issue 99378
169 <fileset dir="${out}/misc/${target}/merge/org/openoffice/TypeDetection" includes="*.xcu" casesensitive="yes"/>
171 <fileset dir="src/registry/data/org/openoffice/TypeDetection" includes="*.xcu" casesensitive="yes"/>
172 <zipfileset dir="${out}/misc/${target}/help" includes="**/*.xhp,component.txt" casesensitive="yes" prefix="help"/>
173 <zipfileset dir="dialogs" includes="**/*.xdl,**/*.xba,**/*.xlb" casesensitive="yes" prefix="WikiEditor"/>
174 <zipfileset dir="src" includes="uno-extension-manifest.xml" casesensitive="yes" fullpath="META-INF/manifest.xml"/>
175 <zipfileset dir="src" includes="THIRDPARTYLICENSEREADME.html" casesensitive="yes" prefix="license"/>
179 <target depends="init, jar, uno-package, development-package" description="Build everything." name="all">
180 <echo message="${name} built."/>
183 <target depends="init" description="Clean all build products." name="clean">
184 <delete dir="${classes}/com/sun/star/wiki"/>
185 <delete dir="${out}/misc/${target}"/>
186 <delete dir="${dist}/${target}.jar"/>
187 <delete dir="${dist}/${name}.${ext}"/>
188 <delete dir="${dist}/${target}_develop.zip"/>
191 <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
193 <target name="uno-deploy" description="Deploys UNO extension package" depends="uno-package">
194 <echo message="deploying UNO extension package ..."/>
195 <echo message="${office.unopkg} add -f ${uno.package.name}"/>
196 <exec executable="${office.unopkg}" dir="${office.program.dir}" failonerror="true">
199 <arg file="${uno.package.name}"/>
203 <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
205 <target name="uno-debug" description="Debugss UNO extension package in Target Office" depends="uno-package">
206 <!-- security fail for executing this without netbeans -->
207 <fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
208 <!-- start debugger and get connection address jpda.address -->
209 <nbjpdastart name="Debug Office" addressproperty="jpda.address" transport="dt_socket">
210 <classpath path="${build.classes.dir}"/>
211 <sourcepath path="${src.dir}"/>
213 <!-- register component in temporaary user installation -->
214 <echo message="debugging UNO extension package ..."/>
215 <echo message="wait until preparation is finished."/>
216 <echo message=" deploying UNO extension package for debugging ..."/>
217 <echo message=" ${office.unopkg} add -f ${uno.package.name}"/>
218 <exec executable="${office.unopkg}" dir="${office.program.dir}">
221 <arg file="${uno.package.name}"/>
222 <env key="UserInstallation" value="${office.debug.user.directory}"/>
224 <!-- start Office with debug Java and user installation -->
225 <echo message=" starting the Office with ..."/>
226 <echo message=" user installation: ${office.debug.user.directory}"/>
227 <echo message=" debug options: "-Xdebug" "-Xrunjdwp:transport=dt_socket,address=${jpda.address}""/>
228 <echo message=" ${office.soffice}"/>
229 <echo message="preparation finished."/>
230 <exec executable="${office.soffice}" dir="${office.program.dir}" failonerror="true">
231 <env key="UserInstallation" value="${office.debug.user.directory}"/>
232 <env key="JAVA_TOOL_OPTIONS" value=""-Xdebug" "-Xrunjdwp:transport=dt_socket,address=${jpda.address}""/>