xref: /aoo42x/main/l10ntools/java/l10nconv/build.xml (revision 940681c7)
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="l10nconv" default="main" basedir=".">
25
26    <!-- ================================================================= -->
27    <!-- settings                                                          -->
28    <!-- ================================================================= -->
29
30    <!-- name of this sub target used in recursive builds -->
31    <property name="target" value="l10nconv"/>
32
33    <!-- name of jar file created, without .jar extension -->
34    <property name="jarname" value="converter"/>
35
36    <!-- relative path to project directory -->
37    <property name="prj" value="."/>
38
39    <!-- build output directory -->
40    <property name="out" value="build"/>
41
42    <!-- build directories -->
43    <property name="build.dir" value="${out}"/>
44    <property name="build.class" value="${build.dir}/class/converter"/>
45    <property name="build.misc" value="${build.dir}/misc/converter"/>
46
47    <!-- start of java source code package structure -->
48    <property name="java.dir" value="java"/>
49
50    <!-- define how to handle CLASSPATH environment -->
51    <property name="build.sysclasspath" value="ignore"/>
52
53    <!-- classpath settings for compile and javadoc tasks -->
54    <path id="classpath">
55        <pathelement location="."/>
56        <pathelement location="${build.class}"/>
57    </path>
58
59    <!-- name to display in documentation -->
60    <property name="docname" value="l10n converter"/>
61
62    <!-- set "modern" java compiler -->
63    <property name="build.compiler" value="modern"/>
64
65    <!-- set whether we want to compile with debug information -->
66    <property name="debug" value="on"/>
67
68    <!-- set whether we want to compile with optimisation -->
69    <property name="optimize" value="off"/>
70
71    <!-- set whether we want to compile with or without deprecation -->
72    <property name="deprecation" value="on"/>
73
74    <target name="info">
75        <echo message="--------------------"/>
76        <echo message="${target}"/>
77        <echo message="--------------------"/>
78    </target>
79
80    <!-- ================================================================= -->
81    <!-- custom targets                                                    -->
82    <!-- ================================================================= -->
83
84    <!-- the main target, called in recursive builds -->
85    <target name="main" depends="info,prepare,compile,jar,javadoc,zipdoc"/>
86
87    <!-- prepare output directories -->
88    <target name="prepare">
89        <mkdir dir="${build.dir}"/>
90        <mkdir dir="${build.dir}/doc"/>
91        <mkdir dir="${build.dir}/doc/javadoc"/>
92        <mkdir dir="${build.class}"/>
93        <mkdir dir="${build.misc}"/>
94    </target>
95
96
97    <target name="res" depends="prepare">
98        <copy todir="${build.class}">
99             <fileset dir="${java.dir}">
100                 <include name="**/*.properties"/>
101                 <include name="**/*.css"/>
102                 <include name="**/*.dtd"/>
103                 <include name="**/*.form"/>
104                 <include name="**/*.gif "/>
105                 <include name="**/*.htm"/>
106                 <include name="**/*.html"/>
107                 <include name="**/*.js"/>
108                 <include name="**/*.mod"/>
109                 <include name="**/*.sql"/>
110                 <include name="**/*.xml"/>
111                 <include name="**/*.xsl"/>
112                 <include name="**/*.map"/>
113
114             </fileset>
115	    </copy>
116    </target>
117
118
119    <target name="compile" depends="prepare,res">
120	<javac destdir="${build.class}"
121	       debug="${debug}"
122               deprecation="${deprication}"
123	       optimize="${optimize}"
124	       classpathref="classpath">
125            <src path="${java.dir}"/>
126	    <include name="**/*.java"/>
127	</javac>
128    </target>
129
130    <!-- check if javadoc is up to date -->
131    <target name="javadoc_check" depends="prepare" if="build.dir">
132	<uptodate property="javadocBuild.notRequired" value="true"
133            targetfile="${build.dir}/doc/converter_javadoc.zip">
134		<srcfiles dir="${java.dir}" includes="**/*.java"/>
135	</uptodate>
136    </target>
137
138    <!-- generate java documentation -->
139    <target name="javadoc" depends="prepare,javadoc_check,compile"
140         unless="javadocBuild.notRequired"
141         if="build.dir">
142
143        <javadoc destdir="${build.dir}/doc/javadoc"
144                 verbose="false"
145                 author="false"
146                 nodeprecated="true"
147                 nodeprecatedlist="true"
148                 use="true"
149                 Doctitle="${docname}"
150                 windowtitle="${docname}"
151                 classpathref="classpath">
152
153            <packageset dir="${java.dir}" defaultexcludes="yes">
154                <include name="com/**"/>
155            </packageset>
156
157            <link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api"
158                  packagelistLoc="${common.doc}/jdk1.4.2"/>
159            <link offline="true"
160                  href="http://java.sun.com/products/servlet/2.3/javadoc"
161                  packagelistLoc="${common.doc}/servlet2.3"/>
162            <link offline="true"
163                  href="http://logging.apache.org/log4j/docs/api"
164                  packagelistLoc="${common.doc}/log4j-1.2.8"/>
165            <link offline="true"
166                  href="http://java.sun.com/products/javabeans/glasgow/javadocs"
167                  packagelistLoc="${common.doc}/jaf-1.0.2"/>
168            <link offline="true"
169                  href="http://java.sun.com/products/javamail/javadocs"
170                  packagelistLoc="${common.doc}/javamail-1.3.1"/>
171            <link offline="true"
172                  href="http://ws.apache.org/soap/docs"
173                  packagelistLoc="${common.doc}/soap-2.3.1"/>
174
175            <bottom>&lt;i&gt;Copyright &amp;#169; 2004 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA&lt;/i&gt;</bottom>
176            <header>${docname}</header>
177
178       </javadoc>
179    </target>
180
181    <!-- zip documentation and store in build/misc -->
182    <target name="zipdoc" depends="javadoc" if="build.dir" unless="javadocBuild.notRequired">
183	<zip zipfile="${build.dir}/doc/converter_javadoc.zip"
184      basedir="${build.dir}/doc/javadoc"
185      update="true"/>
186    </target>
187
188    <!-- clean up -->
189    <target name="clean" depends="prepare">
190        <delete includeEmptyDirs="true">
191            <fileset dir="${build.class}">
192                <patternset>
193                    <include name="${package}/**/*.class"/>
194                </patternset>
195            </fileset>
196        </delete>
197    </target>
198
199    <!-- create jar file -->
200    <target name="jar" depends="prepare,compile" if="build.class">
201        <jar jarfile="${build.class}/${jarname}.jar"
202             basedir="${build.class}"
203             manifest="${jarname}.MF">
204                 <include name="**/*.class"/>
205                 <include name="**/*.properties"/>
206                 <include name="**/*.css"/>
207                 <include name="**/*.dtd"/>
208                 <include name="**/*.form"/>
209                 <include name="**/*.gif "/>
210                 <include name="**/*.htm"/>
211                 <include name="**/*.html"/>
212                 <include name="**/*.js"/>
213                 <include name="**/*.mod"/>
214                 <include name="**/*.sql"/>
215                 <include name="**/*.xml"/>
216                 <include name="**/*.xsl"/>
217                 <include name="**/*.map"/>
218        </jar>
219    </target>
220
221    <target name="test" depends="prepare">
222    </target>
223
224</project>
225
226