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