Title: RE: VSS task question
ok, I see what you are saying now :)
I had to add the -GLblab blaba  and it is still just
looking instead of getting.  (it would be nice to skip the task altogether thought)
 
Thanks for your input. 
-----Original Message-----
From: Peterson, Lance [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 9:41 AM
To: '[EMAIL PROTECTED]'
Subject: RE: VSS task question

Here's the problem.  Vssget calls SS.EXE directly (using Runtime.execute()).  But vssget does not pass the -GCC and -GTM options to SS.EXE.  GCC forces SS.EXE to only download changed files.  GTM forces SS.EXE will set downloaded files' file date's to the last modified date instead of the current date.  Without these options, SS.EXE will ALWAYS get EVERY file in the tree, and will ALWAYS stamp each file with the current date/time.
 
If you don't want this to happen, you have three choices:
1.  Wait until someone else fixes vssget.
2.  Write your own vssget (vssget's source is distributed with Ant's source).
3.  Or use the exec task to call SS.EXE directly.  This is what I'm doing--it works fine.  In fact the only difference using exec to call SS.EXE and using vssget is that I have to enter a few more attributes.  My first post shows the attributes I use to call SS.EXE through exec.
 
By using the exec task with the correct options (-GCC and -GTM), SS.EXE will only download the most recent files.  It will still scan the entire project tree.  But it won't actually get the files (look at the output--if it's downloading a file it will print "Getting...", whereas if it doesn't get the file, it will only print the filename).
 
Best regards,
Lance Peterson
-----Original Message-----
From: Joe Fisher [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 7:50 AM
To: [EMAIL PROTECTED]
Subject: RE: VSS task question

This is exactly what I want, This works for most tasks, but for the vssget (at least how I structured it) it gets the files everytime
I tried using the
<target ... unless="some.property">
    <property name="some.property" value="true"/>
</target>
 
This two, works for other targets, but not with the vss target.  I'm tempeted to believe there is a bug in the vssget
(as the recursive flag does not seam to matter what it is set to)
-----Original Message-----
From: Peterson, Lance [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 4:02 PM
To: '[EMAIL PROTECTED]'
Subject: RE: VSS task question

This might seem obvious but have you tried...
 
<target name="source">
    <vssget ...>
</target>
 
<target name="applet1" depends="source">
</target>
 
<target name="applet2" depends="source">
</target>
 
<target name="applet3" depends="source">
</target>
 
?
 
With this configuration, Ant will execute the source target once, no matter which (or how many) of the applet targets are executed.  If I understand your problem, this should correct it.  If I don't understand let me know.
 
Lance
-----Original Message-----
From: Joe Fisher [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 3:23 PM
To: [EMAIL PROTECTED]
Subject: RE: VSS task question

Actually I was looking for the situation that, if I have three targets that rely on on task (say compile) that the compile is only run once (the first time it is needed), but then the next target that depends on compile doesn't compile it.
 
in my case, I have three applets that I need to put in to a web application.  I need to ensure I got the pages from vss and because all three appleets depend on the pages, my vss get pages target gets the pages three times.
 
but thanks for advice on this.  (is still got all the files for some reason)
-----Original Message-----
From: Peterson, Lance [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 2:25 PM
To: '[EMAIL PROTECTED]'
Subject: RE: VSS task question

If I don't want to download files every time from SourceSafe, I use the exec task and call SS.EXE directly with the following options:

<exec executable="${vss.path}\ss.exe">
        <arg value="get" />
        <arg value="${project.path}" />
        <arg value="-R" />
        <arg value="-I-" />
        <arg value="-GF" />
        <arg value="-GCC" />
        <arg value="-GTM" />
        <arg value="-y${vss.username},${vss.password}" />
</exec>

project.path is the SourceSafe project path (i.e. "$/products/library/source").

-R gets files recursively, -I- turns off input.

The combination of -GF, -GCC, and -GTM causes SS.EXE to only get a file from SourceSafe if it has a later file date than the local copy.  SS.EXE will still run--it will scan the project directory (recursively if -R is set).  But it won't download a file unless it's outdated.

I'm not sure this is what you wanted...

Regards,
Lance Peterson
Verticore Technologies Inc.

-----Original Message-----
From: Joe Fisher [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 1:03 PM
To: [EMAIL PROTECTED]
Subject: VSS task question


I have a few tasks that rely on files getting from vss
Everytime the other tasks fire, they get the files.
How can i prevent vssget task from firing evertime?


Here is a copy of my build file
<?xml version="1.0"?>

<!--
======================================================================= -->
<!-- Build
     -->
<!--
======================================================================= -->

<!-- note on VSS.  If the user is editing a file that will be gotten from
vss, the
         user must close that file, as the make writable=false fails -->
<project name="MainBuildFile" default="info" basedir=".">

        <!-- Each user must define some variables in a file called user.properties
                 If these variables are not set, the build cannont happen on thier
machine -->
        <property file="user.properties"/>
    <property name="VSSEXE" value="\\Xtend-devdb\D_Drive\Program
Files\Microsoft Visual Studio\VSS\win32"/>
    <property name="VSS_PAGE_DIR"
value="/projects/xtendsoft/XtendSoftPages"/>
    <property name="VSS_TAG_DIR" value ="/projects/xtendsoft/CustomTags"/>
    <property name="VSS_PAGE_TEST_DIR" value
="/projects/xtendsoft/test/XtendSoft"/>

        <!-- info       Each call comes here first -->
        <target name="info"
depends="echoPagesRootFalse,echoCustomTagRootFalse,echoBuildRootFalse,echoVS
S_PASSFalse,echoVSS_PASSFalse">
                <echo message="PagesRoot=${PagesRoot}"/>
                <echo message="CustomTagRoot=${CustomTagRoot}"/>
                <echo message="BuildDir=${BuildDir}"/>
                <mkdir dir="${BuildDir}"/>
                <echo message=""/>
                <echo message="To build everything, call 'ant rebuild'"/>
                <echo message="Current targets are"/>
                <echo message="--> getCustomTags -- This will get the custom tags"/>
                <echo message="--> getPages -- This will get all the pages"/>
                <echo message="--> TestPages -- This will run the tests for the pages"/>
                <echo message="--> XtendTree -- This will build the XtendTree applet"/>
                <echo message="--> XtendOutliner -- This will build the outliner applet"/>
                <echo message="--> clean -- This will delete everyting not needed"/>
                <echo message="--> rebuild -- This will delete everyting then rebuild
it"/>
        </target>

        <!-- check some variables -->
        <target name="echoPagesRootFalse" unless="PagesRoot">
                <fail message="'PagesRoot' must be defined in a file called
user.properties and must point to where the Xtend Soft pages will be put"/>
        </target>
        <target name="echoCustomTagRootFalse" unless="CustomTagRoot">
                <fail message="'CustomTagRoot' must be defined in a file called
user.properties and must point to the directory where Coldfusion expects the
Custom Tags to be"/>
        </target>
        <target name="echoBuildRootFalse" unless="BuildDir">
                <fail message="'BuildDir' must be defined in a file called user.properties
and must point to the directory where Java will build"/>
        </target>
        <target name="echoVSS_USERFalse" unless="VSS_USER">
                <fail message="'VSS_USER' must be defined in a file called user.properties
and must be the username for VSS"/>
        </target>
        <target name="echoVSS_PASSFalse" unless="VSS_PASS">
                <fail message="'VSS_PASS' must be defined in a file called user.properties
and must be the password for VSS_USER"/>
        </target>


        <!-- get custom tags -->
        <target name="getCustomTags" depends="info" if="${property.gotTag}">
                <echo message="Getting ColdFusion Tags (${VSS_TAG_DIR})to
${CustomTagRoot}"/>
                <vssget localPath="${CustomTagRoot}"
                        recursive="true"
                        vsspath="${VSS_TAG_DIR}"
                        ssdir="${VSSEXE}"
                        writable="false"
                        login="${VSS_USER},${VSS_PASS}"/>
        </target>

        <!-- get the pages -->
        <target name="getPages" depends="info, getCustomTags">
                <echo message="Getting Pages (${VSS_PAGE_DIR}) specific code to
${PagesRoot}"/>
                <!-- get the pages -->
                <vssget localPath="${PagesRoot}"
                                recursive="true"
                        vsspath="${VSS_PAGE_DIR}"
                        ssdir="${VSSEXE}"
                        writable="false"
                        login="${VSS_USER},${VSS_PASS}"/>
        </target>

        <!-- unit testing for the pages -->
        <target name="TestPages" depends="getPages">
                <echo message="Getting Tests (${VSS_PAGE_TEST_DIR}) specific code to
${BuildDir}\testPages"/>
                <vssget localPath="${BuildDir}\testPages"
                                recursive="true"
                        vsspath="${VSS_PAGE_TEST_DIR}"
                        ssdir="${VSSEXE}"
                        writable="false"
                        login="${VSS_USER},${VSS_PASS}"/>
                <ant antfile="build.xml" dir="${BuildDir}\testPages" target="test"/>    <!--
test better be definen-->

        </target>

        <!-- get the XtendTree project -->
        <target name="XtendTree" depends="info,getPages">
                <echo message="Getting XtendTree to ${BuildDir}/XtendTree"/>

                <mkdir dir="${BuildDir}\XtendTree"/>
                <vssget localPath="${BuildDir}\XtendTree"
                                recursive="false"
                        vsspath="/projects/xtendsoft/java/applets/XtendTree"
                        ssdir="${VSSEXE}"
                        writable="false"
                        login="${VSS_USER},${VSS_PASS}"/>
                <ant antfile="build.xml" dir="${BuildDir}\XtendTree"/>

                <!-- copy the built jars, assumetions made that the jars will be in the
\deploy folder and be in jar files -->
                <copy toDir="${PagesRoot}\classes">
                        <fileset dir="${BuildDir}\XtendTree\deploy">
                            <include name="**/*.jar"/>
                        </fileset>
                </copy>
                <!-- copy the supporting jars, assumptions made that the jars will be in
the \lib and have jars, zip or classes-->
                <copy toDir="${PagesRoot}\classes\jars">
                        <fileset dir="${BuildDir}\XtendTree\lib">
                            <include name="**/*.jar"/>
                            <include name="**/*.class"/>
                            <include name="**/*.zip"/>
                        </fileset>
                </copy>
        </target>

        <!-- get the XtendOutliner project -->
        <target name="XtendOutliner" depends="info,getPages">
                <echo message="Getting XtendOutliner to ${BuildDir}/XtendOutliner"/>

                <mkdir dir="${BuildDir}\XtendOutliner"/>
                <vssget localPath="${BuildDir}\XtendOutliner"
                                recursive="false"
                        vsspath="/projects/xtendsoft/java/applets/XtendOutliner"
                        ssdir="${VSSEXE}"
                        writable="false"
                        login="${VSS_USER},${VSS_PASS}"/>
                <ant antfile="build.xml" dir="${BuildDir}\XtendOutliner"/>

                <!-- copy the built jars, assumetions made that the jars will be in the
\deploy folder and be in jar files -->
                <copy toDir="${PagesRoot}\classes">
                        <fileset dir="${BuildDir}\XtendOutliner\deploy">
                            <include name="**/*.jar"/>
                        </fileset>
                </copy>
                <!-- copy the supporting jars, assumptions made that the jars will be in
the \lib and have jars, zip or classes-->
                <copy toDir="${PagesRoot}\classes\jars">
                        <fileset dir="${BuildDir}\XtendOutliner\lib">
                            <include name="**/*.jar"/>
                            <include name="**/*.class"/>
                            <include name="**/*.zip"/>
                        </fileset>
                </copy>
        </target>

        <!-- clean -->
        <target name="clean" depends="info">
                <echo message="Delete directory ${PagesRoot}"/>
                <delete dir="${PagesRoot}"/>
                <echo message="Delete directory ${CustomTagRoot}"/>
                <delete dir="${CustomTagRoot}"/>
                <echo message="Delete directory ${BuildDir}"/>
                <delete dir="${BuildDir}"/>
            <delete>
                    <fileset dir="." includes="*.bak"/>
                </delete>
        </target>

        <!-- build all target -->
        <target name="all" depends="info">
                <antcall target="XtendOutliner"/>
                <antcall target="XtendTree"/>
                <antcall target="TestPages"/>
        </target>

        <!-- rebuild the system -->
        <target name="rebuild" depends="info">
                <antcall target="clean"/>
                <antcall target="all"/>
        </target>

</project>

Joe Fisher, Software Developer
Xtend Inc.
http://www.xtendsoft.com
voice  801.825.5553 ext 309
fax    801.825.5606
e-mail [EMAIL PROTECTED]
s-mail 1645 East Hwy 193, Suite 202
       Layton, Ut 84041

Reply via email to