blob: 5bcc59ffcc715b7a922988a74bbe339a296c293b [file] [log] [blame]
<!--
******************************************************************************
* Copyright (c) 2016 Oracle
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Konstantin Komissarchik - initial implementation and ongoing maintenance
******************************************************************************
-->
<project name="corundum.macro.locate-jdk">
<macrodef name="locate-jdk">
<attribute name="version"/>
<sequential>
<if>
<and>
<not><isset property="java.@{version}.location"/></not>
<isset property="env.JDK_@{version}_HOME"/>
</and>
<then>
<propertycopy property="java.@{version}.location" from="env.JDK_@{version}_HOME" override="true"/>
</then>
</if>
<if>
<not><isset property="java.@{version}.location"/></not>
<then>
<fail message="Could not locate JDK @{version}. Neither JDK_@{version}_HOME environment variable nor java.@{version}.location system property is set."/>
</then>
</if>
</sequential>
</macrodef>
</project>