You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Joe Fisher <jf...@proxtend.com> on 2001/05/11 21:02:54 UTC

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 jfisher@proxtend.com
s-mail 1645 East Hwy 193, Suite 202
       Layton, Ut 84041