I'm trying to execute a program before the source control block executes and downloads the source to my local working directory. the prebuild task executes after and the tasks block executes after. I've poured over the docs and just can't figure it out.
I eventually wrote an executable that ran before the code retrieval. Even then it was fragile. So, I switched to Automated QA.
As far as I know that is not an option. The purpose of continuous integration is to get latest code and then perform the build. If you are needing to do some type of cleanup (file deletion perhaps) you should do that at the end of the build. This way it will already be in the desired state before the next build is kicked off.
I tried the following simple command in prebuild. Cannot see it being fired before source block.
<prebuild> <exec> <executable>cmd</executable> <buildArgs>"/c MD C:\build\1.4"</buildArgs> </exec> .. </prebuild>
Prebuild DOES fire before the source control get. It comes after the source control block but still fires first. Here's an example I've been using:
<cb:define subversionpath="c:\Program Files\Subversion\bin\svn.exe" /> <cb:define name="svn50"> <executable>$(subversionpath)</executable> <workingDirectory>D:\Projects\B50\Source</workingDirectory> <trunkUrl>svn://machineName/branches/B_50/Source</trunkUrl> <autoGetSource>true</autoGetSource> </cb:define> <project name="StreamlineCheckBuild" queue="B50"> <triggers> <intervalTrigger seconds="180" /> </triggers> <sourcecontrol type="svn"> <cb:svn50/> <deleteObstructions>true</deleteObstructions> <forceUpdate>true</forceUpdate> </sourcecontrol> <prebuild> <exec> <executable>$(subversionpath)</executable> <buildArgs>cleanup</buildArgs> <baseDirectory>D:\Projects\B50</baseDirectory> </exec> </prebuild> <tasks> ... </tasks> </cruisecontrol>