1 <?xml version="1.0" encoding="UTF-8"?>
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 <project default="build">
21 <!-- =================== Global Properties ============================= -->
22 <property environment="env"/>
23 <property name="macroname" value="ScriptSelector"/>
24 <property name="unopkgfile" value="${basedir}/${macroname}.uno.pkg"/>
26 <!-- ==================== initialise properties ========================= -->
27 <target name="checksdk">
28 <condition property="UsingSDK">
29 <available file="${env.OFFICE_PROGRAM_PATH}"/>
33 <target name="initsdk" if="UsingSDK">
34 <property name="opp" value="${env.OFFICE_PROGRAM_PATH}"/>
37 <target name="initnosdk" unless="UsingSDK">
38 <fail unless="opp" message="Path to Office install not set"/>
41 <!-- ==================== classpath setting ============================ -->
42 <target name="init" depends="checksdk,initsdk,initnosdk">
43 <path id="scriptclasspath">
44 <pathelement location="${opp}/classes/libreoffice.jar"/>
45 <pathelement location="${opp}/classes/ScriptFramework.jar"/>
49 <!-- ====================== Clean Generated Files ===================== -->
53 <include name="**/*.class"/>
54 <include name="**/*.jar"/>
55 <include name="**/*.uno.pkg"/>
60 <!-- ===================== Compile the script ========================= -->
61 <target name="compile" depends="init">
62 <javac srcdir="${macroname}" destdir="${macroname}"
63 includes="**/*.java" classpathref="scriptclasspath"
64 debug="on" optimize="on" deprecation="on"/>
67 <!-- ====================== Build UNO Package ========================= -->
68 <target name="build" depends="compile">
69 <delete file="${unopkgfile}"/>
71 <jar jarfile="${macroname}/${macroname}.jar"
72 basedir="${macroname}" includes="*.class,*.gif">
75 <zip zipfile="${unopkgfile}">
76 <fileset dir="${basedir}">
77 <include name="**/*.jar"/>
78 <include name="**/parcel-descriptor.xml"/>
79 <include name="**/manifest.xml"/>
84 <!-- ====================== Deploy Generated Files ==================== -->
85 <target name="deploy" depends="build">
86 <exec executable="${opp}/unopkg">
89 <arg path="${unopkgfile}"/>
93 <!-- ========================= All In One Build ======================= -->
94 <target name="all" depends="clean,build,deploy"/>