nbNetCatUpdater / nbproject / jdk.xml

<?xml version="1.0" encoding="UTF-8"?>

Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.

Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
specific language governing permissions and limitations under the
License.  When distributing the software, include this License Header
Notice in each file and include the License file at
nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the GPL Version 2 section of the License file that
accompanied this code. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"


The Original Software is NetBeans. The Initial Developer of the Original
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
Microsystems, Inc. All Rights Reserved.

If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 2] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 2 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 2 code and therefore, elected the GPL
Version 2 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
<project name="jdk" basedir=".">

    <!-- Extracted from nbbuild/jdk.xml -->
        Permits selection of a JDK to use when building and running project.

    <target name="-jdk-pre-preinit">
        <condition property="">
                    <isset property=""/>
                        <equals arg1="${}" arg2="default_platform"/>
                    <isset property="nbjdk.home"/>
                        <isset property="nbjdk.home.defaulted"/>

    <target name="-jdk-preinit" depends="-jdk-pre-preinit" if="" xmlns:common="">
        <macrodef name="property" uri="">
            <attribute name="name"/>
            <attribute name="value"/>
                <property name="@{name}" value="${@{value}}"/>
        <common:property name="nbjdk.home" value="platforms.${}.home"/>
        <common:property name="nbjdk.javac.tmp" value="platforms.${}.javac"/>
        <condition property=".exe" value=".exe">
            <os family="windows"/> <!-- #72467 -->
        <property name=".exe" value=""/>
        <condition property="nbjdk.javac" value="${nbjdk.home}/bin/javac${.exe}">
            <equals arg1="${nbjdk.javac.tmp}" arg2="$${platforms.${}.javac}"/>
        <property name="nbjdk.javac" value="${nbjdk.javac.tmp}"/>
        <common:property name="" value="platforms.${}.java"/>
        <condition property="" value="${nbjdk.home}/bin/java${.exe}">
            <equals arg1="${}" arg2="$${platforms.${}.java}"/>
        <property name="" value="${}"/>
        <common:property name="nbjdk.javadoc.tmp" value="platforms.${}.javadoc"/>
        <condition property="nbjdk.javadoc" value="${nbjdk.home}/bin/javadoc${.exe}">
            <equals arg1="${nbjdk.javadoc.tmp}" arg2="$${platforms.${}.javadoc}"/>
        <property name="nbjdk.javadoc" value="${nbjdk.javadoc.tmp}"/>
        <common:property name="nbjdk.bootclasspath.tmp" value="platforms.${}.bootclasspath"/>
        <condition property="nbjdk.bootclasspath" value="${nbjdk.home}/jre/lib/rt.jar">
            <equals arg1="${nbjdk.bootclasspath.tmp}" arg2="$${platforms.${}.bootclasspath}"/>
        <property name="nbjdk.bootclasspath" value="${nbjdk.bootclasspath.tmp}"/>
        <condition property="nbjdk.valid">
                <available file="${nbjdk.home}" type="dir"/>
                <available file="${nbjdk.javac}" type="file"/>
                <available file="${}" type="file"/>
                <available file="${nbjdk.javadoc}" type="file"/>
                <!-- XXX probably cannot use <available resource="..." classpath="${nbjdk.bootclasspath}"/> since would always find it in this VM -->
        <echo level="verbose">${} nbjdk.home=${nbjdk.home}${} nbjdk.javac=${nbjdk.javac} nbjdk.javadoc=${nbjdk.javadoc} nbjdk.bootclasspath=${nbjdk.bootclasspath} nbjdk.valid=${nbjdk.valid} have-jdk-1.4=${have-jdk-1.4} have-jdk-1.5=${have-jdk-1.5}</echo>

    <target name="-jdk-warn" depends="-jdk-preinit" if="" unless="nbjdk.valid">
        <property name="jdkhome.presumed" location="${java.home}/.."/>
        <echo level="warning">Warning:${} or nbjdk.home=${nbjdk.home} is an invalid Java platform; ignoring and using ${jdkhome.presumed}</echo>

    <target name="-jdk-presetdef-basic" depends="-jdk-preinit" if="nbjdk.valid" unless="nbjdk.presetdef.basic.done">
        <!-- Have to eval these props now, not when used, because of usages of <ant ... inheritall="false"> -->
        <!-- (cf. -->
        <macrodef name="javac-presetdef">
            <attribute name="javacval"/>
                <presetdef name="javac">
                    <javac fork="yes" executable="@{javacval}"/>
        <javac-presetdef javacval="${nbjdk.javac}"/>
        <macrodef name="java-presetdef">
            <attribute name="javaval"/>
                <presetdef name="java">
                    <java fork="yes" jvm="@{javaval}"/>
        <java-presetdef javaval="${}"/>
        <macrodef name="javadoc-presetdef">
            <attribute name="javadocval"/>
                <presetdef name="javadoc">
                    <javadoc executable="@{javadocval}"/>
        <javadoc-presetdef javadocval="${nbjdk.javadoc}"/>
        <macrodef name="junit-presetdef">
            <attribute name="javaval"/>
                <presetdef name="junit">
                    <junit fork="yes" jvm="@{javaval}"/>
        <junit-presetdef javaval="${}"/>
        <property name="nbjdk.presetdef.basic.done" value="true"/>

    <target name="-jdk-presetdef-nbjpdastart" depends="-jdk-preinit" if="nbjdk.valid" unless="nbjdk.presetdef.nbjpdastart.done">
        <macrodef name="nbjpdastart-presetdef">
            <attribute name="bootcpval"/>
                <presetdef name="nbjpdastart">
                            <path path="@{bootcpval}"/>
        <nbjpdastart-presetdef bootcpval="${nbjdk.bootclasspath}"/>
        <property name="nbjdk.presetdef.nbjpdastart.done" value="true"/>

    <target name="-jdk-default" unless="">
        <!-- Define fallback values of some things. -->
        <property name="java.home.parent" location="${java.home}/.."/>
        <condition property="nbjdk.home" value="${java.home.parent}">
            <available file="${java.home.parent}/lib/tools.jar" type="file"/>
        <condition property="nbjdk.home" value="${java.home}">
            <available file="${java.home}/lib/tools.jar" type="file"/>
        <!-- Mac OS X -->
        <condition property="nbjdk.home" value="/Library/Java/Home">
            <available file="/Library/Java/Home" type="dir"/>
        <!-- Fallback? -->
        <property name="nbjdk.home" location="${java.home.parent}"/>
        <property name="nbjdk.home.defaulted" value="true"/>

    <target name="-jdk-init" depends="-jdk-preinit,-jdk-warn,-jdk-presetdef-basic,-jdk-default"/>