1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 | Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
|
---|
4 | 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
|
---|
8 | published by the Free Software Foundation. Sun designates this
|
---|
9 | particular file as subject to the "Classpath" exception as provided
|
---|
10 | by Sun in the LICENSE file that accompanied this code.
|
---|
11 |
|
---|
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 |
|
---|
22 | Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
---|
23 | CA 95054 USA or visit www.sun.com if you need additional information or
|
---|
24 | have any questions.
|
---|
25 | -->
|
---|
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
|
---|
39 | </description>
|
---|
40 |
|
---|
41 | <!-- Mac is special, need to downgrade these before build.properties. -->
|
---|
42 | <condition property="javac.source" value="1.5">
|
---|
43 | <os family="mac"/>
|
---|
44 | </condition>
|
---|
45 | <condition property="javac.target" value="1.5">
|
---|
46 | <os family="mac"/>
|
---|
47 | </condition>
|
---|
48 |
|
---|
49 | <!-- Project build properties. -->
|
---|
50 | <property file="build.properties"/>
|
---|
51 |
|
---|
52 | <!-- See if drop sources were included. -->
|
---|
53 | <condition property="drop.dir"
|
---|
54 | value="${drop.included.dir}"
|
---|
55 | else="${drop.expanded.dir}">
|
---|
56 | <available file="${drop.included.dir}" type="dir"/>
|
---|
57 | </condition>
|
---|
58 |
|
---|
59 | <!-- Get shared targets. -->
|
---|
60 | <import file="build-defs.xml"/>
|
---|
61 |
|
---|
62 | <!-- Initialization of directories needed for build. -->
|
---|
63 | <target name="init">
|
---|
64 | <mkdir dir="${build.dir}"/>
|
---|
65 | <mkdir dir="${build.classes.dir}"/>
|
---|
66 | <mkdir dir="${dist.dir}"/>
|
---|
67 | <mkdir dir="${dist.lib.dir}"/>
|
---|
68 | </target>
|
---|
69 |
|
---|
70 | <!-- Sanity checks and settings -->
|
---|
71 | <target name="sanity"
|
---|
72 | depends="-javac-jar-exists"
|
---|
73 | description="Display settings of configuration values">
|
---|
74 | <echo message="${sanity.info}"/>
|
---|
75 | </target>
|
---|
76 |
|
---|
77 | <!-- Check for bootstrap javac.jar file, warn if missing. -->
|
---|
78 | <condition property="javac.jar.exists">
|
---|
79 | <available file="${javac.jar}" type="file"/>
|
---|
80 | </condition>
|
---|
81 | <target name="-javac-jar-exists"
|
---|
82 | unless="javac.jar.exists">
|
---|
83 | <echo message="WARNING: Cannot find ${javac.jar}"/>
|
---|
84 | </target>
|
---|
85 |
|
---|
86 | <!-- Creation of distribution files to jdk build process. -->
|
---|
87 | <target name="dist"
|
---|
88 | depends="init, -init-src-dirs, build, -dist-classes-jar, -dist-src-zip"
|
---|
89 | description="Create all built distribution files.">
|
---|
90 | </target>
|
---|
91 | <target name="-dist-classes-jar-uptodate"
|
---|
92 | depends="init, -init-src-dirs">
|
---|
93 | <condition property="dist.classes.jar.uptodate">
|
---|
94 | <and>
|
---|
95 | <available file="${dist.classes.jar}" type="file"/>
|
---|
96 | <uptodate targetfile="${dist.classes.jar}">
|
---|
97 | <srcfiles dir="${build.classes.dir}" includes="**"/>
|
---|
98 | </uptodate>
|
---|
99 | </and>
|
---|
100 | </condition>
|
---|
101 | </target>
|
---|
102 | <target name="-dist-classes-jar"
|
---|
103 | depends="init, -init-src-dirs, -dist-classes-jar-uptodate"
|
---|
104 | unless="dist.classes.jar.uptodate">
|
---|
105 | <delete file="${dist.classes.jar}"/>
|
---|
106 | <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
|
---|
107 | </target>
|
---|
108 |
|
---|
109 | <target name="-build-prep"
|
---|
110 | depends="init, -init-src-dirs, -drop-build-prep">
|
---|
111 | </target>
|
---|
112 |
|
---|
113 | <!-- Build (compilation) of sources to class files. -->
|
---|
114 | <target name="build"
|
---|
115 | depends="init, -init-src-dirs, -build-prep">
|
---|
116 | <javac
|
---|
117 | includeAntRuntime="false"
|
---|
118 | classpath="${build.classes.dir}"
|
---|
119 | fork="true"
|
---|
120 | destdir="${build.classes.dir}"
|
---|
121 | memoryInitialSize="${javac.memoryInitialSize}"
|
---|
122 | memoryMaximumSize="${javac.memoryMaximumSize}"
|
---|
123 | source="${javac.source}"
|
---|
124 | debug="${javac.debug}"
|
---|
125 | target="${javac.target}">
|
---|
126 | <compilerarg value="-J-Xbootclasspath/p:${javac.jar}"/>
|
---|
127 | <compilerarg line="${javac.version.opt} ${javac.lint.opts} ${javac.no.jdk.warnings}"/>
|
---|
128 | <src refid="src.dir.id"/>
|
---|
129 | </javac>
|
---|
130 | </target>
|
---|
131 |
|
---|
132 | <!-- Test. (FIXME: Need to know how to run tests.) -->
|
---|
133 | <target name="test"
|
---|
134 | depends="init, -init-src-dirs, dist">
|
---|
135 | <echo message="FIXME: How do you run the tests"/>
|
---|
136 | </target>
|
---|
137 |
|
---|
138 | <!-- Populate source area if needed. -->
|
---|
139 | <target name="source"
|
---|
140 | depends="init, -init-src-dirs"
|
---|
141 | description="Populate all source file directories">
|
---|
142 | </target>
|
---|
143 |
|
---|
144 | <!-- Populate drop_included area. -->
|
---|
145 | <target name="drop_included"
|
---|
146 | depends="clobber"
|
---|
147 | description="Populate all source file directories">
|
---|
148 | <delete dir="${drop.included.dir}"/>
|
---|
149 | <antcall target="source"/>
|
---|
150 | <move file="${drop.expanded.dir}" tofile="${drop.included.dir}"/>
|
---|
151 | <delete dir="${drop.included.dir}/bundles"/>
|
---|
152 | </target>
|
---|
153 |
|
---|
154 | <!-- Clean up compiled files. -->
|
---|
155 | <target name="clean"
|
---|
156 | description="Delete all generated files">
|
---|
157 | <delete dir="${build.dir}"/>
|
---|
158 | <delete dir="${dist.dir}"/>
|
---|
159 | </target>
|
---|
160 |
|
---|
161 | <!-- Clean up compiled files and all imported source files. -->
|
---|
162 | <target name="clobber"
|
---|
163 | depends="clean"
|
---|
164 | description="Delete all generated files, including imported sources">
|
---|
165 | <delete dir="${drop.expanded.dir}"/>
|
---|
166 | </target>
|
---|
167 |
|
---|
168 | <target name="-banner">
|
---|
169 | <echo message="+---------------------------------------+"/>
|
---|
170 | <echo message="+ Starting ant project ${ant.project.name} +"/>
|
---|
171 | <echo message="+---------------------------------------+"/>
|
---|
172 | </target>
|
---|
173 |
|
---|
174 | <!-- Do everything but test. -->
|
---|
175 | <target name="all"
|
---|
176 | depends="-banner, sanity, dist"
|
---|
177 | description="Build everything.">
|
---|
178 | <echo message="+---------------------------------------+"/>
|
---|
179 | <echo message="+ Finishing ant project ${ant.project.name}"/>
|
---|
180 | <echo message="+---------------------------------------+"/>
|
---|
181 | </target>
|
---|
182 |
|
---|
183 | </project>
|
---|