VSS Ant Script

| | Comments (0) | TrackBacks (0)
There are still many companies using Microsoft Visual SourceSafe even though Micorsoft themselves have decided not to extend their support for this piece of archaic software. We are still using it and in the process of moving over to Subversion. I have struggled for a bit to get this ant script set up to communicate with VSS . There aren't many resources available and my feeling is that is simply because less people are using VSS and even less use an Ant script + VSS. Hopefully this build script will help the individuals who are still stuck using VSS.

There are still many companies using Microsoft Visual SourceSafe even though Micorsoft themselves have decided not to extend their support for this piece of archaic software. We are still using it and in the process of moving over to Subversion. I have struggled for a bit to get this ant script set up to communicate with VSS . There aren't many resources available and my feeling is that is simply because less people are using VSS and even less use an Ant script + VSS. Hopefully this build script will help the individuals who are still stuck using VSS.

There are many reasons for using ant scripts with your Flash projects. Obviously this is aimed at Actionscripters who develop using Eclipse rather than the Flash IDE. Ant scripts allow you to streamline a lot of day to day tasks and make your life as a developer a hell of a lot easier once you have it setup. Granted, setting up or should I say scripting these aren't always that easy. I have had my fair share of struggling and I remember how I felt highly bewildered when I started using Eclipse. That feeling didn't last too long though as the benefits showed up immediately. Same with ant.

Instructions
Download the example below. The JAR file should be placed in a fixed location, i.e. your ant/lib install directory should suffice. This JAR file contains the VSS Ant task required to make the various VSS-Ant calls. This JAR file should be added to your classpath. This is how you do it:

  • Copy JAR file to fixed location
  • Copy the build file to your project folder
  • Open Eclipse (3.3)
  • RUN -> External Tools -> Open External Tools Dialogue (In 3.2 it is External Tools)
  • Right click on Ant Build and select New
  • Give your configuration a name like "VSS GET"
  • Browse to your build file using "Browse Workspace.."
  • Click on the classpath tab
  • Click on User Entries -> Add External JARs
  • Browse to your JAR file location and select it
  • Click on the JRE tab
  • Select the radio button "Run in the same JRE as the workspace"

The last step is required only if you want the project to refresh after the GET was called. This seemed to be a bit buggy as it sometimes resets itself. But I have only experienced this when working with multiple build files.
The build file in the example is located in a folder "ant". This is just the way I like to structure my projects as I sometimes have multiple build scripts for certain projects. If you want your build file in the root then just change "base.dir" property. I don't know if there exist such a thing as best practice for ant scripts but I do like to have all my properties declared at the beginning of the file. This way I can make adjustments for different projects without having to search through the build file.

So here is the full build.xml:


<project name="VSSGET" default="init" basedir="."
vss="antlib:org.apache.ant.vss">

<!-- Main project settings -->

<property name="base.dir" value="..">
<property name="project.name" value="VSSProject">
<property name="dest.dir" value="${base.dir}\deploy">
<property name="src.dir" value="${base.dir}\src">

<!-- VSS settings -->

<property name="vssproject.dir" value="$/Clients/VSSProject">
<property name="vssserver.dir" value="\\YourServer\SourceSafe">
<property name="ss.dir" value="C:\Program Files\Microsoft Visual SourceSafe">
<property name="vss.user" value="username">

<target name="vss-get">

<echo>Retrieving files from VSS...</echo>
<vssget vsspath="$/DARE/DareFramework/src" ssdir="${ss.dir}"
serverpath="${vssserver.dir}" recursive="true" localpath="${src.dir}"
login="${vss.user}">

</vssget>
<target name="init" depends="vss-get">

Download the example file ยป

0 TrackBacks

Listed below are links to blogs that reference this entry: VSS Ant Script.

TrackBack URL for this entry: http://www.wezside.co.za/cgi-bin/mt/mt-tb.cgi/13

Leave a comment


Type the characters you see in the picture above.