xref: /aoo4110/main/xmerge/workben/build.xml (revision b1cdbd2c)
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
23
24<project name="xmrg_workben" default="main" basedir=".">
25
26    <!-- ================================================================= -->
27    <!-- settings                                                          -->
28    <!-- ================================================================= -->
29
30    <!-- project prefix, used for targets and build.lst  -->
31    <property name="prj.prefix" value="xmrg"/>
32
33    <!-- name of this sub target used in recursive builds -->
34    <property name="target" value="xmrg_workben"/>
35
36    <!-- relative path to project directory -->
37    <property name="prj" value=".."/>
38
39    <!-- start of java source code package structure -->
40    <property name="java.dir" value="${prj}/workben"/>
41
42    <!-- path component for current java package -->
43    <property name="package" value="."/>
44
45    <!-- define how to handle CLASSPATH environment -->
46    <property name="build.sysclasspath" value="ignore"/>
47
48    <property environment="env"/>
49    <property name="env.XML_APIS_JAR" value="${solar.jar}/xml-apis.jar"/>
50    <property name="env.XERCES_JAR" value="${solar.jar}/xercesImpl.jar"/>
51
52    <!-- classpath settings for javac tasks -->
53    <path id="classpath">
54        <pathelement location="${build.class}"/>
55        <pathelement location="${env.XML_APIS_JAR}"/>
56        <pathelement location="${env.XERCES_JAR}"/>
57    </path>
58
59    <!-- set wether we want to compile with or without deprecation -->
60    <property name="deprecation" value="on"/>
61
62    <!-- ================================================================= -->
63    <!--  solar build environment targets                                  -->
64    <!-- ================================================================= -->
65
66    <target name="build_dir" unless="build.dir">
67        <property name="build.dir" value="${out}"/>
68    </target>
69
70    <target name="solar" depends="build_dir" if="solar.update">
71        <property name="solar.properties"
72                  value="${solar.bin}/solar.properties"/>
73    </target>
74
75    <target name="init" depends="solar">
76        <property name="build.compiler" value="modern"/>
77        <property file="${solar.properties}"/>
78        <property file="${build.dir}/class/solar.properties"/>
79    </target>
80
81    <target name="info">
82        <echo message="--------------------"/>
83        <echo message="${target}"/>
84        <echo message="--------------------"/>
85    </target>
86
87
88    <!-- ================================================================= -->
89    <!-- custom targets                                                    -->
90    <!-- ================================================================= -->
91
92    <!-- the main target, called in recursive builds -->
93    <target name="main" depends="info,prepare,compile"/>
94
95    <!-- prepare output directories -->
96    <target name="prepare" depends="init" if="build.class">
97        <mkdir dir="${build.dir}"/>
98        <mkdir dir="${build.class}"/>
99    </target>
100
101    <!-- compile java sources in ${package} and sub packages -->
102    <target name="compile" depends="prepare" if="build.class">
103        <javac srcdir="${java.dir}"
104               destdir="${build.class}"
105               debug="${debug}"
106               deprecation="${deprecation}"
107               optimize="${optimize}">
108            <classpath refid="classpath"/>
109            <include name="XmlDiff.java"/>
110        </javac>
111    </target>
112
113    <!-- clean up -->
114    <target name="clean" depends="prepare">
115        <delete includeEmptyDirs="true">
116            <fileset dir="${build.class}">
117                <patternset>
118                    <include name="${package}/**/*.class"/>
119                </patternset>
120            </fileset>
121        </delete>
122    </target>
123
124</project>
125