blob: 72cdca25ce769d68658851f9855e2719eaf69686 [file] [log] [blame]
Kelly O'Hair31015d22009-09-21 13:54:55 -07001<?xml version="1.0"?>
2<!--
Kelly O'Hair502320f2011-04-06 20:15:38 -07003 Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
Kelly O'Hair31015d22009-09-21 13:54:55 -07004 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
6 This code is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License version 2 only, as
Kelly O'Hair149a47c2010-05-25 15:52:44 -07008 published by the Free Software Foundation. Oracle designates this
Kelly O'Hair31015d22009-09-21 13:54:55 -07009 particular file as subject to the "Classpath" exception as provided
Kelly O'Hair149a47c2010-05-25 15:52:44 -070010 by Oracle in the LICENSE file that accompanied this code.
Kelly O'Hair31015d22009-09-21 13:54:55 -070011
12 This code is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 version 2 for more details (a copy is included in the LICENSE file that
16 accompanied this code).
17
18 You should have received a copy of the GNU General Public License version
19 2 along with this work; if not, write to the Free Software Foundation,
20 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
Kelly O'Hair149a47c2010-05-25 15:52:44 -070022 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23 or visit www.oracle.com if you need additional information or have any
24 questions.
Kelly O'Hair31015d22009-09-21 13:54:55 -070025-->
26
27<project name="jaxp" default="all" basedir=".">
28
29 <!-- For 'ant -p' or 'ant -projecthelp' -->
30
31 <description>
32 Ant build script for the ${ant.project.name} part of the jdk.
33
34 Input Properties: (see build.properties for the ant defaults)
35 bootstrap.dir - dir with lib/javac.jar, added to javac bootclasspath
36 javac.debug - true or false for debug classfiles
37 javac.target - classfile version target
38 javac.source - source version
Kelly O'Haircafa9bd2010-06-17 10:50:14 -070039
40 Run 'make help' for help using the Makefile.
Kelly O'Hair31015d22009-09-21 13:54:55 -070041 </description>
42
Kelly O'Hair31015d22009-09-21 13:54:55 -070043 <!-- Project build properties. -->
44 <property file="build.properties"/>
45
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080046 <!-- Source dir def -->
Joe Wang60663482012-04-12 08:38:26 -070047 <property name="jaxp.src.dir" value="src"/>
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080048 <path id="src.dir.id">
49 <pathelement path="${jaxp.src.dir}"/>
50 </path>
Kelly O'Hair31015d22009-09-21 13:54:55 -070051
52 <!-- Initialization of directories needed for build. -->
53 <target name="init">
54 <mkdir dir="${build.dir}"/>
55 <mkdir dir="${build.classes.dir}"/>
56 <mkdir dir="${dist.dir}"/>
57 <mkdir dir="${dist.lib.dir}"/>
58 </target>
59
60 <!-- Sanity checks and settings -->
61 <target name="sanity"
62 depends="-javac-jar-exists"
63 description="Display settings of configuration values">
64 <echo message="${sanity.info}"/>
65 </target>
66
67 <!-- Check for bootstrap javac.jar file, warn if missing. -->
68 <condition property="javac.jar.exists">
69 <available file="${javac.jar}" type="file"/>
70 </condition>
71 <target name="-javac-jar-exists"
72 unless="javac.jar.exists">
73 <echo message="WARNING: Cannot find ${javac.jar}"/>
74 </target>
75
76 <!-- Creation of distribution files to jdk build process. -->
77 <target name="dist"
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080078 depends="init, build, -dist-classes-jar, -dist-src-zip"
Kelly O'Hair31015d22009-09-21 13:54:55 -070079 description="Create all built distribution files.">
80 </target>
81 <target name="-dist-classes-jar-uptodate"
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080082 depends="init">
Kelly O'Hair31015d22009-09-21 13:54:55 -070083 <condition property="dist.classes.jar.uptodate">
84 <and>
85 <available file="${dist.classes.jar}" type="file"/>
86 <uptodate targetfile="${dist.classes.jar}">
87 <srcfiles dir="${build.classes.dir}" includes="**"/>
88 </uptodate>
89 </and>
90 </condition>
91 </target>
92 <target name="-dist-classes-jar"
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080093 depends="init, -dist-classes-jar-uptodate"
Kelly O'Hair31015d22009-09-21 13:54:55 -070094 unless="dist.classes.jar.uptodate">
95 <delete file="${dist.classes.jar}"/>
96 <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
97 </target>
98
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080099 <!-- Special build area setup. -->
100 <target name="-build-setup" depends="init">
101 <mkdir dir="${build.classes.dir}"/>
102 <copy todir="${build.classes.dir}">
103 <fileset dir="${jaxp.src.dir}"
104 includes="**/*.properties"/>
105 </copy>
106 <replaceregexp match="#(.*)$" replace="#" flags="gm">
107 <fileset dir="${build.classes.dir}" includes="**/*.properties"/>
108 </replaceregexp>
Kelly O'Hair31015d22009-09-21 13:54:55 -0700109 </target>
110
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800111 <!-- Create src.zip. -->
112 <target name="-dist-src-zip" depends="init">
113 <zip file="${dist.src.zip}" basedir="${jaxp.src.dir}"/>
114 </target>
115
Kelly O'Hair31015d22009-09-21 13:54:55 -0700116 <!-- Build (compilation) of sources to class files. -->
117 <target name="build"
Kelly O'Haircafa9bd2010-06-17 10:50:14 -0700118 depends="compile, -build-setup">
119 </target>
120 <target name="compile"
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800121 depends="init">
Kelly O'Haircafa9bd2010-06-17 10:50:14 -0700122 <mkdir dir="${build.classes.dir}"/>
Kelly O'Hair59ea6ab2009-11-11 11:17:51 -0800123 <javac
Kelly O'Haircafa9bd2010-06-17 10:50:14 -0700124 includeAntRuntime="false"
125 classpath="${build.classes.dir}:${tools.jar}"
Kelly O'Hair59ea6ab2009-11-11 11:17:51 -0800126 fork="true"
Kelly O'Hair31015d22009-09-21 13:54:55 -0700127 destdir="${build.classes.dir}"
128 memoryInitialSize="${javac.memoryInitialSize}"
129 memoryMaximumSize="${javac.memoryMaximumSize}"
130 source="${javac.source}"
131 debug="${javac.debug}"
132 target="${javac.target}">
133 <compilerarg value="-J-Xbootclasspath/p:${javac.jar}"/>
134 <compilerarg line="${javac.version.opt} ${javac.lint.opts} ${javac.no.jdk.warnings}"/>
135 <src refid="src.dir.id"/>
136 </javac>
137 </target>
138
139 <!-- Test. (FIXME: Need to know how to run tests.) -->
140 <target name="test"
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800141 depends="init, dist">
Kelly O'Hair31015d22009-09-21 13:54:55 -0700142 <echo message="FIXME: How do you run the tests"/>
143 </target>
144
145 <!-- Populate source area if needed. -->
146 <target name="source"
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800147 depends="init"
Kelly O'Hair31015d22009-09-21 13:54:55 -0700148 description="Populate all source file directories">
149 </target>
150
151 <!-- Clean up compiled files. -->
152 <target name="clean"
153 description="Delete all generated files">
154 <delete dir="${build.dir}"/>
155 <delete dir="${dist.dir}"/>
156 </target>
157
158 <!-- Clean up compiled files and all imported source files. -->
159 <target name="clobber"
160 depends="clean"
161 description="Delete all generated files, including imported sources">
Kelly O'Hair31015d22009-09-21 13:54:55 -0700162 </target>
163
164 <target name="-banner">
165 <echo message="+---------------------------------------+"/>
166 <echo message="+ Starting ant project ${ant.project.name} +"/>
167 <echo message="+---------------------------------------+"/>
168 </target>
169
170 <!-- Do everything but test. -->
171 <target name="all"
172 depends="-banner, sanity, dist"
173 description="Build everything.">
174 <echo message="+---------------------------------------+"/>
175 <echo message="+ Finishing ant project ${ant.project.name}"/>
176 <echo message="+---------------------------------------+"/>
177 </target>
178
Daniel Fuchs911f4412013-04-19 17:22:36 +0200179 <target name="javadoc" depends="init" description="Build basic Javadoc for public packages.">
180 <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
181 <!-- Note: even with this default value, includes/excludes
182 from share.src.dir get javadoc'd; see packageset below -->
183 <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
184 <property name="javadoc.dir" value="${build.dir}/docs/api"/>
185 <property name="includes" value="**"/>
186 <javadoc destdir="${javadoc.dir}" source="1.5"
187 windowtitle="UNOFFICIAL" failonerror="true" use="true"
188 author="false" version="false"
189 packagenames="${javadoc.packagenames}">
190 <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
191 <arg line="${javadoc.options}"/>
192 <bootclasspath>
193 <path location="${java.home}/lib/rt.jar"/>
194 <path location="${build.classes.dir}"/>
195 </bootclasspath>
196 <sourcepath>
197 <pathelement location="${jaxp.src.dir}"/>
198 </sourcepath>
199 <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
200 <!-- means that {@link some.package} will not work, which is no good. -->
201 <!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
202 <!-- which also causes duplicates in the class index for included files.) -->
203 <packageset dir="${jaxp.src.dir}" includes="${includes}" excludes="${excludes}">
204 <or>
205 <filename name="javax/"/>
206 <filename name="org/w3c/"/>
207 <filename name="org/xml/sax/"/>
208 </or>
209 </packageset>
210 </javadoc>
211 </target>
212 <target name="javadoc-nb" depends="javadoc" if="netbeans.home">
213 <property name="javadoc.dir=" value="${build.dir}/docs/api"/>
214 <nbbrowse file="${javadoc.dir}/index.html"/>
215 </target>
216
Kelly O'Hair31015d22009-09-21 13:54:55 -0700217</project>