1<?xml version="1.0" encoding="UTF-8"?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements.  See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership.  The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License.  You may obtain a copy of the License at
11 *
12 *   http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied.  See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 *
21 ***********************************************************-->
22<project basedir="." default="all" name="FirstUnoContact">
23
24    <property environment="env"/>
25    <property name="OFFICE_HOME" value="${env.OFFICE_HOME}"/>
26    <property name="OO_SDK_HOME" value="${env.OO_SDK_HOME}"/>
27
28    <target name="init">
29        <property name="OUTDIR" value="${OO_SDK_HOME}/WINExample.out/class/FirstUnoContact"/>
30    </target>
31
32    <path id="office.class.path">
33        <filelist dir="${OFFICE_HOME}/program/classes"
34            files="jurt.jar,unoil.jar,ridl.jar,juh.jar"/>
35    </path>
36
37    <fileset id="bootstrap.glue.code" dir="${OO_SDK_HOME}/classes">
38        <patternset>
39            <include name="com/sun/star/lib/loader/*.class"/>
40            <include name="win/unowinreg.dll"/>
41        </patternset>
42    </fileset>
43
44    <target name="compile" depends="init">
45        <mkdir dir="${OUTDIR}"/>
46        <javac debug="true" deprecation="true" destdir="${OUTDIR}" srcdir=".">
47            <classpath refid="office.class.path"/>
48        </javac>
49    </target>
50
51    <target name="jar" depends="init,compile">
52        <jar basedir="${OUTDIR}" compress="true"
53            jarfile="${OUTDIR}/FirstUnoContact.jar">
54            <exclude name="**/*.java"/>
55            <exclude name="*.jar"/>
56            <fileset refid="bootstrap.glue.code"/>
57            <manifest>
58                <attribute name="Main-Class" value="com.sun.star.lib.loader.Loader"/>
59                <section name="com/sun/star/lib/loader/Loader.class">
60                <attribute name="Application-Class" value="FirstUnoContact"/>
61                </section>
62            </manifest>
63        </jar>
64    </target>
65
66    <target name="all"  description="Build everything." depends="init,compile,jar">
67        <echo message="Application built. FirstUnoContact!"/>
68    </target>
69
70    <target name="run" description="Try running it." depends="init,all">
71        <java jar="${OUTDIR}/FirstUnoContact.jar" failonerror="true" fork="true">
72        </java>
73    </target>
74
75    <target  name="clean" description="Clean all build products." depends="init">
76        <delete>
77            <fileset dir="${OUTDIR}">
78                <include name="**/*.class"/>
79            </fileset>
80        </delete>
81        <delete file="${OUTDIR}/FirstUnoContact.jar"/>
82    </target>
83
84</project>
85