1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of Oracle nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="shared" basedir="..">
<import file="make.xml"/>
<target name="-tstamp">
<tstamp>
<format property="build.time" pattern="MM/dd/yyyy hh:mm aa"/>
<format property="build.fullversion.time" pattern="MM/dd/yyyy_HH_mm"/>
</tstamp>
</target>
<target name="-first-init" depends="-tstamp">
<mkdir dir="${user.home}/.openjdk"/>
<property name="workspace-user-build.properties" location="nbproject/private/build.properties"/>
<property file="${workspace-user-build.properties}"/>
<property file="${user.home}/.openjdk/${ant.project.name}-build.properties"/>
<property name="user-build.properties" location="${user.home}/.openjdk/build.properties"/>
<property file="${user-build.properties}"/>
<property file="${basedir}/build.properties"/>
<property environment="env."/>
</target>
<target name="-warn-about-bootstrap.jdk" depends="-first-init" unless="bootstrap.jdk">
<property name="fallback.jdk" location="${java.home}/.."/>
<echo level="warning">Warning: falling back to building against ${fallback.jdk}</echo>
<echo level="warning">Please define bootstrap.jdk=.../recent/jdk7/snapshot in ${user-build.properties} or ${workspace-user-build.properties}</echo>
</target>
<target name="-pre-init">
<!-- Invoked before -first-init. -->
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-post-init">
<!-- Invoked after -project-init. -->
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-init" description="Initial configuration used by everything else." depends="-pre-init,-first-init,-project-init,-post-init"/>
<target name="-project-init" depends="-warn-about-bootstrap.jdk">
<property name="root" location="../../.."/>
<property file="../common/architectures/name-${os.name}.properties"/>
<property name="platform" value="windows"/>
<property file="../common/architectures/arch-${os.arch}.properties"/>
<property name="arch" value="${os.arch}"/>
<echo level="verbose">System configuration claims architecture is ${platform}-${arch}</echo>
<property name="build.dir" location="${root}/build/${platform}-${arch}"/>
<property name="bin.dir" location="${build.dir}/bin"/>
<property name="make.dir" location="${root}/make"/> <!-- this is old build make files! -->
<property name="gensrc.dir" location="${build.dir}/gensrc"/>
<property name="classes.dir" location="${build.dir}/classes"/>
<property name="jtreg.dir" location="${build.dir}/jtreg/${ant.project.name}"/>
<property name="dist.dir" value="${root}/dist"/>
<property name="includes" value="(nothing)"/>
<property name="excludes" value=""/>
<property name="javadoc.dir" location="${build.dir}/javadoc/${ant.project.name}"/>
<condition property="os.macosx">
<os family="mac"/>
</condition>
<condition property="os.linux">
<os name="linux"/>
</condition>
<condition property="os.solaris">
<os name="SunOS"/>
</condition>
<condition property="osfamily.unix">
<os family="unix"/>
</condition>
<condition property="os.windows">
<os family="windows"/>
</condition>
<condition property="platform.src.dir" value="${root}/src/solaris/classes">
<os family="unix"/>
</condition>
<condition property="platform.src.dir" value="${root}/src/windows/classes">
<os family="windows"/>
</condition>
<property name="share.src.dir" value="${root}/src/share/classes"/>
<property name="bootstrap.jdk" location="${fallback.jdk}"/>
<!-- XXX ensure that bootstrap.jdk meets some minimum version requirements (TBD) -->
<condition property="bootstrap.javac" value="${bootstrap.jdk}/bin/javac">
<available file="${bootstrap.jdk}/bin/javac"/>
</condition>
<condition property="bootstrap.javac" value="${bootstrap.jdk}\bin\javac.exe">
<available file="${bootstrap.jdk}\bin\javac.exe"/>
</condition>
<fail unless="bootstrap.javac">${bootstrap.jdk} does not appear to be a functional JDK; no javac found.</fail>
<property name="javac.options" value="-Xlint"/> <!-- default, can be overridden per user or per project -->
<property name="javac.debug" value="true"/> <!-- default, can be overridden per user or per project -->
<property name="javac.debuglevel" value="lines,vars,source"/> <!-- default, can be overridden per user or per project -->
<macrodef name="jdk-javac">
<attribute name="srcdir"/>
<attribute name="includes" default="${includes}"/>
<attribute name="excludes" default="${excludes}"/>
<attribute name="classesdir" default="${classes.dir}"/>
<sequential>
<mkdir dir="@{classesdir}"/>
<javac srcdir="@{srcdir}" includes="@{includes}" excludes="@{excludes}" sourcepath=""
destdir="@{classesdir}" fork="true" executable="${bootstrap.javac}"
debug="${javac.debug}" debuglevel="${javac.debuglevel}">
<!-- Mandatory for compiling partial JDK sources against a snapshot; should NEVER be used for any other purpose: -->
<compilerarg value="-XDignore.symbol.file=true"/>
<compilerarg line="${javac.options}"/>
</javac>
</sequential>
</macrodef>
<available property="have.closed.src" file="${root}/src/closed/share/classes" type="dir"/>
</target>
<target name="-pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="build" depends="-init,-pre-compile,-build-ant,-build-make,-post-compile" description="Build sources."/>
<target name="-do-build-ant">
<depend srcdir="${share.src.dir}:${platform.src.dir}:${root}/src/closed/share/classes:${gensrc.dir}" destdir="${classes.dir}" cache="${build.dir}/depcache" includes="${includes}" excludes="${excludes}"/>
<mkdir dir="${gensrc.dir}"/>
<jdk-javac srcdir="${share.src.dir}:${platform.src.dir}:${gensrc.dir}"/>
<property name="copy.excludes" value="**/*.java,**/package.html,**/doc-files/"/>
<copy todir="${classes.dir}">
<fileset dir="${share.src.dir}" includes="${includes}" excludes="${excludes},${copy.excludes}"/>
<fileset dir="${platform.src.dir}" includes="${includes}" excludes="${excludes},${copy.excludes}"/>
</copy>
<antcall target="-maybe-do-build-ant-closed"/>
</target>
<target name="-maybe-do-build-ant-closed" if="have.closed.src">
<jdk-javac srcdir="${root}/src/closed/share/classes"/>
<copy todir="${classes.dir}">
<fileset dir="${root}/src/closed/share/classes" includes="${includes}" excludes="${excludes},${copy.excludes}"/>
</copy>
</target>
<target name="-build-ant" depends="-init" unless="use.make">
<antcall target="-do-build-ant"/>
</target>
<target name="-build-make" depends="-init" if="use.make"> <!-- override me to call <make-run> -->
<echo level="info">No make target defined for this project; falling back to simple Java build</echo>
<antcall target="-do-build-ant"/>
</target>
<target name="clean" depends="-init,-clean-docs-tests,-clean-ant,-clean-make" description="Clean build products."/>
<target name="-do-clean-ant">
<!-- XXX first s/\.java/.class/g in includes and excludes! -->
<delete dir="${classes.dir}" includes="${includes}" excludes="${excludes}" includeemptydirs="true"/>
<delete dir="${gensrc.dir}" includes="${includes}" excludes="${excludes}" includeemptydirs="true"/>
<delete dir="${build.dir}/depcache"/>
</target>
<target name="-clean-docs-tests">
<delete dir="${javadoc.dir}" includeemptydirs="true"/>
<delete dir="${jtreg.dir}" includeemptydirs="true"/>
</target>
<target name="-clean-ant" depends="-init" unless="use.make">
<antcall target="-do-clean-ant"/>
</target>
<target name="-clean-make" depends="-init" if="use.make"> <!-- override me to call <make-run> -->
<echo level="info">No make clean target defined for this project; falling back to simple Java clean</echo>
<antcall target="-do-clean-ant"/>
</target>
<target name="compile-single" depends="-init">
<fail unless="srcdir">Must set property 'srcdir'</fail>
<fail unless="includes">Must set property 'includes'</fail>
<jdk-javac srcdir="${srcdir}" includes="${includes}" excludes=""/>
</target>
<target name="debug-fix" depends="-init" if="netbeans.home">
<fail unless="class">Must set property 'class'</fail>
<antcall target="compile-single">
<param name="includes" value="${class}.java"/>
</antcall>
<nbjpdareload>
<fileset dir="${classes.dir}">
<include name="${class}.class"/>
</fileset>
</nbjpdareload>
</target>
<target name="-taskdef-jtreg" depends="-init" unless="jtreg.defined">
<fail message="Cannot locate jtreg: please set jtreg.home to its location">
<condition>
<not>
<isset property="jtreg.home"/>
</not>
</condition>
</fail>
<fail message="jtreg is not installed in ${jtreg.home}">
<condition>
<not>
<and>
<available file="${jtreg.home}/lib/jtreg.jar"/>
<available file="${jtreg.home}/lib/javatest.jar"/>
</and>
</not>
</condition>
</fail>
<taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
<classpath>
<pathelement location="${jtreg.home}/lib/jtreg.jar"/>
<pathelement location="${jtreg.home}/lib/javatest.jar"/>
</classpath>
</taskdef>
<property name="jtreg.defined" value="true"/>
</target>
<target name="-check-tests-defined" unless="jtreg.tests">
<fail>You must define jtreg.tests to select some tests to run.</fail>
</target>
<target name="-jtreg-setup">
<property name="jtreg.vm.options" value=""/> <!-- default, can be overridden per user or per project -->
<property name="jtreg.options" value=""/> <!-- default, can be overridden per user or per project -->
<property name="jtreg.samevm" value="false"/> <!-- default, can be overridden per user or per project -->
</target>
<target name="-jtreg-ant" unless="use.make">
<jtreg dir="${root}/test" samevm="${jtreg.samevm}" verbose="summary"
jdk="${bootstrap.jdk}"
failonerror="false" resultproperty="jtreg.result"
javacoptions="-g"
vmoptions="-Xbootclasspath/p:${classes.dir} ${jtreg.vm.options}"
reportDir="${jtreg.dir}/JTreport"
workDir="${jtreg.dir}/JTwork"
includes="${jtreg.tests}">
<arg line="${jtreg.options}"/>
</jtreg>
</target>
<target name="-jtreg-make" if="use.make">
<jtreg dir="${root}/test" samevm="${jtreg.samevm}" verbose="summary"
failonerror="false" resultproperty="jtreg.result"
jdk="${build.dir}"
vmoptions="${jtreg.vm.options}"
javacoptions="-g"
reportDir="${jtreg.dir}/JTreport"
workDir="${jtreg.dir}/JTwork"
includes="${jtreg.tests}">
<arg line="${jtreg.options}"/>
</jtreg>
</target>
<target name="-pre-jtreg">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-post-jtreg">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-jtreg" depends="-init,-pre-jtreg,-taskdef-jtreg,-check-tests-defined,-jtreg-setup,-jtreg-make,-jtreg-ant,-post-jtreg">
<property name="jtreg.report" location="${jtreg.dir}/JTreport/html/report.html"/>
<condition property="jtreg.passed">
<equals arg1="${jtreg.result}" arg2="0"/>
</condition>
</target>
<target name="test" depends="jtreg"/> <!-- Allow use of existing finger muscle memory from command line. -->
<target name="jtreg" depends="-jtreg" description="Run jtreg-based tests." unless="jtreg.passed">
<fail>${jtreg.report}: some tests failed.</fail>
</target>
<target name="jtreg-nb" depends="-jtreg" if="netbeans.home" unless="jtreg.passed">
<makeurl file="${jtreg.report}" property="jtreg.report.url"/>
<nbbrowse url="${jtreg.report.url}#Results"/>
<fail>Some tests failed; see report for details.</fail>
</target>
<target name="jtreg-debug-nb" depends="-init" if="netbeans.home">
<!-- No package decls -> "source root" is immediately containing dir -->
<dirname file="${root}/test/${jtreg.tests}" property="test.dir"/>
<nbjpdastart addressproperty="jpda.address" name="${ant.project.name}" transport="dt_socket">
<bootclasspath>
<pathelement location="${classes.dir}"/>
<pathelement location="${bootstrap.jdk}/jre/lib/rt.jar"/>
</bootclasspath>
<classpath>
<pathelement location="${jtreg.dir}/JTwork/classes"/>
</classpath>
<sourcepath>
<pathelement location="${share.src.dir}"/>
<pathelement location="${platform.src.dir}"/>
<pathelement location="${root}/src/closed/share/classes"/>
<pathelement location="${test.dir}"/>
</sourcepath>
</nbjpdastart>
<antcall target="-jtreg">
<param name="jtreg.vm.options" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
</antcall>
</target>
<target name="debug" depends="-init" if="netbeans.home">
<!-- No package decls -> "source root" is immediately containing dir -->
<dirname file="${root}/test/${jtreg.tests}" property="test.dir"/>
<nbjpdastart addressproperty="jpda.address" name="${ant.project.name}" transport="dt_socket">
<bootclasspath>
<pathelement location="${classes.dir}"/>
<pathelement location="${bootstrap.jdk}/jre/lib/rt.jar"/>
</bootclasspath>
<sourcepath>
<pathelement location="${share.src.dir}"/>
<pathelement location="${platform.src.dir}"/>
<pathelement location="${root}/src/closed/share/classes"/>
<pathelement location="${test.dir}"/>
</sourcepath>
</nbjpdastart>
<antcall target="run">
<param name="jvm.args" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
</antcall>
</target>
<target name="javadoc" depends="-init" description="Build basic Javadoc for public packages.">
<property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
<!-- Note: even with this default value, includes/excludes
from share.src.dir get javadoc'd; see packageset below -->
<property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
<javadoc destdir="${javadoc.dir}" source="1.8"
windowtitle="UNOFFICIAL" failonerror="true" use="true"
author="false" version="false"
packagenames="${javadoc.packagenames}">
<header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
<arg line="${javadoc.options}"/>
<bootclasspath>
<path location="${bootstrap.jdk}/jre/lib/rt.jar"/>
<path location="${classes.dir}"/>
</bootclasspath>
<sourcepath>
<pathelement location="${share.src.dir}"/>
<pathelement location="${platform.src.dir}"/>
<pathelement location="${root}/src/closed/share/classes"/>
<pathelement location="${root}/src/share/doc/stub"/>
</sourcepath>
<!-- XXX just <fileset> (restricted further to **/*.java) and no <packageset> -->
<!-- means that {@link some.package} will not work, which is no good. -->
<!-- (It correctly skips excluded single classes, but not if packageset is also included, -->
<!-- which also causes duplicates in the class index for included files.) -->
<packageset dir="${share.src.dir}" includes="${includes}" excludes="${excludes}">
<or>
<filename name="java/"/>
<filename name="javax/"/>
<filename name="org/ietf/jgss/"/>
<filename name="org/omg/"/>
<filename name="org/w3c/"/>
<filename name="org/xml/sax/"/>
</or>
</packageset>
</javadoc>
</target>
<target name="javadoc-nb" depends="javadoc" if="netbeans.home">
<nbbrowse file="${javadoc.dir}/index.html"/>
</target>
</project>
|