build.xml

Thu, 25 Mar 2010 15:05:24 -0700

author
mikejwre
date
Thu, 25 Mar 2010 15:05:24 -0700
changeset 108
8c666f8f3565
parent 95
4023edcd8433
child 116
4ac192952d75
permissions
-rw-r--r--

Added tag jdk7-b87 for changeset 3febd6fab2ac

duke@1 1 <?xml version="1.0"?>
duke@1 2 <!--
ohair@85 3 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
duke@1 4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 5
duke@1 6 This code is free software; you can redistribute it and/or modify it
duke@1 7 under the terms of the GNU General Public License version 2 only, as
duke@1 8 published by the Free Software Foundation. Sun designates this
duke@1 9 particular file as subject to the "Classpath" exception as provided
duke@1 10 by Sun in the LICENSE file that accompanied this code.
duke@1 11
duke@1 12 This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 15 version 2 for more details (a copy is included in the LICENSE file that
duke@1 16 accompanied this code).
duke@1 17
duke@1 18 You should have received a copy of the GNU General Public License version
duke@1 19 2 along with this work; if not, write to the Free Software Foundation,
duke@1 20 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 21
duke@1 22 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@1 23 CA 95054 USA or visit www.sun.com if you need additional information or
duke@1 24 have any questions.
duke@1 25 -->
duke@1 26
ohair@85 27 <project name="jaxws" default="all" basedir=".">
ohair@85 28
ohair@85 29 <!-- For 'ant -p' or 'ant -projecthelp' -->
ohair@85 30
ohair@85 31 <description>
ohair@85 32 Ant build script for the ${ant.project.name} part of the jdk.
duke@1 33
ohair@85 34 Input Properties: (see build.properties for the ant defaults)
ohair@85 35 bootstrap.dir - dir with lib/javac.jar, added to javac bootclasspath
ohair@85 36 javac.debug - true or false for debug classfiles
ohair@85 37 javac.target - classfile version target
ohair@85 38 javac.source - source version
ohair@85 39 </description>
duke@1 40
ohair@85 41 <!-- Mac is special, need to downgrade these before build.properties. -->
ohair@85 42 <condition property="javac.source" value="1.5">
ohair@85 43 <os family="mac"/>
ohair@85 44 </condition>
ohair@85 45 <condition property="javac.target" value="1.5">
ohair@85 46 <os family="mac"/>
ohair@85 47 </condition>
ohair@85 48
ohair@85 49 <!-- Project build properties. -->
duke@1 50 <property file="build.properties"/>
duke@1 51
ohair@91 52 <!-- See if drop sources were included. -->
ohair@91 53 <condition property="drop.dir"
ohair@91 54 value="${drop.included.dir}"
ohair@91 55 else="${drop.expanded.dir}">
ohair@91 56 <available file="${drop.included.dir}" type="dir"/>
ohair@91 57 </condition>
ohair@91 58
ohair@85 59 <!-- Get shared targets. -->
ohair@85 60 <import file="build-defs.xml"/>
ohair@85 61
ohair@85 62 <!-- Initialization of directories needed for build. -->
ohair@85 63 <target name="init">
ohair@85 64 <mkdir dir="${build.dir}"/>
ohair@85 65 <mkdir dir="${build.classes.dir}"/>
ohair@85 66 <mkdir dir="${dist.dir}"/>
ohair@85 67 <mkdir dir="${dist.lib.dir}"/>
ohair@85 68 </target>
ohair@85 69
ohair@85 70 <!-- Sanity checks and settings -->
ohair@85 71 <target name="sanity"
ohair@85 72 depends="-javac-jar-exists"
ohair@85 73 description="Display settings of configuration values">
ohair@85 74 <echo message="${sanity.info}"/>
duke@1 75 </target>
duke@1 76
ohair@85 77 <!-- Check for bootstrap javac.jar file, warn if missing. -->
ohair@85 78 <condition property="javac.jar.exists">
ohair@85 79 <available file="${javac.jar}" type="file"/>
ohair@85 80 </condition>
ohair@85 81 <target name="-javac-jar-exists"
ohair@85 82 unless="javac.jar.exists">
ohair@85 83 <echo message="WARNING: Cannot find ${javac.jar}"/>
duke@1 84 </target>
duke@1 85
ohair@85 86 <!-- Creation of distribution files to jdk build process. -->
ohair@85 87 <target name="dist"
ohair@85 88 depends="init, -init-src-dirs, build, -dist-classes-jar, -dist-src-zip"
ohair@85 89 description="Create all built distribution files.">
ohair@85 90 </target>
ohair@85 91 <target name="-dist-classes-jar-uptodate"
ohair@85 92 depends="init, -init-src-dirs">
ohair@85 93 <condition property="dist.classes.jar.uptodate">
ohair@85 94 <and>
ohair@85 95 <available file="${dist.classes.jar}" type="file"/>
ohair@85 96 <uptodate targetfile="${dist.classes.jar}">
ohair@85 97 <srcfiles dir="${build.classes.dir}" includes="**"/>
ohair@85 98 </uptodate>
ohair@85 99 </and>
ohair@85 100 </condition>
ohair@85 101 </target>
ohair@85 102 <target name="-dist-classes-jar"
ohair@85 103 depends="init, -init-src-dirs, -dist-classes-jar-uptodate"
ohair@85 104 unless="dist.classes.jar.uptodate">
ohair@85 105 <delete file="${dist.classes.jar}"/>
ohair@85 106 <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
duke@1 107 </target>
duke@1 108
ohair@85 109 <target name="-build-prep"
ohair@85 110 depends="init, -init-src-dirs, -drop-build-prep">
duke@1 111 </target>
duke@1 112
ohair@85 113 <!-- Build (compilation) of sources to class files. -->
ohair@85 114 <target name="build"
ohair@85 115 depends="init, -init-src-dirs, -build-prep">
ohair@95 116 <javac
ohair@95 117 includeAntRuntime="false"
ohair@95 118 classpath="${build.classes.dir}:${tools.jar}"
ohair@95 119 fork="true"
duke@1 120 destdir="${build.classes.dir}"
duke@1 121 memoryInitialSize="${javac.memoryInitialSize}"
duke@1 122 memoryMaximumSize="${javac.memoryMaximumSize}"
jjg@63 123 source="${javac.source}"
aph@54 124 debug="${javac.debug}"
ohair@85 125 target="${javac.target}">
ohair@85 126 <compilerarg value="-J-Xbootclasspath/p:${javac.jar}"/>
ohair@85 127 <compilerarg line="${javac.version.opt} ${javac.lint.opts} ${javac.no.jdk.warnings}"/>
ohair@85 128 <src refid="src.dir.id"/>
ohair@85 129 </javac>
duke@1 130 </target>
duke@1 131
ohair@85 132 <!-- Test. (FIXME: Need to know how to run tests.) -->
ohair@85 133 <target name="test"
ohair@85 134 depends="init, -init-src-dirs, dist">
ohair@85 135 <echo message="FIXME: How do you run the tests"/>
ohair@85 136 </target>
ohair@85 137
ohair@85 138 <!-- Populate source area if needed. -->
ohair@85 139 <target name="source"
ohair@85 140 depends="init, -init-src-dirs"
ohair@85 141 description="Populate all source file directories">
duke@1 142 </target>
duke@1 143
ohair@91 144 <!-- Populate drop_included area. -->
ohair@91 145 <target name="drop_included"
ohair@91 146 depends="clobber"
ohair@91 147 description="Populate all source file directories">
ohair@91 148 <delete dir="${drop.included.dir}"/>
ohair@91 149 <antcall target="source"/>
ohair@91 150 <move file="${drop.expanded.dir}" tofile="${drop.included.dir}"/>
ohair@91 151 <delete dir="${drop.included.dir}/bundles"/>
ohair@91 152 </target>
ohair@91 153
ohair@85 154 <!-- Clean up compiled files. -->
ohair@85 155 <target name="clean"
ohair@85 156 description="Delete all generated files">
ohair@85 157 <delete dir="${build.dir}"/>
ohair@85 158 <delete dir="${dist.dir}"/>
ohair@85 159 </target>
ohair@85 160
ohair@85 161 <!-- Clean up compiled files and all imported source files. -->
ohair@85 162 <target name="clobber"
ohair@85 163 depends="clean"
ohair@85 164 description="Delete all generated files, including imported sources">
ohair@91 165 <delete dir="${drop.expanded.dir}"/>
ohair@85 166 </target>
ohair@85 167
ohair@85 168 <target name="-banner">
ohair@85 169 <echo message="+---------------------------------------+"/>
ohair@85 170 <echo message="+ Starting ant project ${ant.project.name} +"/>
ohair@85 171 <echo message="+---------------------------------------+"/>
ohair@85 172 </target>
ohair@85 173
ohair@85 174 <!-- Do everything but test. -->
ohair@85 175 <target name="all"
ohair@85 176 depends="-banner, sanity, dist"
ohair@85 177 description="Build everything.">
ohair@85 178 <echo message="+---------------------------------------+"/>
ohair@85 179 <echo message="+ Finishing ant project ${ant.project.name}"/>
ohair@85 180 <echo message="+---------------------------------------+"/>
duke@1 181 </target>
duke@1 182
duke@1 183 </project>

mercurial