blob: a661f1bf0f76f9a6466f7f22f799e259b2463a29 [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.prepend">
<macrodef name="prepend">
<attribute name="property"/>
<attribute name="value"/>
<attribute name="separator" default=","/>
<sequential>
<if>
<not><length string="@{value}" trim="true" length="0"/></not>
<then>
<if>
<isset property="@{property}"/>
<then>
<propertycopy property=".value" from="@{property}" override="true"/>
<if>
<length string="${.value}" trim="true" length="0"/>
<then>
<var name="@{property}" value="@{value}"/>
</then>
<else>
<var name="@{property}" value="@{value}@{separator}${.value}"/>
</else>
</if>
<var name=".value" unset="true"/>
</then>
<else>
<var name="@{property}" value="@{value}"/>
</else>
</if>
</then>
</if>
</sequential>
</macrodef>
</project>