build.xml

changeset 85
ae2bec597586
parent 71
faa13cd4d6cd
child 91
cc35f0e129d2
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build.xml	Mon Sep 21 13:57:02 2009 -0700
     1.3 @@ -0,0 +1,163 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<!--
     1.6 + Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.7 + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8 +
     1.9 + This code is free software; you can redistribute it and/or modify it
    1.10 + under the terms of the GNU General Public License version 2 only, as
    1.11 + published by the Free Software Foundation.  Sun designates this
    1.12 + particular file as subject to the "Classpath" exception as provided
    1.13 + by Sun in the LICENSE file that accompanied this code.
    1.14 +
    1.15 + This code is distributed in the hope that it will be useful, but WITHOUT
    1.16 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.17 + FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.18 + version 2 for more details (a copy is included in the LICENSE file that
    1.19 + accompanied this code).
    1.20 +
    1.21 + You should have received a copy of the GNU General Public License version
    1.22 + 2 along with this work; if not, write to the Free Software Foundation,
    1.23 + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.24 +
    1.25 + Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.26 + CA 95054 USA or visit www.sun.com if you need additional information or
    1.27 + have any questions.
    1.28 +-->
    1.29 +
    1.30 +<project name="jaxws" default="all" basedir=".">
    1.31 +   
    1.32 +    <!-- For 'ant -p' or 'ant -projecthelp' -->
    1.33 +    
    1.34 +    <description>
    1.35 +    Ant build script for the ${ant.project.name} part of the jdk.
    1.36 +
    1.37 +    Input Properties: (see build.properties for the ant defaults)
    1.38 +      bootstrap.dir        - dir with lib/javac.jar, added to javac bootclasspath
    1.39 +      javac.debug          - true or false for debug classfiles
    1.40 +      javac.target         - classfile version target
    1.41 +      javac.source         - source version
    1.42 +    </description>
    1.43 +
    1.44 +    <!-- Mac is special, need to downgrade these before build.properties. -->
    1.45 +    <condition property="javac.source" value="1.5">
    1.46 +        <os family="mac"/>
    1.47 +    </condition>
    1.48 +    <condition property="javac.target" value="1.5">
    1.49 +        <os family="mac"/>
    1.50 +    </condition>
    1.51 +
    1.52 +    <!-- Project build properties. -->
    1.53 +    <property file="build.properties"/>
    1.54 +
    1.55 +    <!-- Get shared targets. -->
    1.56 +    <import file="build-defs.xml"/>
    1.57 +
    1.58 +    <!-- Initialization of directories needed for build. -->
    1.59 +    <target name="init">
    1.60 +        <mkdir dir="${build.dir}"/>
    1.61 +        <mkdir dir="${build.classes.dir}"/>
    1.62 +        <mkdir dir="${dist.dir}"/>
    1.63 +        <mkdir dir="${dist.lib.dir}"/>
    1.64 +    </target>
    1.65 +    
    1.66 +    <!-- Sanity checks and settings -->
    1.67 +    <target name="sanity"
    1.68 +	    depends="-javac-jar-exists"
    1.69 +            description="Display settings of configuration values">
    1.70 +        <echo message="${sanity.info}"/>
    1.71 +    </target>
    1.72 +
    1.73 +     <!-- Check for bootstrap javac.jar file, warn if missing. -->
    1.74 +    <condition property="javac.jar.exists">
    1.75 +        <available file="${javac.jar}" type="file"/>
    1.76 +    </condition>
    1.77 +    <target name="-javac-jar-exists"
    1.78 +            unless="javac.jar.exists">
    1.79 +        <echo message="WARNING: Cannot find ${javac.jar}"/>
    1.80 +    </target>
    1.81 +
    1.82 +    <!-- Creation of distribution files to jdk build process. -->
    1.83 +    <target name="dist"
    1.84 +	    depends="init, -init-src-dirs, build, -dist-classes-jar, -dist-src-zip"
    1.85 +            description="Create all built distribution files.">
    1.86 +    </target>
    1.87 +    <target name="-dist-classes-jar-uptodate"
    1.88 +	    depends="init, -init-src-dirs">
    1.89 +        <condition property="dist.classes.jar.uptodate">
    1.90 +            <and>
    1.91 +                <available file="${dist.classes.jar}" type="file"/>
    1.92 +                <uptodate targetfile="${dist.classes.jar}">
    1.93 +                    <srcfiles dir="${build.classes.dir}" includes="**"/>
    1.94 +                </uptodate>
    1.95 +            </and>
    1.96 +        </condition>
    1.97 +    </target>
    1.98 +    <target name="-dist-classes-jar"
    1.99 +	    depends="init, -init-src-dirs, -dist-classes-jar-uptodate"
   1.100 +            unless="dist.classes.jar.uptodate">
   1.101 +        <delete file="${dist.classes.jar}"/>
   1.102 +        <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
   1.103 +    </target>
   1.104 +
   1.105 +    <target name="-build-prep"
   1.106 +	    depends="init, -init-src-dirs, -drop-build-prep">
   1.107 +    </target>
   1.108 +
   1.109 +    <!-- Build (compilation) of sources to class files. -->
   1.110 +    <target name="build"
   1.111 +	    depends="init, -init-src-dirs, -build-prep">
   1.112 +        <javac fork="true"
   1.113 +             destdir="${build.classes.dir}"
   1.114 +             memoryInitialSize="${javac.memoryInitialSize}"
   1.115 +             memoryMaximumSize="${javac.memoryMaximumSize}"
   1.116 +             source="${javac.source}"
   1.117 +	     debug="${javac.debug}"
   1.118 +             target="${javac.target}">
   1.119 +            <compilerarg value="-J-Xbootclasspath/p:${javac.jar}"/>
   1.120 +            <compilerarg line="${javac.version.opt} ${javac.lint.opts} ${javac.no.jdk.warnings}"/>
   1.121 +            <src refid="src.dir.id"/>
   1.122 +        </javac>
   1.123 +    </target>
   1.124 +
   1.125 +    <!-- Test. (FIXME: Need to know how to run tests.) -->
   1.126 +    <target name="test"
   1.127 +	    depends="init, -init-src-dirs, dist">
   1.128 +        <echo message="FIXME: How do you run the tests"/>
   1.129 +    </target>
   1.130 +    
   1.131 +    <!-- Populate source area if needed. -->
   1.132 +    <target name="source"
   1.133 +            depends="init, -init-src-dirs"
   1.134 +            description="Populate all source file directories">
   1.135 +    </target>
   1.136 +
   1.137 +    <!-- Clean up compiled files. -->
   1.138 +    <target name="clean"
   1.139 +            description="Delete all generated files">
   1.140 +        <delete dir="${build.dir}"/>
   1.141 +        <delete dir="${dist.dir}"/>
   1.142 +    </target>
   1.143 +
   1.144 +    <!-- Clean up compiled files and all imported source files. -->
   1.145 +    <target name="clobber"
   1.146 +	    depends="clean"
   1.147 +            description="Delete all generated files, including imported sources">
   1.148 +        <delete dir="${drop.dir}"/>
   1.149 +    </target>
   1.150 +
   1.151 +    <target name="-banner">
   1.152 +        <echo message="+---------------------------------------+"/>
   1.153 +        <echo message="+ Starting ant project ${ant.project.name} +"/>
   1.154 +        <echo message="+---------------------------------------+"/>
   1.155 +    </target>
   1.156 +   
   1.157 +    <!-- Do everything but test. -->
   1.158 +    <target name="all"
   1.159 +	    depends="-banner, sanity, dist"
   1.160 +            description="Build everything.">
   1.161 +        <echo message="+---------------------------------------+"/>
   1.162 +        <echo message="+ Finishing ant project ${ant.project.name}"/>
   1.163 +        <echo message="+---------------------------------------+"/>
   1.164 +    </target>
   1.165 +
   1.166 +</project>

mercurial