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