blob: d1ddc81a6e7bf023770d00252910667fdb0b2ba4 [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.eclipse">
<macrodef name="eclipse">
<attribute name="location"/>
<attribute name="application"/>
<attribute name="failonerror" default="true"/>
<attribute name="resultproperty" default=""/>
<element name="args" optional="true" implicit="true"/>
<sequential>
<find-eclipse-bundle property=".launcher" eclipse="@{location}" bundle="org.eclipse.equinox.launcher"/>
<if>
<os family="mac"/>
<then>
<var name=".jvmargs" value="-Xmx1024m -XstartOnFirstThread"/>
</then>
<else>
<var name=".jvmargs" value="-Xmx1024m"/>
</else>
</if>
<if>
<os family="mac"/>
<then>
<if>
<available file="@{location}/Eclipse.app/Contents/Eclipse/configuration" type="dir"/>
<then>
<var name=".eclipse.configuration" value="@{location}/Eclipse.app/Contents/Eclipse/configuration"/>
</then>
<else>
<var name=".eclipse.configuration" value="@{location}/configuration"/>
</else>
</if>
<var name=".eclipse.install" value="@{location}/Eclipse.app/Contents/MacOS"/>
</then>
<else>
<var name=".eclipse.configuration" value="@{location}/configuration"/>
<var name=".eclipse.install" value="@{location}"/>
</else>
</if>
<java classpath="${.launcher}" classname="org.eclipse.core.launcher.Main" fork="true" failonerror="@{failonerror}" resultproperty="@{resultproperty}">
<jvmarg line="${.jvmargs}"/>
<arg line="-application @{application}"/>
<arg line="-configuration ${.eclipse.configuration}"/>
<arg line="-install ${.eclipse.install}"/>
<args/>
</java>
<var name=".launcher" unset="true"/>
<var name=".jvmargs" unset="true"/>
<var name=".eclipse.configuration" unset="true"/>
<var name=".eclipse.install" unset="true"/>
</sequential>
</macrodef>
</project>