jaxp/make/build.xml
author yan
Tue, 21 Jul 2009 23:23:57 -0700
changeset 3245 a6a0857bdeca
parent 2967 faa3111c009c
child 3294 8943b2e74175
permissions -rw-r--r--
Merge

<?xml version="1.0"?>
<!--
 Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.

 This code is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License version 2 only, as
 published by the Free Software Foundation.  Sun designates this
 particular file as subject to the "Classpath" exception as provided
 by Sun in the LICENSE file that accompanied this code.

 This code is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 version 2 for more details (a copy is included in the LICENSE file that
 accompanied this code).

 You should have received a copy of the GNU General Public License version
 2 along with this work; if not, write to the Free Software Foundation,
 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 CA 95054 USA or visit www.sun.com if you need additional information or
 have any questions.
-->

<!--
 This is the main build file for the complete jaxp workspace.
 -->

<project name="jaxp" default="all" basedir=".">

    <!-- Convenient shorthands for standard locations within the workspace. -->
    <property file="build.properties"/>
    <property name="topdir" value=".."/>
    <property name="build.dir" location="${topdir}/build"/>
    <property name="build.classes.dir" location="${build.dir}/classes"/>
    <property name="build.gensrc.dir" location="${build.dir}/gensrc"/>
    <property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/>
    <property name="dist.dir" location="${topdir}/dist"/>
    <property name="dist.lib.dir" location="${dist.dir}/lib"/>
    <property name="make.dir" location="${topdir}/make"/>
    <property name="make.tools.dir" location="${make.dir}/tools"/>
    <property name="src.dir" location="${topdir}/src"/>
    <property name="src.classes.dir" location="${src.dir}/share/classes"/>
    <property environment="env"/>

    <target name="build" depends="banner, build-classes, build-tools">
	<mkdir dir="${dist.lib.dir}"/>
	<jar file="${dist.lib.dir}/classes.jar" basedir="${build.classes.dir}"/>
	<zip file="${dist.lib.dir}/src.zip" basedir="${src.classes.dir}"/>
    </target>

    <!-- Debug information -->
    <target name="sanity"
        description="display settings of configuration values">
	<echo level="info">ant.home = ${ant.home}</echo>
	<echo level="info">java.home = ${env.JAVA_HOME}</echo>
	<echo level="info">bootstrap.dir = ${bootstrap.dir}</echo>
    </target>

    <target name="build-tools" depends="-defs-pstrip">
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${build.classes.dir}"/>
	    <pstrip srcdir="${src.classes.dir}"
                    destdir="${build.classes.dir}"
		    includes="**/*.properties"/>
    </target>

    <target name="-defs-pstrip">
      <mkdir dir="${build.toolclasses.dir}"/>
      <javac srcdir="${make.tools.dir}/StripProperties"
		destdir="${build.toolclasses.dir}/"
		classpath="${ant.home}/lib/ant.jar"/>
      <taskdef name="pstrip"
		 classname="StripPropertiesTask"
		 classpath="${build.toolclasses.dir}/"/>
    </target>

    <target name="build-classes" depends="sanity">
      <mkdir dir="${build.dir}"/>
      <mkdir dir="${build.classes.dir}"/>
      <javac fork="true"
             srcdir="${src.classes.dir}"
             destdir="${build.classes.dir}"
             memoryInitialSize="${javac.memoryInitialSize}"
             memoryMaximumSize="${javac.memoryMaximumSize}"
	     source="${javac.source}"
	     debug="${javac.debug}"
             target="${javac.target}">
         <compilerarg value="-J-Xbootclasspath/p:${bootstrap.dir}/lib/javac.jar"/>
         <compilerarg line="${javac.version.opt}"/>
      </javac>
    </target>

    <target name="clean" description="Delete all generated files">
	<delete dir="${build.dir}"/>
	<delete dir="${dist.dir}"/>
    </target>

    <target name="banner">
      <echo>+---------------------------------------+</echo>
      <echo>+    Building JAXP Component            +</echo>
      <echo>+---------------------------------------+</echo>
    </target>

</project>