build.xml

changeset 0
373ffda63c9a
child 637
9c07ef4934dd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build.xml	Wed Apr 27 01:27:09 2016 +0800
     1.3 @@ -0,0 +1,198 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<!--
     1.6 + Copyright (c) 2009, 2010, Oracle and/or its affiliates. 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.  Oracle designates this
    1.12 + particular file as subject to the "Classpath" exception as provided
    1.13 + by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.26 + or visit www.oracle.com if you need additional information or have any
    1.27 + 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 +
    1.43 +      Run 'make help' for help using the Makefile.
    1.44 +    </description>
    1.45 +
    1.46 +    <!-- Project build properties. -->
    1.47 +    <property file="build.properties"/>
    1.48 +
    1.49 +    <property name="jaxws.src.dir" value="src/share/jaxws_classes"/>
    1.50 +    <property name="jaf.src.dir" value="src/share/jaf_classes"/>
    1.51 +    <path id="src.dir.id">
    1.52 +      <pathelement path="${jaxws.src.dir}"/>
    1.53 +      <pathelement path="${jaf.src.dir}"/>
    1.54 +    </path>
    1.55 +
    1.56 +    <!-- Initialization of directories needed for build. -->
    1.57 +    <target name="init">
    1.58 +        <mkdir dir="${build.dir}"/>
    1.59 +        <mkdir dir="${build.classes.dir}"/>
    1.60 +        <mkdir dir="${dist.dir}"/>
    1.61 +        <mkdir dir="${dist.lib.dir}"/>
    1.62 +    </target>
    1.63 +    
    1.64 +    <!-- Sanity checks and settings -->
    1.65 +    <target name="sanity"
    1.66 +	    depends="-javac-jar-exists"
    1.67 +            description="Display settings of configuration values">
    1.68 +        <echo message="${sanity.info}"/>
    1.69 +    </target>
    1.70 +
    1.71 +     <!-- Check for bootstrap javac.jar file, warn if missing. -->
    1.72 +    <condition property="javac.jar.exists">
    1.73 +        <available file="${javac.jar}" type="file"/>
    1.74 +    </condition>
    1.75 +    <target name="-javac-jar-exists"
    1.76 +            unless="javac.jar.exists">
    1.77 +        <echo message="WARNING: Cannot find ${javac.jar}"/>
    1.78 +    </target>
    1.79 +    
    1.80 +    <!-- Create src.zip. -->
    1.81 +    <target name="-dist-src-zip" depends="init">
    1.82 +        <zip file="${dist.src.zip}" basedir="${jaxws.src.dir}"/>
    1.83 +        <zip file="${dist.src.zip}" basedir="${jaf.src.dir}" update="true"/>
    1.84 +    </target>
    1.85 +
    1.86 +    <!-- Creation of distribution files to jdk build process. -->
    1.87 +    <target name="dist"
    1.88 +	    depends="init, build, -dist-classes-jar, -dist-src-zip"
    1.89 +            description="Create all built distribution files.">
    1.90 +    </target>
    1.91 +    <target name="-dist-classes-jar-uptodate"
    1.92 +	    depends="init">
    1.93 +        <condition property="dist.classes.jar.uptodate">
    1.94 +            <and>
    1.95 +                <available file="${dist.classes.jar}" type="file"/>
    1.96 +                <uptodate targetfile="${dist.classes.jar}">
    1.97 +                    <srcfiles dir="${build.classes.dir}" includes="**"/>
    1.98 +                </uptodate>
    1.99 +            </and>
   1.100 +        </condition>
   1.101 +    </target>
   1.102 +    <target name="-dist-classes-jar"
   1.103 +	    depends="init, -dist-classes-jar-uptodate"
   1.104 +            unless="dist.classes.jar.uptodate">
   1.105 +        <delete file="${dist.classes.jar}"/>
   1.106 +        <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
   1.107 +    </target>
   1.108 +
   1.109 +    <!-- Special build area setup. -->
   1.110 +    <target name="-build-setup" depends="init">
   1.111 +        <mkdir dir="${build.classes.dir}"/>
   1.112 +        <copy todir="${build.classes.dir}">
   1.113 +            <fileset dir="${jaxws.src.dir}"
   1.114 +                includes="**/*.xsd, **/*.default, **/*.properties"
   1.115 +                excludes="**/*.java, **/*.package.html"/>
   1.116 +        </copy>
   1.117 +        <replaceregexp match="#(.*)$" replace="#" flags="gm">
   1.118 +            <fileset dir="${build.classes.dir}" includes="**/*.properties"/>
   1.119 +        </replaceregexp>
   1.120 +
   1.121 +        <mkdir dir="${build.classes.dir}/META-INF/services"/>
   1.122 +        <copy todir="${build.classes.dir}/META-INF"
   1.123 +            file="${jaf.src.dir}/META-INF/mailcap.default"/>
   1.124 +        <copy todir="${build.classes.dir}/META-INF"
   1.125 +            file="${jaf.src.dir}/META-INF/mimetypes.default"/>
   1.126 +        <copy todir="${build.classes.dir}/META-INF/services"
   1.127 +            file="${jaxws.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin"/>
   1.128 +        <copy todir="${build.classes.dir}/META-INF/services"
   1.129 +            file="${jaxws.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin"/>
   1.130 +        <mkdir dir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime"/>
   1.131 +        <copy todir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime">
   1.132 +            <fileset dir="${jaxws.src.dir}/com/sun/tools/internal/xjc/runtime"
   1.133 +                includes="**/*.java"
   1.134 +                excludes="**/*.package.html"/>
   1.135 +        </copy>
   1.136 +    </target>
   1.137 +
   1.138 +    <!-- Build (compilation) of sources to class files. -->
   1.139 +    <target name="build"
   1.140 +	    depends="compile, -build-setup">
   1.141 +    </target>
   1.142 +    <target name="compile"
   1.143 +	    depends="init">
   1.144 +        <mkdir dir="${build.classes.dir}"/>
   1.145 +        <javac 
   1.146 +	     includeAntRuntime="false" 
   1.147 +	     classpath="${build.classes.dir}:${tools.jar}"
   1.148 +	     fork="true"
   1.149 +             destdir="${build.classes.dir}"
   1.150 +             memoryInitialSize="${javac.memoryInitialSize}"
   1.151 +             memoryMaximumSize="${javac.memoryMaximumSize}"
   1.152 +             source="${javac.source}"
   1.153 +	     debug="${javac.debug}"
   1.154 +             target="${javac.target}">
   1.155 +            <compilerarg value="-J-Xbootclasspath/p:${javac.jar}"/>
   1.156 +            <compilerarg line="${javac.version.opt} ${javac.lint.opts} ${javac.no.jdk.warnings}"/>
   1.157 +            <src refid="src.dir.id"/>
   1.158 +        </javac>
   1.159 +    </target>
   1.160 +
   1.161 +    <!-- Test. (FIXME: Need to know how to run tests.) -->
   1.162 +    <target name="test"
   1.163 +	    depends="init, dist">
   1.164 +        <echo message="FIXME: How do you run the tests"/>
   1.165 +    </target>
   1.166 +    
   1.167 +    <!-- Populate source area if needed. -->
   1.168 +    <target name="source"
   1.169 +            depends="init"
   1.170 +            description="Populate all source file directories">
   1.171 +    </target>
   1.172 +
   1.173 +    <!-- Clean up compiled files. -->
   1.174 +    <target name="clean"
   1.175 +            description="Delete all generated files">
   1.176 +        <delete dir="${build.dir}"/>
   1.177 +        <delete dir="${dist.dir}"/>
   1.178 +    </target>
   1.179 +
   1.180 +    <!-- Clean up compiled files and all imported source files. -->
   1.181 +    <target name="clobber"
   1.182 +	    depends="clean"
   1.183 +            description="Delete all generated files, including imported sources">
   1.184 +    </target>
   1.185 +
   1.186 +    <target name="-banner">
   1.187 +        <echo message="+---------------------------------------+"/>
   1.188 +        <echo message="+ Starting ant project ${ant.project.name} +"/>
   1.189 +        <echo message="+---------------------------------------+"/>
   1.190 +    </target>
   1.191 +   
   1.192 +    <!-- Do everything but test. -->
   1.193 +    <target name="all"
   1.194 +	    depends="-banner, sanity, dist"
   1.195 +            description="Build everything.">
   1.196 +        <echo message="+---------------------------------------+"/>
   1.197 +        <echo message="+ Finishing ant project ${ant.project.name}"/>
   1.198 +        <echo message="+---------------------------------------+"/>
   1.199 +    </target>
   1.200 +
   1.201 +</project>

mercurial