blob: b18ac59dfda05526e2934944cc799f8d967066ec [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.with-configuration">
<macrodef name="with-configuration">
<attribute name="name"/>
<element name="body" implicit="yes"/>
<sequential>
<if>
<not><isset property="@{name}.repositories.resolved"/></not>
<then>
<echo message="Loading configuration @{name}..."/>
<if>
<isset property="@{name}.repositories"/>
<then>
<propertycopy name=".repositories" from="@{name}.repositories"/>
<for list="${.repositories}" param="repo">
<sequential>
<load-repository location="@{repo}" property="@{name}.repositories.resolved"/>
</sequential>
</for>
</then>
<else>
<fail message="Could not load configuration @{name}"/>
</else>
</if>
<var name=".repositories" unset="true"/>
</then>
</if>
<propertycopy property=".repositories" from="@{name}.repositories.resolved" override="true"/>
<if>
<isset property="@{name}.java.version"/>
<then>
<propertycopy property=".java.version" from="@{name}.java.version" override="true"/>
</then>
<else>
<var name=".java.version" unset="true"/>
</else>
</if>
<if>
<isset property="@{name}.legacy.mac.layout"/>
<then>
<propertycopy property=".legacy.mac.layout" from="@{name}.legacy.mac.layout" override="true"/>
</then>
<else>
<var name=".legacy.mac.layout" value="false"/>
</else>
</if>
<body/>
<var name=".repositories" unset="true"/>
<var name=".java.version" unset="true"/>
<var name=".legacy.mac.layout" unset="true"/>
</sequential>
</macrodef>
</project>