Subversion Repositories DevTools

Rev

Rev 1962 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<project name="load-using-macrodef">

        <!--    C O P Y R I G H T   N O T I C E
                        This material is confidential to ERG and may not be disclosed in whole 
                        or in part to any third party nor used in any manner whatsoever other
                        than for the purposes expressly consented to by ERG in writing.

                        This material is also copyright and may not be reproduced, stored in a
                        retrieval system or transmitted in any form or by any means in whole or
                        in part without the express written consent of ERG.
        -->

        <!-- ============================================================================================== -->
        <!-- Install ant-using -->

        <property name="ant-using-version" value="1.3.0"/>


        <fail message="An existing ANT using macro has been declared with a different version" status="2">
                <condition>
                        <and>
                                <isset  property="using.ant-using.version"/>
                                <not><equals    arg1="${using.ant-using.version}" arg2="${ant-using-version}"/></not>
                        </and>
                </condition>
        </fail>


        <fail message="The mandatory environment variable GBE_DPKG is missing" status="1">
                <condition>
                        <length string="${env.GBE_DPKG}" trim="true" length="0"/>
                </condition>
        </fail>

        <!-- ============================================================================================== -->
        <!-- Install ant-antcontrib -->

        <property name="antcontrib-version" value="1.0b2"/>
        <property name="using.ant-antcontrib.basedir" value="${env.GBE_DPKG}/ant-antcontrib/${antcontrib-version}"/>
        <property name="using.antcontrib.basedir" value="${env.GBE_DPKG}/antcontrib/${antcontrib-version}"/>
        <mkdir dir="${using.ant-antcontrib.basedir}"/>
        <mkdir dir="${using.antcontrib.basedir}"/>
        <copy todir="${using.ant-antcontrib.basedir}" verbose="yes">
                <fileset dir="${env.GBE_DPKG}/ant-antcontrib/${antcontrib-version}">
                        <include name="*.xml"/>
                </fileset>
        </copy>
        <copy todir="${using.antcontrib.basedir}" verbose="yes">
                <fileset dir="${env.GBE_DPKG}/antcontrib/${antcontrib-version}">
                        <include name="**/*.jar"/>
                </fileset>
        </copy>
        <import file="${using.ant-antcontrib.basedir}/ant-antcontrib.xml" optional="false"/>
        <!-- ============================================================================================== -->


        <!-- Do we have an environment variable for GBE_DPKG_CACHE ?
                 If not, then 
                        Use the properties file : ant-build-properties (if one exists)
                 Otherwise 
                        Use the local variable 
        -->

        <if>
                <contains string="${env.GBE_DPKG_CACHE}" substring="$"/>
                <then>
                        <available property="ant-build-properties_available" filepath="${user.home}" file="ant-build-properties"/>

                        <if>
                                <isset  property="ant-build-properties_available"/>
                                <then>
                                        <property file="${user.home}/ant-build-properties"/>
                                        <echo taskname="ant-using">Using 'ant-build-properties' file for build.repository as : ${build.repository}</echo>
                                </then>
                                <else>
                                        <fail message="Failed to determine build.repository location" status="1"/>
                                </else>
                        </if>
                </then>
                <else>
                        <property name="build.repository" value="${env.GBE_DPKG_CACHE}"/>
                        <echo taskname="ant-using">Using environment variable 'GBE_DPKG_CACHE' as build.repository from : ${build.repository}</echo>
                </else>
        </if>


        <property name="using.ant-using.basedir" value="${build.repository}/ant-using/${ant-using-version}"/>
        <mkdir dir="${using.ant-using.basedir}"/>
        <copy todir="${using.ant-using.basedir}" verbose="yes">
                <fileset dir="${env.GBE_DPKG}/ant-using/${ant-using-version}">
                        <include name="*.xml"/>
                </fileset>
        </copy>
        <import file="${using.ant-using.basedir}/ant-using-macro.xml" optional="false"/>
        <!-- ============================================================================================== -->

</project>