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