1 <?xml version="1.0"?> 2 <!-- 3 Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 6 This code is free software; you can redistribute it and/or modify it 7 under the terms of the GNU General Public License version 2 only, as 8 published by the Free Software Foundation. Oracle designates this 9 particular file as subject to the "Classpath" exception as provided 10 by Oracle in the LICENSE file that accompanied this code. 11 12 This code is distributed in the hope that it will be useful, but WITHOUT 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 version 2 for more details (a copy is included in the LICENSE file that 16 accompanied this code). 17 18 You should have received a copy of the GNU General Public License version 19 2 along with this work; if not, write to the Free Software Foundation, 20 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 21 22 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 23 or visit www.oracle.com if you need additional information or have any 24 questions. 25 --> 26 27 <project name="jaxws_defs" default="all" basedir="."> 28 29 <!-- Specific build properties. --> 30 <property file="jaxws.properties"/> 31 32 <!-- Where generated xml files will stay. --> 33 <property name="xml.gen.dir" value="${build.dir}/xml_generated"/> 34 <property name="xml.template" value="build-drop-template.xml"/> 35 36 <!-- ############### --> 37 <!-- Begin Macrodefs --> 38 39 <!-- Copies template file, replaces @DROP@ pattern, and imports it. --> 40 <macrodef name="drop-import"> 41 <attribute name="name"/> 42 <sequential> 43 <property name="xml.gen.@{name}" value="${xml.gen.dir}/build-drop-@{name}.xml"/> 44 <mkdir dir="${xml.gen.dir}"/> 45 <copy file="${xml.template}" tofile="${xml.gen.@{name}}"/> 46 <replace file="${xml.gen.@{name}}" token="@DROP@" value="@{name}"/> 47 <import file="${xml.gen.@{name}}"/> 48 </sequential> 49 </macrodef> 50 51 <!-- End of Macrodefs --> 52 <!-- ############### --> 53 54 <!-- Create xml file and import it for these drops. --> 55 <drop-import name="jaxws_src"/> 56 <drop-import name="jaf_src"/> 57 <!-- <drop-import name="jaxws_tests"/> --> 58 59 <!-- Fail and print helpful messages if source does not exist. --> 60 <target name="-src-help"> 61 <fail message="${failed.url.src.message}"> 62 <condition> 63 <and> 64 <not> 65 <and> 66 <available file="${jaxws_src.src.dir}" type="dir"/> 67 <available file="${jaf_src.src.dir}" type="dir"/> 68 </and> 69 </not> 70 <istrue value="${allow.downloads}"/> 71 </and> 72 </condition> 73 </fail> 74 <fail message="${failed.nourl.src.message}"> 75 <condition> 76 <not> 77 <and> 78 <available file="${jaxws_src.src.dir}" type="dir"/> 79 <available file="${jaf_src.src.dir}" type="dir"/> 80 </and> 81 </not> 82 </condition> 83 </fail> 84 </target> 85 86 <!-- Special build area setup. --> 87 <target name="-drop-build-setup" depends="init, -init-src-dirs"> 88 <mkdir dir="${build.classes.dir}"/> 89 <copy todir="${build.classes.dir}"> 90 <fileset dir="${primary.src.dir}" 91 includes="**/*.xsd, **/*.default, **/*.properties" 92 excludes="**/*.java, **/*.package.html"/> 93 </copy> 94 <replaceregexp match="#(.*)$" replace="#" flags="gm"> 95 <fileset dir="${build.classes.dir}" includes="**/*.properties"/> 96 </replaceregexp> 97 98 <mkdir dir="${build.classes.dir}/META-INF/services"/> 99 <copy todir="${build.classes.dir}/META-INF" 100 file="${secondary.src.dir}/META-INF/mailcap.default"/> 101 <copy todir="${build.classes.dir}/META-INF" 102 file="${secondary.src.dir}/META-INF/mimetypes.default"/> 103 <copy todir="${build.classes.dir}/META-INF/services" 104 file="${primary.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory"/> 105 <copy todir="${build.classes.dir}/META-INF/services" 106 file="${primary.src.dir}/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin"/> 107 <mkdir dir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime"/> 108 <copy todir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime"> 109 <fileset dir="${primary.src.dir}/com/sun/tools/internal/xjc/runtime" 110 includes="**/*.java" 111 excludes="**/*.package.html"/> 112 </copy> 113 </target> 114 115 <!-- Try to get drop sources. --> 116 <target name="-set-props" 117 depends="init, 118 jaxws_src-update, 119 jaf_src-update"> 120 </target> 121 122 <!-- Set up source to use drop.dir. --> 123 <target name="-use-drop" depends="-set-props"> 124 <property name="primary.src.dir" value="${jaxws_src.src.dir}"/> 125 <property name="secondary.src.dir" value="${jaf_src.src.dir}"/> 126 <path id="src.dir.id"> 127 <pathelement path="${primary.src.dir}"/> 128 <pathelement path="${jaf_src.src.dir}"/> 129 </path> 130 </target> 131 132 <!-- Source directory selection. --> 133 <target name="-init-src-dirs" 134 depends="init, -use-drop,-src-help"> 135 <echo message="Using primary.src.dir=${primary.src.dir}"/> 136 <pathconvert property="src.list.id" refid="src.dir.id"/> 137 <echo message="Using src.dir.id=${src.list.id}"/> 138 </target> 139 140 <!-- Create drop src.zip. --> 141 <target name="-drop-src-zip" depends="init, -set-props"> 142 <zip file="${dist.src.zip}" basedir="${primary.src.dir}"/> 143 <zip file="${dist.src.zip}" basedir="${jaf_src.src.dir}" update="true"/> 144 </target> 145 146 <!-- Create src.zip. --> 147 <target name="-dist-src-zip" depends="init, -drop-src-zip"> 148 </target> 149 150 </project>