Have fun!

<!--
   Wrapper for ss dir command</br>
   </br>
   Expected attributes</br>
   - vsspath is the SourceSafe path which specifies the project/file(s)</br>
        you wish to perform the action on.</br>
   - ssdir (optional) is the directory where ss.exe resides. By default</br>
        the task expects it to be in the PATH.</br>
   - serverPath (optional) is the directory where srssafe.ini resides.</br>
        You can also set the "ssdir" environment variable.</br>
   - recursive (optional) is true or false. Defaults to false.</br>
   - output (optional) is the file to write the directory.</br>
   - failonerror (optional) is true or false. Defaults to true.</br>
-->
<macrodef name="vssdir">
   <attribute name="vsspath"/>
   <attribute name="ssdir"       default=""/>
   <attribute name="serverPath"  default=""/>
   <attribute name="recursive"   default="false"/>
   <attribute name="output"      default=""/>
   <attribute name="failonerror" default="true"/>

   <sequential>
      <condition property="__vssdir_recursive__" value="-R">
        <equals arg1="@{recursive}" arg2="true"/>
      </condition>

      <condition property="__vssdir_recursive__" value="">
        <equals arg1="@{recursive}" arg2="false"/>
      </condition>

      <condition property="__vssdir_output__" value="-O">
        <equals arg1="@{output}" arg2=""/>
      </condition>

      <condition property="__vssdir_output__" value="-O@@@{output}">
        <not>
           <equals arg1="@{output}" arg2=""/>
        </not>
      </condition>

      <exec taskname="vssdir"
            executable="ss.exe"
            dir="@{ssdir}"
            failonerror="@{failonerror}"
      >
         <env key="ssdir" value="@{serverPath}"/>

         <arg value="dir"/>
         <arg value="@{vsspath}"/>
         <arg value="${__vssdir_recursive__}"/>
         <arg value="${__vssdir_output__}"/>
      </exec>
   </sequential>
</macrodef>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to