ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: CVS Task + add command
Date Thu, 28 Mar 2002 16:11:12 GMT
Had the same issue to do a cvs checkout!!! Resorted to using <exec> as well.
(using ANT 1.4.1 on W2K).

For those interested, here are 3 targets that do a cvs update or checkout of
a known module from a know repository to a predefined location. Just uses
the result of a condition to do either a cvs update or a cvs checkout, with
the cvs checkout using <exec> since also needs to execute from another
directory than ${basedir}.

Hope someone fins this useful. --DD

  <!--
======================================================================
       Find out if this machine has OpenWorks Lite installed
    -->
  <target name="has.owlite?"
          description="Find out if this machine has OpenWorks Lite
installed">

    <condition property="has.owlite">
      <available file="${env.OWLITE_HOME}/OpenWorks/bin/owdevkitv.dll"
                 type="file" />
    </condition>

    <!-- All this to print "true" or "false" for the property value -->
    <condition property="has.owlite.value"
               value="false">
      <equals arg1="${has.owlite}"
              arg2="$${has.owlite}" />
    </condition>

    <property name="has.owlite.value"
              value="true" />

    <echo message="has.owlite  = ${has.owlite.value}" />
    <echo message="OWLITE_HOME = ${env.OWLITE_HOME}" />

  </target><!-- has.owlite? -->

  <!-- ====================================================
       Updates OpenWorks Lite from CVS
    -->
  <target name="owlite.update"
          depends="has.owlite?, owlite.checkout"
          if="has.owlite"
          description="Updates OpenWorks Lite from CVS">

    <echo message="Updating OpenWorks Lite..." />
    <cvs command="-z3 update -d -P"
         cvsRoot="${mowi.cvsroot}"
         dest="${env.OWLITE_HOME}"
         quiet="${cvs-quiet}" />

  </target><!-- owlite.update -->

  <target name="owlite.checkout"
          unless="has.owlite"
          description="Checks Out OpenWorks Lite from CVS">

    <echo message="Checking Out OpenWorks Lite..." />
    <exec executable="cvs.exe"
          dir="${basedir}/..">
      <arg line="-z3 -d ${mowi.cvsroot} checkout owlite" />
    </exec>

  </target><!-- owlite.checkout -->

 -----Original Message-----
From: 	Mike Lecza [mailto:mlecza@newnetco.com] 
Sent:	Thursday, March 28, 2002 8:25 AM
To:	ant-user@jakarta.apache.org
Subject:	CVS Task + add command

Is there any way to tell the CVS task where to execute from?  I can only
do a CVS add with the exec Task because when I try to use the cvs task I
cannot specify the location to execute from.  The cvs add command must
be fired from the location where the file exists (as far as I can tell).
 
Regards

--
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