1 <project default="build">
3 <!-- =================== Global Properties ============================= -->
4 <property environment="env"/>
5 <property name="macroname" value="ScriptSelector"/>
6 <property name="unopkgfile" value="${basedir}/${macroname}.uno.pkg"/>
8 <!-- ==================== intialise properties ========================= -->
9 <target name="checksdk">
10 <condition property="UsingSDK">
11 <available file="${env.OFFICE_PROGRAM_PATH}"/>
15 <target name="initsdk" if="UsingSDK">
16 <property name="opp" value="${env.OFFICE_PROGRAM_PATH}"/>
19 <target name="initnosdk" unless="UsingSDK">
20 <fail unless="opp" message="Path to Office install not set"/>
23 <!-- ==================== classpath setting ============================ -->
24 <target name="init" depends="checksdk,initsdk,initnosdk">
25 <path id="scriptclasspath">
26 <pathelement location="${opp}/classes/unoil.jar"/>
27 <pathelement location="${opp}/classes/ridl.jar"/>
28 <pathelement location="${opp}/classes/sandbox.jar"/>
29 <pathelement location="${opp}/classes/jurt.jar"/>
30 <pathelement location="${opp}/classes/juh.jar"/>
31 <pathelement location="${opp}/classes/ScriptFramework.jar"/>
35 <!-- ====================== Clean Generated Files ===================== -->
39 <include name="**/*.class"/>
40 <include name="**/*.jar"/>
41 <include name="**/*.uno.pkg"/>
46 <!-- ===================== Compile the script ========================= -->
47 <target name="compile" depends="init">
48 <javac srcdir="${macroname}" destdir="${macroname}"
49 includes="**/*.java" classpathref="scriptclasspath"
50 debug="on" optimize="on" deprecation="on"/>
53 <!-- ====================== Build UNO Package ========================= -->
54 <target name="build" depends="compile">
55 <delete file="${unopkgfile}"/>
57 <jar jarfile="${macroname}/${macroname}.jar"
58 basedir="${macroname}" includes="*.class,*.gif">
61 <zip zipfile="${unopkgfile}">
62 <fileset dir="${basedir}">
63 <include name="**/*.jar"/>
64 <include name="**/parcel-descriptor.xml"/>
65 <include name="**/manifest.xml"/>
70 <!-- ====================== Deploy Generated Files ==================== -->
71 <target name="deploy" depends="build">
72 <exec executable="${opp}/unopkg">
75 <arg path="${unopkgfile}"/>
79 <!-- ========================= All In One Build ======================= -->
80 <target name="all" depends="clean,build,deploy"/>