build.xml

Sat, 07 Nov 2020 10:05:19 +0800

author
aoqi
date
Sat, 07 Nov 2020 10:05:19 +0800
changeset 1920
fdbe50121f48
parent 637
9c07ef4934dd
permissions
-rw-r--r--

Merge

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

mercurial