Mon, 01 Feb 2016 12:25:26 -0800
Merge
jlaskey@3 | 1 | <?xml version="1.0" encoding="UTF-8"?><project name="jdk" basedir="."> |
jlaskey@3 | 2 | <!-- |
jlaskey@7 | 3 | Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
jlaskey@3 | 4 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jlaskey@3 | 5 | |
jlaskey@3 | 6 | This code is free software; you can redistribute it and/or modify it |
jlaskey@3 | 7 | under the terms of the GNU General Public License version 2 only, as |
jlaskey@3 | 8 | published by the Free Software Foundation. |
jlaskey@3 | 9 | |
jlaskey@3 | 10 | This code is distributed in the hope that it will be useful, but WITHOUT |
jlaskey@3 | 11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jlaskey@3 | 12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jlaskey@3 | 13 | version 2 for more details (a copy is included in the LICENSE file that |
jlaskey@3 | 14 | accompanied this code). |
jlaskey@3 | 15 | |
jlaskey@3 | 16 | You should have received a copy of the GNU General Public License version |
jlaskey@3 | 17 | 2 along with this work; if not, write to the Free Software Foundation, |
jlaskey@3 | 18 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jlaskey@3 | 19 | |
jlaskey@3 | 20 | Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
jlaskey@3 | 21 | or visit www.oracle.com if you need additional information or have any |
jlaskey@3 | 22 | questions. |
jlaskey@3 | 23 | --> |
jlaskey@3 | 24 | |
jlaskey@3 | 25 | |
jlaskey@3 | 26 | <description> |
jlaskey@3 | 27 | Permits selection of a JDK to use when building and running project. |
jlaskey@3 | 28 | See: http://www.netbeans.org/issues/show_bug.cgi?id=64160 |
jlaskey@3 | 29 | </description> |
jlaskey@3 | 30 | |
jlaskey@3 | 31 | <target name="-jdk-pre-preinit"> |
jlaskey@3 | 32 | <condition property="nbjdk.active-or-nbjdk.home"> |
jlaskey@3 | 33 | <or> |
jlaskey@3 | 34 | <and> |
jlaskey@3 | 35 | <isset property="nbjdk.active"/> |
jlaskey@3 | 36 | <not> |
jlaskey@3 | 37 | <equals arg1="${nbjdk.active}" arg2="default_platform"/> |
jlaskey@3 | 38 | </not> |
jlaskey@3 | 39 | </and> |
jlaskey@3 | 40 | <and> |
jlaskey@3 | 41 | <isset property="nbjdk.home"/> |
jlaskey@3 | 42 | <not> |
jlaskey@3 | 43 | <isset property="nbjdk.home.defaulted"/> |
jlaskey@3 | 44 | </not> |
jlaskey@3 | 45 | </and> |
jlaskey@3 | 46 | </or> |
jlaskey@3 | 47 | </condition> |
jlaskey@3 | 48 | </target> |
jlaskey@3 | 49 | |
jlaskey@3 | 50 | <target xmlns:common="http://java.netbeans.org/freeform/jdk.xml" name="-jdk-preinit" depends="-jdk-pre-preinit" if="nbjdk.active-or-nbjdk.home"> |
jlaskey@3 | 51 | <macrodef name="property" uri="http://java.netbeans.org/freeform/jdk.xml"> |
jlaskey@3 | 52 | <attribute name="name"/> |
jlaskey@3 | 53 | <attribute name="value"/> |
jlaskey@3 | 54 | <sequential> |
jlaskey@3 | 55 | <property name="@{name}" value="${@{value}}"/> |
jlaskey@3 | 56 | </sequential> |
jlaskey@3 | 57 | </macrodef> |
jlaskey@3 | 58 | <common:property name="nbjdk.home" value="platforms.${nbjdk.active}.home"/> |
jlaskey@3 | 59 | <common:property name="nbjdk.javac.tmp" value="platforms.${nbjdk.active}.javac"/> |
jlaskey@3 | 60 | <condition property=".exe" value=".exe"> |
jlaskey@3 | 61 | <os family="windows"/> |
jlaskey@3 | 62 | </condition> |
jlaskey@3 | 63 | <property name=".exe" value=""/> |
jlaskey@3 | 64 | <condition property="nbjdk.javac" value="${nbjdk.home}/bin/javac${.exe}"> |
jlaskey@3 | 65 | <equals arg1="${nbjdk.javac.tmp}" arg2="$${platforms.${nbjdk.active}.javac}"/> |
jlaskey@3 | 66 | </condition> |
jlaskey@3 | 67 | <property name="nbjdk.javac" value="${nbjdk.javac.tmp}"/> |
jlaskey@3 | 68 | <common:property name="nbjdk.java.tmp" value="platforms.${nbjdk.active}.java"/> |
jlaskey@3 | 69 | <condition property="nbjdk.java" value="${nbjdk.home}/bin/java${.exe}"> |
jlaskey@3 | 70 | <equals arg1="${nbjdk.java.tmp}" arg2="$${platforms.${nbjdk.active}.java}"/> |
jlaskey@3 | 71 | </condition> |
jlaskey@3 | 72 | <property name="nbjdk.java" value="${nbjdk.java.tmp}"/> |
jlaskey@3 | 73 | <common:property name="nbjdk.javadoc.tmp" value="platforms.${nbjdk.active}.javadoc"/> |
jlaskey@3 | 74 | <condition property="nbjdk.javadoc" value="${nbjdk.home}/bin/javadoc${.exe}"> |
jlaskey@3 | 75 | <equals arg1="${nbjdk.javadoc.tmp}" arg2="$${platforms.${nbjdk.active}.javadoc}"/> |
jlaskey@3 | 76 | </condition> |
jlaskey@3 | 77 | <property name="nbjdk.javadoc" value="${nbjdk.javadoc.tmp}"/> |
jlaskey@3 | 78 | <common:property name="nbjdk.bootclasspath.tmp" value="platforms.${nbjdk.active}.bootclasspath"/> |
jlaskey@3 | 79 | <condition property="nbjdk.bootclasspath" value="${nbjdk.home}/jre/lib/rt.jar"> |
jlaskey@3 | 80 | <equals arg1="${nbjdk.bootclasspath.tmp}" arg2="$${platforms.${nbjdk.active}.bootclasspath}"/> |
jlaskey@3 | 81 | </condition> |
jlaskey@3 | 82 | <property name="nbjdk.bootclasspath" value="${nbjdk.bootclasspath.tmp}"/> |
jlaskey@3 | 83 | <condition property="nbjdk.valid"> |
jlaskey@3 | 84 | <and> |
jlaskey@3 | 85 | <available file="${nbjdk.home}" type="dir"/> |
jlaskey@3 | 86 | <available file="${nbjdk.javac}" type="file"/> |
jlaskey@3 | 87 | <available file="${nbjdk.java}" type="file"/> |
jlaskey@3 | 88 | <available file="${nbjdk.javadoc}" type="file"/> |
jlaskey@3 | 89 | |
jlaskey@3 | 90 | </and> |
jlaskey@3 | 91 | </condition> |
jlaskey@3 | 92 | <echo level="verbose">nbjdk.active=${nbjdk.active} nbjdk.home=${nbjdk.home} nbjdk.java=${nbjdk.java} 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> |
jlaskey@3 | 93 | </target> |
jlaskey@3 | 94 | |
jlaskey@3 | 95 | <target name="-jdk-warn" depends="-jdk-preinit" if="nbjdk.active-or-nbjdk.home" unless="nbjdk.valid"> |
jlaskey@3 | 96 | <property name="jdkhome.presumed" location="${java.home}/.."/> |
jlaskey@3 | 97 | <echo level="warning">Warning: nbjdk.active=${nbjdk.active} or nbjdk.home=${nbjdk.home} is an invalid Java platform; ignoring and using ${jdkhome.presumed}</echo> |
jlaskey@3 | 98 | </target> |
jlaskey@3 | 99 | |
jlaskey@3 | 100 | <target name="-jdk-presetdef-basic" depends="-jdk-preinit" if="nbjdk.valid" unless="nbjdk.presetdef.basic.done"> |
jlaskey@3 | 101 | |
jlaskey@3 | 102 | |
jlaskey@3 | 103 | <macrodef name="javac-presetdef"> |
jlaskey@3 | 104 | <attribute name="javacval"/> |
jlaskey@3 | 105 | <sequential> |
jlaskey@3 | 106 | <presetdef name="javac"> |
jlaskey@3 | 107 | <javac fork="yes" executable="@{javacval}"/> |
jlaskey@3 | 108 | </presetdef> |
jlaskey@3 | 109 | </sequential> |
jlaskey@3 | 110 | </macrodef> |
jlaskey@3 | 111 | <javac-presetdef javacval="${nbjdk.javac}"/> |
jlaskey@3 | 112 | <macrodef name="java-presetdef"> |
jlaskey@3 | 113 | <attribute name="javaval"/> |
jlaskey@3 | 114 | <sequential> |
jlaskey@3 | 115 | <presetdef name="java"> |
jlaskey@3 | 116 | <java fork="yes" jvm="@{javaval}"/> |
jlaskey@3 | 117 | </presetdef> |
jlaskey@3 | 118 | </sequential> |
jlaskey@3 | 119 | </macrodef> |
jlaskey@3 | 120 | <java-presetdef javaval="${nbjdk.java}"/> |
jlaskey@3 | 121 | <macrodef name="javadoc-presetdef"> |
jlaskey@3 | 122 | <attribute name="javadocval"/> |
jlaskey@3 | 123 | <sequential> |
jlaskey@3 | 124 | <presetdef name="javadoc"> |
jlaskey@3 | 125 | <javadoc executable="@{javadocval}"/> |
jlaskey@3 | 126 | </presetdef> |
jlaskey@3 | 127 | </sequential> |
jlaskey@3 | 128 | </macrodef> |
jlaskey@3 | 129 | <javadoc-presetdef javadocval="${nbjdk.javadoc}"/> |
jlaskey@3 | 130 | <macrodef name="junit-presetdef"> |
jlaskey@3 | 131 | <attribute name="javaval"/> |
jlaskey@3 | 132 | <sequential> |
jlaskey@3 | 133 | <presetdef name="junit"> |
jlaskey@3 | 134 | <junit fork="yes" jvm="@{javaval}"/> |
jlaskey@3 | 135 | </presetdef> |
jlaskey@3 | 136 | </sequential> |
jlaskey@3 | 137 | </macrodef> |
jlaskey@3 | 138 | <junit-presetdef javaval="${nbjdk.java}"/> |
jlaskey@3 | 139 | <property name="nbjdk.presetdef.basic.done" value="true"/> |
jlaskey@3 | 140 | </target> |
jlaskey@3 | 141 | |
jlaskey@3 | 142 | <target name="-jdk-presetdef-nbjpdastart" depends="-jdk-preinit" if="nbjdk.valid" unless="nbjdk.presetdef.nbjpdastart.done"> |
jlaskey@3 | 143 | <macrodef name="nbjpdastart-presetdef"> |
jlaskey@3 | 144 | <attribute name="bootcpval"/> |
jlaskey@3 | 145 | <sequential> |
jlaskey@3 | 146 | <presetdef name="nbjpdastart"> |
jlaskey@3 | 147 | <nbjpdastart> |
jlaskey@3 | 148 | <bootclasspath> |
jlaskey@3 | 149 | <path path="@{bootcpval}"/> |
jlaskey@3 | 150 | </bootclasspath> |
jlaskey@3 | 151 | </nbjpdastart> |
jlaskey@3 | 152 | </presetdef> |
jlaskey@3 | 153 | </sequential> |
jlaskey@3 | 154 | </macrodef> |
jlaskey@3 | 155 | <nbjpdastart-presetdef bootcpval="${nbjdk.bootclasspath}"/> |
jlaskey@3 | 156 | <property name="nbjdk.presetdef.nbjpdastart.done" value="true"/> |
jlaskey@3 | 157 | </target> |
jlaskey@3 | 158 | |
jlaskey@3 | 159 | <target name="-jdk-default" unless="nbjdk.active-or-nbjdk.home"> |
jlaskey@3 | 160 | |
jlaskey@3 | 161 | <property name="java.home.parent" location="${java.home}/.."/> |
jlaskey@3 | 162 | <condition property="nbjdk.home" value="${java.home.parent}"> |
jlaskey@3 | 163 | <available file="${java.home.parent}/lib/tools.jar" type="file"/> |
jlaskey@3 | 164 | </condition> |
jlaskey@3 | 165 | <condition property="nbjdk.home" value="${java.home}"> |
jlaskey@3 | 166 | <available file="${java.home}/lib/tools.jar" type="file"/> |
jlaskey@3 | 167 | </condition> |
jlaskey@3 | 168 | |
jlaskey@3 | 169 | <condition property="nbjdk.home" value="/Library/Java/Home"> |
jlaskey@3 | 170 | <available file="/Library/Java/Home" type="dir"/> |
jlaskey@3 | 171 | </condition> |
jlaskey@3 | 172 | |
jlaskey@3 | 173 | <property name="nbjdk.home" location="${java.home.parent}"/> |
jlaskey@3 | 174 | <property name="nbjdk.home.defaulted" value="true"/> |
jlaskey@3 | 175 | </target> |
jlaskey@3 | 176 | |
jlaskey@3 | 177 | <target name="-jdk-init" depends="-jdk-preinit,-jdk-warn,-jdk-presetdef-basic,-jdk-default"/> |
jlaskey@3 | 178 | |
jlaskey@7 | 179 | </project> |