1
<?xml version="1.0" encoding="UTF-8"?>
3
*** AUTOMATICALLY GENERATED - DO NOT EDIT ***
4
*** EDIT ../build.xml INSTEAD ***
6
<project basedir=".." default="netbeans" name="OOCalcAddin_PVuno-impl">
7
<description>Builds, tests, and runs an UNO project.</description>
8
<import file="build-impl.xml"/>
9
<!-- ================================================================================== -->
10
<target depends="-do-init" name="-uno-project-init">
11
<property file="nbproject/project-uno.properties"/>
12
<property name="build.uno.version" value="1.1.4"/>
13
<!-- set variablers from SDK and Office -->
14
<echo message="setting up UNO environment ..."/>
15
<property name="office.unopkg" value="${office.program.dir}${file.separator}unopkg"/>
16
<property name="office.soffice" value="${office.program.dir}${file.separator}soffice"/>
17
<property location="${oo.sdk.dir}${file.separator}idl" name="sdk.idl.dir"/>
18
<property name="sdk.idlc" value="${sdk.bin.dir}${file.separator}idlc"/>
19
<property name="sdk.regmerge" value="${sdk.bin.dir}${file.separator}regmerge"/>
20
<property name="sdk.javamaker" value="${sdk.bin.dir}${file.separator}javamaker"/>
21
<dirname file="build.xml" property="project.dir"/>
22
<property name="uno.package.name" value="${project.dir}${file.separator}${dist.dir}${file.separator}${project.name}.oxt"/>
23
<property name="src.dir.absolute" value="${project.dir}${file.separator}${src.dir}"/>
24
<property name="idl.out" value="${project.dir}${file.separator}${build.dir}${file.separator}idl"/>
25
<property name="idl.out.urd" value="${idl.out}/urd"/>
26
<property name="idl.out.rdb" value="${idl.out}/rdb"/>
27
<property name="idl.rdb.name" value="types.rdb"/>
28
<property name="idl.rdb.fullpath" value="${idl.out.rdb}/${idl.rdb.name}"/>
29
<property name="images.base.dir" value="${build.dir}/img"/>
30
<mkdir dir="${idl.out}"/>
31
<mkdir dir="${idl.out.urd}"/>
32
<mkdir dir="${idl.out.rdb}"/>
33
<mkdir dir="${images.base.dir}"/>
35
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
36
<!-- handle images -->
37
<target depends="-uno-project-init" description="check images" name="-uno-images-condition">
38
<available file="${images.dir}" property="images.required" type="dir"/>
40
<target depends="-uno-images-condition" description="copy images" if="images.required" name="images">
41
<mkdir dir="${images.base.dir}/${images.dir}"/>
42
<copy todir="${images.base.dir}/${images.dir}">
43
<fileset dir="${images.dir}"/>
46
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
47
<target depends="-uno-project-init" description="check idlc dependencies" name="-uno-idl-idlc-condition">
48
<uptodate property="idlc.notRequired" targetfile="${build.dir}/idlc.compile">
49
<srcfiles dir="${src.dir}" includes="**/*.idl"/>
52
<!-- compile UNO idl files: execution -->
53
<target depends="-uno-idl-idlc-condition" description="Compile the IDL Conditionally" name="-uno-idl-idlc" unless="idlc.notRequired">
54
<echo message="${sdk.idlc}"/>
55
<echo message="${office.tool.path}"/>
56
<apply dir="${office.program.dir}" executable="${sdk.idlc}" failonerror="true">
57
<env key="PATH" path="${office.tool.path}"/>
58
<env key="LD_LIBRARY_PATH" path="${office.tool.path}"/>
59
<env key="DYLD_LIBRARY_PATH" path="${office.tool.path}"/>
62
<arg value="${idl.out.urd}"/>
64
<arg value="${src.dir.absolute}"/>
66
<arg value="${sdk.idl.dir}"/>
67
<fileset casesensitive="yes" dir="${src.dir}" id="idl.list.id" includes="**/*.idl"/>
69
<!-- list for copying idl files in own jar -->
70
<property name="idl.file" refid="idl.list.id"/>
71
<propertyfile file="${idl.out}/idl_list.properties">
72
<entry key="idl.file.list" value="${idl.file}"/>
74
<replace file="${idl.out}/idl_list.properties" token=".idl" value=".class"/>
75
<replace file="${idl.out}/idl_list.properties" token=";" value=","/>
77
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
78
<!-- merge urd files: execution -->
79
<target depends="-uno-idl-idlc,-uno-idl-idlc-condition" description="Merge urd Files Conditionally" name="-uno-idl-regmerge" unless="idlc.notRequired">
80
<!-- to only extract the new files, delete the old rdb -->
81
<delete file="${idl.rdb.fullpath}"/>
82
<apply dir="${office.program.dir}" executable="${sdk.regmerge}" failonerror="true">
83
<env key="PATH" path="${office.tool.path}"/>
84
<env key="LD_LIBRARY_PATH" path="${office.tool.path}"/>
85
<env key="DYLD_LIBRARY_PATH" path="${office.tool.path}"/>
86
<arg file="${idl.rdb.fullpath}"/>
88
<fileset casesensitive="yes" dir="${idl.out.urd}" includes="**/*.urd"/>
91
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
92
<!-- should javamaker be executed -->
93
<target depends="-uno-idl-regmerge,-uno-idl-idlc-condition" description="check if rdb was created" name="-uno-idl-javamaker-condition">
94
<available file="${idl.rdb.name}" filepath="${idl.out.rdb}" property="javamaker.Required"/>
96
<!-- generate Java class files from type library: execution -->
97
<target depends="-uno-idl-regmerge,-uno-idl-idlc-condition,-uno-idl-javamaker-condition" if="javamaker.Required" name="-uno-idl-javamaker" unless="idlc.notRequired">
98
<echo message="generating java class files from rdb..."/>
99
<exec dir="${office.program.dir}" executable="${sdk.javamaker}" failonerror="true">
100
<env key="PATH" path="${office.tool.path}"/>
101
<env key="LD_LIBRARY_PATH" path="${office.tool.path}"/>
102
<env key="DYLD_LIBRARY_PATH" path="${office.tool.path}"/>
105
<arg value="${project.dir}${file.separator}${build.classes.dir}"/>
106
<arg file="${idl.rdb.fullpath}"/>
107
<arg value="${oo.unotypes.rdb}"/>
108
<!-- from ConfigurationSettings -->
109
<arg value="${oo.offapi.rdb}"/>
110
<!-- from ConfigurationSettings -->
113
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
114
<target depends="-uno-idl-javamaker" name="-uno-idl-result">
115
<touch file="${build.dir}/idlc.compile"/>
116
<echo message="build UNO idl files finished"/>
118
<!-- the main target, called in recursive builds -->
119
<target depends="-uno-idl-result" description="Compiles UNO idl files" name="uno-idl-compile"/>
120
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
121
<target depends="-uno-project-init,uno-idl-compile,-jar-idl-types,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-openoffice-manifest,-post-jar" name="jar">
122
<jar basedir="${build.classes.dir}" compress="true" excludes="**/*.xcu,**/*.xcs,**/*.idl,**/*.xml,**/*.txt,${idl.file.list}" filesonly="true" jarfile="${dist.jar}" manifest="${build.dir}/MANIFEST.MF"/>
124
<target depends="-do-uno-types" name="-jar-idl-types" unless="no.idl.files">
125
<mkdir dir="${dist.dir}"/>
126
<jar basedir="${build.classes.dir}" compress="true" includes="${idl.file.list}" jarfile="${dist.dir}/IDL_types.jar">
128
<attribute name="UNO-Type-Path" value="<>"/>
132
<target depends="-copy-user-manifest,-external-jars,-do-registration,-do-class-path" name="-do-openoffice-manifest"/>
133
<!-- macro for checking manifest entries from a user manifest -->
134
<macrodef name="check-manifest-entry">
135
<attribute name="entry.name"/>
136
<attribute name="condition.property.name"/>
138
<condition property="@{condition.property.name}">
140
<!-- if file does not exist, "isfileselected" is not executed -->
141
<!-- necessary construct because available is not allowed here
142
but should be according to documentation -->
143
<istrue value="${build.manifest.exists}"/>
144
<!-- produces an error if file is not there -->
145
<isfileselected file="${build.dir}/MANIFEST.MF">
146
<contains text="@{entry.name}"/>
152
<!-- enter the class path with external jars, if external jars exit and the user did not enter his own -->
153
<target depends="-external-jars,-check-class-path" name="-do-class-path" unless="class.path.exists">
154
<manifest file="${build.dir}/MANIFEST.MF" mode="update">
155
<attribute name="Class-Path" value="${external.jars}"/>
158
<target name="-check-class-path">
159
<check-manifest-entry condition.property.name="class.path.exists" entry.name="Class-Path"/>
161
<!-- enter idl type definitions if it exists and if the user did not overwrite it -->
162
<target depends="-do-empty-unopath,-do-idl-unopath" name="-do-uno-types"/>
163
<target depends="-check-uno-types" if="own.idl.files" name="-do-idl-unopath" unless="uno.path.exists">
164
<manifest file="${build.dir}/MANIFEST.MF" mode="update">
165
<attribute name="UNO-Type-Path" value="IDL_types.jar"/>
168
<target depends="-check-uno-types" if="no.idl.files" name="-do-empty-unopath" unless="uno.path.exists">
169
<manifest file="${build.dir}/MANIFEST.MF" mode="update">
170
<attribute name="UNO-Type-Path" value=""/>
173
<target name="-check-uno-types">
174
<property file="${idl.out}/idl_list.properties"/>
175
<check-manifest-entry condition.property.name="uno.path.exists" entry.name="UNO-Type-Path"/>
176
<condition property="no.idl.files">
177
<equals arg1="${idl.file.list}" arg2="" trim="true"/>
179
<condition property="own.idl.files">
181
<istrue value="${no.idl.files}"/>
185
<!-- enter the registration classes unless the user did not enter his own. Do nothing when the project is old -->
186
<target depends="-do-central-registration,-check-registration-classes-name" if="new.project.registration" name="-do-registration" unless="do.no.registration">
187
<manifest file="${build.dir}/MANIFEST.MF" mode="update">
188
<section name="${slash.registration.class}">
189
<attribute name="RegistrationClasses" value="${registration.classname}"/>
193
<target name="-check-registration-classes-name">
194
<check-manifest-entry condition.property.name="registration.classes.exists" entry.name="RegistrationClasses"/>
195
<condition property="do.no.registration">
197
<istrue value="${registration.classes.exists}"/>
198
<istrue value="${registration.class.exists}"/>
202
<!-- enter the registration class name unless the user did not enter his own. Do nothing when the project is old -->
203
<target depends="-check-registration-class-name,-do-old-project-registration" if="new.project.registration" name="-do-central-registration" unless="registration.class.exists">
204
<property name="regclass.properties" value="${build.dir}/regclass.properties"/>
205
<propertyfile file="${regclass.properties}">
206
<entry key="dot.registration" value="${slash.registration.class}"/>
208
<replace file="${regclass.properties}" token=".class" value=""/>
209
<replace file="${regclass.properties}" token="/" value="."/>
210
<property file="${regclass.properties}"/>
211
<manifest file="${build.dir}/MANIFEST.MF" mode="update">
212
<attribute name="RegistrationClassName" value="${dot.registration}"/>
215
<target name="-check-registration-class-name">
216
<check-manifest-entry condition.property.name="registration.class.exists" entry.name="RegistrationClassName"/>
218
<!-- Do the registration for older projects without a central registration class -->
219
<target depends="-check-for-old-project" if="old.project.registration" name="-do-old-project-registration" unless="registration.class.exists">
220
<manifest file="${build.dir}/MANIFEST.MF" mode="update">
221
<attribute name="RegistrationClassName" value="${registration.classname}"/>
224
<target name="-check-for-old-project">
225
<!-- central registration class in project -->
226
<fileset dir="${build.dir}/classes" id="registration.class.name">
228
<include name="**/CentralRegistrationClass.class"/>
231
<property name="systemslash.registration.class" refid="registration.class.name"/>
232
<!-- make forward slash from backslash on Windows -->
233
<property name="regclass.properties" value="${build.dir}/regclass.properties"/>
234
<propertyfile file="${regclass.properties}">
235
<entry key="slash.registration.class" value="${systemslash.registration.class}"/>
237
<replace file="${regclass.properties}" token="\\" value="/"/>
238
<property file="${regclass.properties}"/>
239
<!-- now slash is ok -->
240
<condition property="old.project.registration">
241
<equals arg1="${slash.registration.class}" arg2="" trim="true"/>
243
<condition property="new.project.registration">
244
<isfalse value="${old.project.registration}"/>
247
<!-- copy the user manifest if it exists -->
248
<target depends="-check-user-manifest" if="user.manifest.exists" name="-copy-user-manifest">
249
<copy file="manifest.mf" overwrite="true" tofile="${build.dir}/MANIFEST.MF"/>
250
<available file="${build.dir}/MANIFEST.MF" property="build.manifest.exists"/>
252
<target name="-check-user-manifest">
253
<available file="manifest.mf" property="user.manifest.exists"/>
255
<!-- handle the class path for external jar files unless there is a user overwrite -->
256
<target depends="-rm-external-jars,-add-external-jars" name="-external-jars"/>
257
<target depends="-external-jars-condition" if="do.externalJars" name="-add-external-jars">
258
<!-- get property external.jars for classpath from props file -->
259
<property file="${dist.dir}/${external.jar.dir}/jars.properties"/>
261
<target depends="-external-jars-condition" name="-rm-external-jars" unless="do.externalJars">
262
<!-- empty property, if no jars -->
263
<property name="external.jars" value=""/>
265
<target name="-external-jars-condition">
266
<available file="${dist.dir}/${external.jar.dir}" property="do.externalJars" type="dir"/>
268
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
269
<target name="-delete-uno-package">
270
<delete failonerror="false" file="${uno.package.name}"/>
272
<target name="-pre-uno-package">
273
<!-- Empty placeholder for easier customization. -->
274
<!-- You can override this target in the ../build.xml file. -->
276
<target name="-license-exists">
277
<available file="${project.dir}/licenses" property="do.license" type="dir"/>
279
<!-- test for licenses dir is necessary because zipfileset fails if dir not there -->
280
<target depends="-license-exists" if="do.license" name="-uno-package-with-license">
281
<zip destfile="${uno.package.name}" update="true">
282
<zipfileset casesensitive="yes" dir="${project.dir}/licenses" includes="**" prefix="licenses"/>
285
<target name="-help-exists">
286
<available file="${project.dir}/${help.dir}" property="do.help" type="dir"/>
288
<!-- test for help dir is necessary because zipfileset fails if dir not there -->
289
<target depends="-help-exists" if="do.help" name="-uno-package-with-help">
290
<zip destfile="${uno.package.name}" update="true">
291
<zipfileset dir="${help.dir}" includes="**/*.xhp" prefix="${help.dir}"/>
294
<target name="-dialogs-exists">
295
<available file="${project.dir}/${dialogs.dir}" property="do.dialogs" type="dir"/>
297
<!-- test for dialogs dir is necessary because zipfileset fails if dir not there -->
298
<target depends="-dialogs-exists" if="do.dialogs" name="-uno-package-with-dialogs">
299
<zip destfile="${uno.package.name}" update="true">
300
<zipfileset dir="${dialogs.dir}" includes="**/*.xdl,**/*.properties,**/*.default,**/*.png" prefix="dialogs"/>
303
<target depends="-uno-package-with-license,-uno-package-with-help,-uno-package-with-dialogs" description="Creates UNO extension pacakge" name="-do-uno-package">
304
<echo message="creating UNO extension package ..."/>
305
<zip destfile="${uno.package.name}" update="true">
306
<fileset casesensitive="yes" dir="${src.dir}" includes="${manifest.package.extensions}"/>
307
<fileset casesensitive="yes" dir="${src.dir}" includes="description.xml"/>
308
<fileset casesensitive="yes" dir="${dist.dir}" includes="**/*.jar"/>
309
<fileset casesensitive="yes" dir="${images.base.dir}" includes="**"/>
310
<fileset casesensitive="yes" dir="${idl.out.rdb}" includes="**/*.rdb"/>
311
<zipfileset dir="${src.dir}" fullpath="META-INF/manifest.xml" includes="uno-extension-manifest.xml"/>
314
<target name="-post-uno-package">
315
<!-- Empty placeholder for easier customization. -->
316
<!-- You can override this target in the ../build.xml file. -->
318
<target depends="jar,images,-delete-uno-package,-pre-uno-package,-do-uno-package,-post-uno-package" description="Creates UNO extension pacakge" name="uno-package"/>
319
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
320
<target depends="uno-package" description="Deploys UNO extension package" name="uno-deploy">
321
<echo message="deploying UNO extension package ..."/>
322
<echo message="${office.unopkg} gui -f ${uno.package.name}"/>
323
<exec dir="${office.program.dir}" executable="${office.unopkg}" failonerror="true">
326
<arg file="${uno.package.name}"/>
329
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
330
<target depends="uno-deploy" description="Run OpenOffice.org" name="uno-run">
331
<echo message="starting the Office ..."/>
332
<echo message=" ${office.soffice}"/>
333
<exec dir="${office.program.dir}" executable="${office.soffice}" failonerror="true"/>
335
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
336
<target depends="uno-package" description="Debugss UNO extension package in Target Office" name="uno-debug">
337
<!-- security fail for executing this without netbeans -->
338
<fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
339
<!-- start debugger and get connection address jpda.address -->
340
<nbjpdastart addressproperty="jpda.address" name="Debug Office" transport="dt_socket">
341
<classpath path="${build.classes.dir}"/>
342
<sourcepath path="${src.dir}"/>
344
<!-- register component in temporaary user installation -->
345
<echo message="debugging UNO extension package ..."/>
346
<echo message="wait until preparation is finished."/>
347
<echo message=" deploying UNO extension package for debugging ..."/>
348
<echo message=" ${office.unopkg} gui -f ${uno.package.name}"/>
349
<exec dir="${office.program.dir}" executable="${office.unopkg}">
352
<arg file="${uno.package.name}"/>
353
<env key="UserInstallation" value="${office.debug.user.directory}"/>
355
<!-- start Office with debug Java and user installation -->
356
<echo message=" starting the Office with ..."/>
357
<echo message=" user installation: ${office.debug.user.directory}"/>
358
<echo message=" debug options: "-Xdebug" "-Xrunjdwp:transport=dt_socket,address=${jpda.address}""/>
359
<echo message=" ${office.soffice}"/>
360
<echo message="preparation finished."/>
361
<exec dir="${office.program.dir}" executable="${office.soffice}" failonerror="true">
362
<env key="UserInstallation" value="${office.debug.user.directory}"/>
363
<env key="JAVA_TOOL_OPTIONS" value=""-Xdebug" "-Xrunjdwp:transport=dt_socket,address=${jpda.address}""/>