ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b.@spamcop.net
Subject Re: Parameterized CVS fetch
Date Thu, 15 Aug 2002 17:23:56 GMT
I prompt. Something like this:
<project basedir="." name="cm" default="exec">
    <property name="module.name" value="portal"/>
    <property file="cm.properties"/>
    <target name="init_build">
        <echo>
Hail ${user.name}!
To build off the branch or tag, please enter the branch or tag name. 
To build off the main branch (head) just hit enter
        </echo>
        <input addproperty="CVS_TAG_NAME"/>
        <condition property="DO_HEAD_RELEASE">
            <equals arg1="${CVS_TAG_NAME}" arg2="" trim="yes"/>
        </condition>
    </target>
    
    <target name="cvs_tagged" unless="DO_HEAD_RELEASE" depends="init_build">
        <echo>Retrieving ${CVS_TAG_NAME} branch</echo>
        <property name="build.dir" value="${CVS_TAG_NAME}"/>
        <cvs command="co -d ${build.dir} -j ${CVS_TAG_NAME} -R ${module.name}"/>
    </target>
    
    <target name="cvs_head" if="DO_HEAD_RELEASE" depends="init_build">
        <echo>Retrieving the main branch</echo>
        <property name="build.dir" value="${module.name}"/>
        <cvs command="co -R ${module.name}"/>
    </target>
    
    <target name="exec" depends="cvs_tagged, cvs_head"/>
    
    <target name="update_host">
        <exec outputproperty="hostname" executable="hostname"/>
        <property name="build.host" refid="${hostname}"/>
        <echo>${build.host}</echo>
    </target>
</project>

Quoting Matt Lyon <matt@stargus.com>:

> Hi,
> 
> Just curious as to how folks handle parameterizing their build files to fetch
> code from various branches of a source tree in CVS. I was thinking of
> defining a ${cvs.branch} property value in an external properties file that
> could be set by the build user and read in during init to point the fetch
> target to a specific CVS branch. Do any listers have other approaches they
> have used successfully?
> 
> Matt
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message