Sat, 07 Nov 2020 10:05:19 +0800
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="jaxp" 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 | <!-- Source dir def --> |
aoqi@0 | 47 | <property name="jaxp.src.dir" value="src"/> |
aoqi@0 | 48 | <path id="src.dir.id"> |
aoqi@0 | 49 | <pathelement path="${jaxp.src.dir}"/> |
aoqi@0 | 50 | </path> |
aoqi@0 | 51 | |
aoqi@0 | 52 | <!-- Initialization of directories needed for build. --> |
aoqi@0 | 53 | <target name="init"> |
aoqi@0 | 54 | <mkdir dir="${build.dir}"/> |
aoqi@0 | 55 | <mkdir dir="${build.classes.dir}"/> |
aoqi@0 | 56 | <mkdir dir="${dist.dir}"/> |
aoqi@0 | 57 | <mkdir dir="${dist.lib.dir}"/> |
aoqi@0 | 58 | </target> |
aoqi@0 | 59 | |
aoqi@0 | 60 | <!-- Sanity checks and settings --> |
aoqi@0 | 61 | <target name="sanity" |
aoqi@0 | 62 | depends="-javac-jar-exists" |
aoqi@0 | 63 | description="Display settings of configuration values"> |
aoqi@0 | 64 | <echo message="${sanity.info}"/> |
aoqi@0 | 65 | </target> |
aoqi@0 | 66 | |
aoqi@0 | 67 | <!-- Check for bootstrap javac.jar file, warn if missing. --> |
aoqi@0 | 68 | <condition property="javac.jar.exists"> |
aoqi@0 | 69 | <available file="${javac.jar}" type="file"/> |
aoqi@0 | 70 | </condition> |
aoqi@0 | 71 | <target name="-javac-jar-exists" |
aoqi@0 | 72 | unless="javac.jar.exists"> |
aoqi@0 | 73 | <echo message="WARNING: Cannot find ${javac.jar}"/> |
aoqi@0 | 74 | </target> |
aoqi@0 | 75 | |
aoqi@0 | 76 | <!-- Creation of distribution files to jdk build process. --> |
aoqi@0 | 77 | <target name="dist" |
aoqi@0 | 78 | depends="init, build, -dist-classes-jar, -dist-src-zip" |
aoqi@0 | 79 | description="Create all built distribution files."> |
aoqi@0 | 80 | </target> |
aoqi@0 | 81 | <target name="-dist-classes-jar-uptodate" |
aoqi@0 | 82 | depends="init"> |
aoqi@0 | 83 | <condition property="dist.classes.jar.uptodate"> |
aoqi@0 | 84 | <and> |
aoqi@0 | 85 | <available file="${dist.classes.jar}" type="file"/> |
aoqi@0 | 86 | <uptodate targetfile="${dist.classes.jar}"> |
aoqi@0 | 87 | <srcfiles dir="${build.classes.dir}" includes="**"/> |
aoqi@0 | 88 | </uptodate> |
aoqi@0 | 89 | </and> |
aoqi@0 | 90 | </condition> |
aoqi@0 | 91 | </target> |
aoqi@0 | 92 | <target name="-dist-classes-jar" |
aoqi@0 | 93 | depends="init, -dist-classes-jar-uptodate" |
aoqi@0 | 94 | unless="dist.classes.jar.uptodate"> |
aoqi@0 | 95 | <delete file="${dist.classes.jar}"/> |
aoqi@0 | 96 | <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/> |
aoqi@0 | 97 | </target> |
aoqi@0 | 98 | |
aoqi@0 | 99 | <!-- Special build area setup. --> |
aoqi@0 | 100 | <target name="-build-setup" depends="init"> |
aoqi@0 | 101 | <mkdir dir="${build.classes.dir}"/> |
aoqi@0 | 102 | <copy todir="${build.classes.dir}"> |
aoqi@0 | 103 | <fileset dir="${jaxp.src.dir}" |
aoqi@0 | 104 | includes="**/*.properties"/> |
aoqi@0 | 105 | </copy> |
aoqi@0 | 106 | <replaceregexp match="#(.*)$" replace="#" flags="gm"> |
aoqi@0 | 107 | <fileset dir="${build.classes.dir}" includes="**/*.properties"/> |
aoqi@0 | 108 | </replaceregexp> |
aoqi@0 | 109 | </target> |
aoqi@0 | 110 | |
aoqi@0 | 111 | <!-- Create src.zip. --> |
aoqi@0 | 112 | <target name="-dist-src-zip" depends="init"> |
aoqi@0 | 113 | <zip file="${dist.src.zip}" basedir="${jaxp.src.dir}"/> |
aoqi@0 | 114 | </target> |
aoqi@0 | 115 | |
aoqi@0 | 116 | <!-- Build (compilation) of sources to class files. --> |
aoqi@0 | 117 | <target name="build" |
aoqi@0 | 118 | depends="compile, -build-setup"> |
aoqi@0 | 119 | </target> |
aoqi@0 | 120 | <target name="compile" |
aoqi@0 | 121 | depends="init"> |
aoqi@0 | 122 | <mkdir dir="${build.classes.dir}"/> |
aoqi@0 | 123 | <javac |
aoqi@0 | 124 | includeAntRuntime="false" |
aoqi@0 | 125 | classpath="${build.classes.dir}:${tools.jar}" |
aoqi@0 | 126 | fork="true" |
aoqi@0 | 127 | destdir="${build.classes.dir}" |
aoqi@0 | 128 | memoryInitialSize="${javac.memoryInitialSize}" |
aoqi@0 | 129 | memoryMaximumSize="${javac.memoryMaximumSize}" |
aoqi@0 | 130 | source="${javac.source}" |
aoqi@0 | 131 | debug="${javac.debug}" |
aoqi@0 | 132 | target="${javac.target}"> |
aoqi@0 | 133 | <compilerarg value="-J-Xbootclasspath/p:${javac.jar}"/> |
aoqi@0 | 134 | <compilerarg line="${javac.version.opt} ${javac.lint.opts} ${javac.no.jdk.warnings}"/> |
aoqi@0 | 135 | <src refid="src.dir.id"/> |
aoqi@0 | 136 | </javac> |
aoqi@0 | 137 | </target> |
aoqi@0 | 138 | |
aoqi@0 | 139 | <!-- Test. (FIXME: Need to know how to run tests.) --> |
aoqi@0 | 140 | <target name="test" |
aoqi@0 | 141 | depends="init, dist"> |
aoqi@0 | 142 | <echo message="FIXME: How do you run the tests"/> |
aoqi@0 | 143 | </target> |
aoqi@0 | 144 | |
aoqi@0 | 145 | <!-- Populate source area if needed. --> |
aoqi@0 | 146 | <target name="source" |
aoqi@0 | 147 | depends="init" |
aoqi@0 | 148 | description="Populate all source file directories"> |
aoqi@0 | 149 | </target> |
aoqi@0 | 150 | |
aoqi@0 | 151 | <!-- Clean up compiled files. --> |
aoqi@0 | 152 | <target name="clean" |
aoqi@0 | 153 | description="Delete all generated files"> |
aoqi@0 | 154 | <delete dir="${build.dir}"/> |
aoqi@0 | 155 | <delete dir="${dist.dir}"/> |
aoqi@0 | 156 | </target> |
aoqi@0 | 157 | |
aoqi@0 | 158 | <!-- Clean up compiled files and all imported source files. --> |
aoqi@0 | 159 | <target name="clobber" |
aoqi@0 | 160 | depends="clean" |
aoqi@0 | 161 | description="Delete all generated files, including imported sources"> |
aoqi@0 | 162 | </target> |
aoqi@0 | 163 | |
aoqi@0 | 164 | <target name="-banner"> |
aoqi@0 | 165 | <echo message="+---------------------------------------+"/> |
aoqi@0 | 166 | <echo message="+ Starting ant project ${ant.project.name} +"/> |
aoqi@0 | 167 | <echo message="+---------------------------------------+"/> |
aoqi@0 | 168 | </target> |
aoqi@0 | 169 | |
aoqi@0 | 170 | <!-- Do everything but test. --> |
aoqi@0 | 171 | <target name="all" |
aoqi@0 | 172 | depends="-banner, sanity, dist" |
aoqi@0 | 173 | description="Build everything."> |
aoqi@0 | 174 | <echo message="+---------------------------------------+"/> |
aoqi@0 | 175 | <echo message="+ Finishing ant project ${ant.project.name}"/> |
aoqi@0 | 176 | <echo message="+---------------------------------------+"/> |
aoqi@0 | 177 | </target> |
aoqi@0 | 178 | |
aoqi@0 | 179 | <target name="javadoc" depends="init" description="Build basic Javadoc for public packages."> |
aoqi@0 | 180 | <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project --> |
aoqi@0 | 181 | <!-- Note: even with this default value, includes/excludes |
aoqi@0 | 182 | from share.src.dir get javadoc'd; see packageset below --> |
aoqi@0 | 183 | <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project --> |
aoqi@0 | 184 | <property name="javadoc.dir" value="${build.dir}/docs/api"/> |
aoqi@0 | 185 | <property name="includes" value="**"/> |
aoqi@0 | 186 | <javadoc destdir="${javadoc.dir}" source="1.5" |
aoqi@0 | 187 | windowtitle="UNOFFICIAL" failonerror="true" use="true" |
aoqi@0 | 188 | author="false" version="false" |
aoqi@0 | 189 | packagenames="${javadoc.packagenames}"> |
aoqi@0 | 190 | <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header> |
aoqi@0 | 191 | <arg line="${javadoc.options}"/> |
aoqi@0 | 192 | <bootclasspath> |
aoqi@0 | 193 | <path location="${java.home}/lib/rt.jar"/> |
aoqi@0 | 194 | <path location="${build.classes.dir}"/> |
aoqi@0 | 195 | </bootclasspath> |
aoqi@0 | 196 | <sourcepath> |
aoqi@0 | 197 | <pathelement location="${jaxp.src.dir}"/> |
aoqi@0 | 198 | </sourcepath> |
aoqi@0 | 199 | <!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> --> |
aoqi@0 | 200 | <!-- means that {@link some.package} will not work, which is no good. --> |
aoqi@0 | 201 | <!-- (It correctly skips excluded single classes, but not if packageset is also included, --> |
aoqi@0 | 202 | <!-- which also causes duplicates in the class index for included files.) --> |
aoqi@0 | 203 | <packageset dir="${jaxp.src.dir}" includes="${includes}" excludes="${excludes}"> |
aoqi@0 | 204 | <or> |
aoqi@0 | 205 | <filename name="javax/"/> |
aoqi@0 | 206 | <filename name="org/w3c/"/> |
aoqi@0 | 207 | <filename name="org/xml/sax/"/> |
aoqi@0 | 208 | </or> |
aoqi@0 | 209 | </packageset> |
aoqi@0 | 210 | </javadoc> |
aoqi@0 | 211 | </target> |
aoqi@0 | 212 | <target name="javadoc-nb" depends="javadoc" if="netbeans.home"> |
aoqi@0 | 213 | <property name="javadoc.dir=" value="${build.dir}/docs/api"/> |
aoqi@0 | 214 | <nbbrowse file="${javadoc.dir}/index.html"/> |
aoqi@0 | 215 | </target> |
aoqi@0 | 216 | |
aoqi@0 | 217 | </project> |