blob: 89d04977c0ad0c428d1e4d3bb875723f96cc9242 [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.init-jdk">
<macrodef name="init-jdk">
<attribute name="version"/>
<sequential>
<var name=".prefix" value="java.@{version}"/>
<if>
<not><isset property="${.prefix}.location"/></not>
<then>
<var name=".location" unset="true"/>
<var name=".compiler.path" unset="true"/>
<var name=".system.classpath" unset="true"/>
<locate-jdk version="@{version}"/>
<propertycopy property=".location" from="${.prefix}.location"/>
<if>
<os family="windows"/>
<then>
<property name=".compiler.path" value="${.location}/bin/javac.exe"/>
</then>
<else>
<property name=".compiler.path" value="${.location}/bin/javac"/>
</else>
</if>
<pathconvert property=".system.classpath">
<fileset dir="${.location}">
<include name="lib/*.jar"/>
<include name="jre/lib/*.jar"/>
</fileset>
<fileset dir="${.location}/.."> <!-- Accounts for Java 6 layout on Mac OS X -->
<include name="Classes/*.jar"/>
</fileset>
</pathconvert>
<property name="${.prefix}.compiler.path" value="${.compiler.path}"/>
<property name="${.prefix}.system.classpath" value="${.system.classpath}"/>
<echo message="Java @{version} Compiler Path : ${.compiler.path}"/>
<echo message="Java @{version} System Classpath : ${.system.classpath}"/>
<var name=".location" unset="true"/>
<var name=".compiler.path" unset="true"/>
<var name=".system.classpath" unset="true"/>
</then>
</if>
<var name=".prefix" unset="true"/>
</sequential>
</macrodef>
</project>