build.xml revision 281:ff3ad1d8c057
1148330Snetchild<?xml version="1.0"?>
2148330Snetchild<!--
3148330Snetchild Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
4148330Snetchild DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5148330Snetchild
6148330Snetchild This code is free software; you can redistribute it and/or modify it
7148330Snetchild under the terms of the GNU General Public License version 2 only, as
8148330Snetchild published by the Free Software Foundation.  Oracle designates this
9148330Snetchild particular file as subject to the "Classpath" exception as provided
10148330Snetchild by Oracle in the LICENSE file that accompanied this code.
11148330Snetchild
12148330Snetchild This code is distributed in the hope that it will be useful, but WITHOUT
13148330Snetchild ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14148543Snetchild FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15148543Snetchild version 2 for more details (a copy is included in the LICENSE file that
16148330Snetchild accompanied this code).
17191146Smaxim
18191146Smaxim You should have received a copy of the GNU General Public License version
19191146Smaxim 2 along with this work; if not, write to the Free Software Foundation,
20191146Smaxim Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21191146Smaxim
22191146Smaxim Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23190894Sdanger or visit www.oracle.com if you need additional information or have any
24190905Sdanger questions.
25190751Sed-->
26190864Sru
27190864Sru<project name="jaxp" default="all" basedir=".">
28190751Sed   
29190751Sed    <!-- For 'ant -p' or 'ant -projecthelp' -->
30190751Sed    
31190751Sed    <description>
32190751Sed    Ant build script for the ${ant.project.name} part of the jdk.
33190751Sed
34190864Sru    Input Properties: (see build.properties for the ant defaults)
35190751Sed      bootstrap.dir        - dir with lib/javac.jar, added to javac bootclasspath
36190751Sed      javac.debug          - true or false for debug classfiles
37190751Sed      javac.target         - classfile version target
38190751Sed      javac.source         - source version
39190751Sed
40190751Sed      Run 'make help' for help using the Makefile.
41190751Sed    </description>
42190751Sed
43190751Sed    <!-- Project build properties. -->
44190751Sed    <property file="build.properties"/>
45190864Sru
46190751Sed    <!-- Source dir def -->
47190864Sru    <property name="jaxp.src.dir" value="src/share/classes"/>
48190772Sru    <path id="src.dir.id">
49190772Sru      <pathelement path="${jaxp.src.dir}"/>
50190772Sru    </path>
51190772Sru
52190772Sru    <!-- Initialization of directories needed for build. -->
53190100Sthompsa    <target name="init">
54190100Sthompsa        <mkdir dir="${build.dir}"/>
55189977Sbrueffer        <mkdir dir="${build.classes.dir}"/>
56189977Sbrueffer        <mkdir dir="${dist.dir}"/>
57189585Sthompsa        <mkdir dir="${dist.lib.dir}"/>
58189585Sthompsa    </target>
59189607Sthompsa    
60189607Sthompsa    <!-- Sanity checks and settings -->
61189607Sthompsa    <target name="sanity"
62189585Sthompsa	    depends="-javac-jar-exists"
63190772Sru            description="Display settings of configuration values">
64190772Sru        <echo message="${sanity.info}"/>
65190772Sru    </target>
66190772Sru
67190772Sru     <!-- Check for bootstrap javac.jar file, warn if missing. -->
68190772Sru    <condition property="javac.jar.exists">
69189092Sed        <available file="${javac.jar}" type="file"/>
70189092Sed    </condition>
71190772Sru    <target name="-javac-jar-exists"
72190772Sru            unless="javac.jar.exists">
73190772Sru        <echo message="WARNING: Cannot find ${javac.jar}"/>
74188948Sthompsa    </target>
75189000Sthompsa
76189000Sthompsa    <!-- Creation of distribution files to jdk build process. -->
77189000Sthompsa    <target name="dist"
78189000Sthompsa	    depends="init, build, -dist-classes-jar, -dist-src-zip"
79189000Sthompsa            description="Create all built distribution files.">
80189000Sthompsa    </target>
81189000Sthompsa    <target name="-dist-classes-jar-uptodate"
82189000Sthompsa	    depends="init">
83189000Sthompsa        <condition property="dist.classes.jar.uptodate">
84189000Sthompsa            <and>
85189000Sthompsa                <available file="${dist.classes.jar}" type="file"/>
86189000Sthompsa                <uptodate targetfile="${dist.classes.jar}">
87189000Sthompsa                    <srcfiles dir="${build.classes.dir}" includes="**"/>
88189000Sthompsa                </uptodate>
89188948Sthompsa            </and>
90188948Sthompsa        </condition>
91188948Sthompsa    </target>
92188948Sthompsa    <target name="-dist-classes-jar"
93188948Sthompsa	    depends="init, -dist-classes-jar-uptodate"
94188948Sthompsa            unless="dist.classes.jar.uptodate">
95188948Sthompsa        <delete file="${dist.classes.jar}"/>
96188948Sthompsa        <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
97188948Sthompsa    </target>
98188948Sthompsa
99188948Sthompsa    <!-- Special build area setup. -->
100188948Sthompsa    <target name="-build-setup" depends="init">
101188948Sthompsa        <mkdir dir="${build.classes.dir}"/>
102188948Sthompsa        <copy todir="${build.classes.dir}">
103188948Sthompsa            <fileset dir="${jaxp.src.dir}"
104188948Sthompsa                     includes="**/*.properties"/>
105188948Sthompsa        </copy>
106188948Sthompsa        <replaceregexp match="#(.*)$" replace="#" flags="gm">
107188948Sthompsa            <fileset dir="${build.classes.dir}" includes="**/*.properties"/>
108188948Sthompsa        </replaceregexp>
109188948Sthompsa    </target>
110188948Sthompsa
111188948Sthompsa    <!-- Create src.zip. -->
112188948Sthompsa    <target name="-dist-src-zip" depends="init">
113188948Sthompsa        <zip file="${dist.src.zip}" basedir="${jaxp.src.dir}"/>
114188948Sthompsa    </target>
115188948Sthompsa    
116188948Sthompsa    <!-- Build (compilation) of sources to class files. -->
117188948Sthompsa    <target name="build"
118188948Sthompsa	    depends="compile, -build-setup">
119188948Sthompsa    </target>
120188948Sthompsa    <target name="compile"
121188948Sthompsa	    depends="init">
122188948Sthompsa        <mkdir dir="${build.classes.dir}"/>
123188948Sthompsa        <javac 
124188948Sthompsa	     includeAntRuntime="false" 
125188948Sthompsa	     classpath="${build.classes.dir}:${tools.jar}"
126188948Sthompsa	     fork="true"
127188948Sthompsa             destdir="${build.classes.dir}"
128188948Sthompsa             memoryInitialSize="${javac.memoryInitialSize}"
129188948Sthompsa             memoryMaximumSize="${javac.memoryMaximumSize}"
130188948Sthompsa             source="${javac.source}"
131188652Sed	     debug="${javac.debug}"
132188652Sed             target="${javac.target}">
133188652Sed            <compilerarg value="-J-Xbootclasspath/p:${javac.jar}"/>
134188652Sed            <compilerarg line="${javac.version.opt} ${javac.lint.opts} ${javac.no.jdk.warnings}"/>
135188102Sgabor            <src refid="src.dir.id"/>
136188102Sgabor        </javac>
137187694Santoine    </target>
138187694Santoine
139187694Santoine    <!-- Test. (FIXME: Need to know how to run tests.) -->
140187694Santoine    <target name="test"
141187694Santoine	    depends="init, dist">
142186716Santoine        <echo message="FIXME: How do you run the tests"/>
143186716Santoine    </target>
144186437Sbz    
145186437Sbz    <!-- Populate source area if needed. -->
146185472Santoine    <target name="source"
147185472Santoine            depends="init"
148185472Santoine            description="Populate all source file directories">
149185472Santoine    </target>
150185472Santoine
151183442Sed    <!-- Clean up compiled files. -->
152183442Sed    <target name="clean"
153183442Sed            description="Delete all generated files">
154183442Sed        <delete dir="${build.dir}"/>
155183442Sed        <delete dir="${dist.dir}"/>
156183442Sed    </target>
157183113Sattilio
158183235Santoine    <!-- Clean up compiled files and all imported source files. -->
159183235Santoine    <target name="clobber"
160183026Santoine	    depends="clean"
161183026Santoine            description="Delete all generated files, including imported sources">
162182105Sed    </target>
163182105Sed
164182518Santoine    <target name="-banner">
165182518Santoine        <echo message="+---------------------------------------+"/>
166182518Santoine        <echo message="+ Starting ant project ${ant.project.name} +"/>
167182518Santoine        <echo message="+---------------------------------------+"/>
168182518Santoine    </target>
169182518Santoine   
170182518Santoine    <!-- Do everything but test. -->
171182518Santoine    <target name="all"
172182518Santoine	    depends="-banner, sanity, dist"
173182518Santoine            description="Build everything.">
174182518Santoine        <echo message="+---------------------------------------+"/>
175182518Santoine        <echo message="+ Finishing ant project ${ant.project.name}"/>
176182518Santoine        <echo message="+---------------------------------------+"/>
177182518Santoine    </target>
178182518Santoine
179182518Santoine</project>
180182518Santoine