build-defs.xml

changeset 85
ae2bec597586
child 87
558985e26fe1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build-defs.xml	Mon Sep 21 13:57:02 2009 -0700
     1.3 @@ -0,0 +1,138 @@
     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_defs" default="all" basedir=".">
    1.31 +     
    1.32 +    <!-- Specific build properties. -->
    1.33 +    <property file="jaxws.properties"/>
    1.34 +
    1.35 +    <!-- Where generated xml files will stay. -->
    1.36 +    <property name="xml.gen.dir" value="${build.dir}/xml_generated"/>
    1.37 +    <property name="xml.template" value="build-drop-template.xml"/>
    1.38 +
    1.39 +    <!--  ############### -->
    1.40 +    <!--  Begin Macrodefs -->
    1.41 +
    1.42 +    <!-- Copies template file, replaces @DROP@ pattern, and imports it. -->
    1.43 +    <macrodef name="drop-import">
    1.44 +        <attribute name="name"/>
    1.45 +        <sequential>
    1.46 +            <property name="xml.gen.@{name}" value="${xml.gen.dir}/build-drop-@{name}.xml"/>
    1.47 +            <mkdir dir="${xml.gen.dir}"/>
    1.48 +            <copy file="${xml.template}" tofile="${xml.gen.@{name}}"/>
    1.49 +            <replace file="${xml.gen.@{name}}" token="@DROP@" value="@{name}"/>
    1.50 +            <import file="${xml.gen.@{name}}"/>
    1.51 +        </sequential>
    1.52 +    </macrodef>
    1.53 +
    1.54 +    <!--  End of Macrodefs -->
    1.55 +    <!--  ############### -->
    1.56 +
    1.57 +    <!-- Create xml file and import it for these drops. -->
    1.58 +    <drop-import name="jaxws_src"/>
    1.59 +    <drop-import name="jaf_src"/>
    1.60 +    <!-- <drop-import name="jaxws_tests"/> -->
    1.61 +
    1.62 +    <!-- Special build area preparation. -->
    1.63 +    <target name="-drop-build-prep" depends="init, -init-src-dirs">
    1.64 +        <mkdir dir="${build.classes.dir}"/>
    1.65 +        <copy todir="${build.classes.dir}">
    1.66 +            <fileset dir="${primary.src.dir}"
    1.67 +                     includes="**/*.xsd, **/*.default"
    1.68 +                     excludes="**/*.java, **/*.package.html, **/*.properties"/>
    1.69 +        </copy>
    1.70 +        <mkdir dir="${build.classes.dir}/META-INF/services"/>
    1.71 +        <copy todir="${build.classes.dir}/META-INF/services"
    1.72 +              file="${primary.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory"/>
    1.73 +        <copy todir="${build.classes.dir}/META-INF/services"
    1.74 +              file="${primary.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin"/>
    1.75 +        <mkdir dir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime"/>
    1.76 +        <copy todir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime">
    1.77 +            <fileset dir="${primary.src.dir}/com/sun/tools/internal/xjc/runtime"
    1.78 +                     includes="**/*.java"
    1.79 +                     excludes="**/*.package.html"/>
    1.80 +        </copy>
    1.81 +    </target>
    1.82 +
    1.83 +    <!-- Try to get drop sources, set property use.orig.src.dir if no drops. -->
    1.84 +    <target name="-set-props"
    1.85 +	    depends="init,
    1.86 +                     jaxws_src-update,
    1.87 +                     jaf_src-update">
    1.88 +        <condition property="use.orig.src.dir">
    1.89 +            <and>
    1.90 +                <available file="${orig.src.dir}" type="dir"/>
    1.91 +                <not>
    1.92 +                    <and>
    1.93 +                        <available file="${jaxws_src.src.dir}" type="dir"/>
    1.94 +                        <available file="${jaf_src.src.dir}"   type="dir"/>
    1.95 +                    </and>
    1.96 +                </not>
    1.97 +            </and>
    1.98 +        </condition>
    1.99 +    </target>
   1.100 +
   1.101 +    <!-- Set up source to use orig.src.dir, if use.orig.src.dir defined. -->
   1.102 +    <target name="-use-orig" depends="-set-props" if="use.orig.src.dir">
   1.103 +        <property name="primary.src.dir" value="${orig.src.dir}"/>
   1.104 +        <path id="src.dir.id">
   1.105 +            <pathelement path="${primary.src.dir}"/>
   1.106 +        </path>
   1.107 +    </target>
   1.108 +
   1.109 +    <!-- Set up source to use drop.dir, if use.orig.src.dir not defined. -->
   1.110 +    <target name="-use-drop" depends="-set-props" unless="use.orig.src.dir">
   1.111 +        <property name="primary.src.dir" value="${jaxws_src.src.dir}"/>
   1.112 +        <path id="src.dir.id">
   1.113 +            <pathelement path="${primary.src.dir}"/>
   1.114 +            <pathelement path="${jaf_src.src.dir}"/>
   1.115 +        </path>
   1.116 +    </target>
   1.117 +
   1.118 +    <!-- Source directory selection. -->
   1.119 +    <target name="-init-src-dirs"
   1.120 +	    depends="init, -use-orig, -use-drop">
   1.121 +        <echo message="Using primary.src.dir=${primary.src.dir}"/>
   1.122 +        <pathconvert property="src.list.id" refid="src.dir.id"/>
   1.123 +        <echo message="Using src.dir.id=${src.list.id}"/>
   1.124 +    </target>
   1.125 +
   1.126 +    <!-- Create orig src.zip. -->
   1.127 +    <target name="-orig-src-zip" depends="init, -set-props" if="use.orig.src.dir">
   1.128 +        <zip file="${dist.src.zip}" basedir="${primary.src.dir}"/>
   1.129 +    </target>
   1.130 +
   1.131 +    <!-- Create drop src.zip. -->
   1.132 +    <target name="-drop-src-zip" depends="init, -set-props" unless="use.orig.src.dir">
   1.133 +        <zip file="${dist.src.zip}" basedir="${primary.src.dir}"/>
   1.134 +        <zip file="${dist.src.zip}" basedir="${jaf_src.src.dir}" update="true"/>
   1.135 +    </target>
   1.136 +
   1.137 +    <!-- Create src.zip. -->
   1.138 +    <target name="-dist-src-zip" depends="init, -orig-src-zip, -drop-src-zip">
   1.139 +    </target>
   1.140 +    
   1.141 +</project>

mercurial