1
Vote

Using with TFS Team Build - problem with macro expansion

description

You have to be careful in the pre/post build build events if you are trying to build this template on a TFS Team Build box due to differences in Macro expansion. It might be worth adding some guidance to the project on this matter
 
I ended up with pre build script in the form (for mre detail see http://blogs.blackmarble.co.uk/blogs/rfennell/archive/2008/12/19/tfs-teambuild-and-sharepoint-wsp-deployment-and-any-post-build-events-for-that-matter.aspx)
 
echo PREBUILD STARTED
 
rem Check if we running in VS or Teambuild
if not exist "......\CLIENTLIBRARY\SharedLibProject\bin\$(ConfigurationName)\SharedLibProject.dll" goto tfsbuild
 
echo Copy from VS locations, in this sample we assume a shared library, a webpart and some javascript
xcopy "......\CLIENTLIBRARY\SharedLibProject\bin\$(ConfigurationName)\SharedLibProject.dll" "$(ProjectDir)DLLS\GAC\" /F /R /Y
xcopy "......\Web Part\bin\$(ConfigurationName)*.dll" "$(ProjectDir)DLLS\GAC\" /F /R /Y
xcopy "$(SolutionDir)HOST\bin\HOST.dll" "$(ProjectDir)DLLS\GAC\" /F /R /Y
xcopy "$(SolutionDir)HOST\json*" "$(ProjectDir)TEMPLATE\LAYOUTS" /F /R /Y
xcopy "$(SolutionDir)HOST*.js" "$(ProjectDir)TEMPLATE\LAYOUTS" /F /R /Y
 
goto end
 
:tfsbuild
echo Copy from TFS build locations
 
xcopy "$(outdir)\SharedLibproject.dll" "$(ProjectDir)DLLS\GAC\" /F /R /Y
 
xcopy "$(outdir)\WebPart.Core.dll" "$(ProjectDir)DLLS\GAC\" /F /R /Y
xcopy "$(outdir)\WebPart.UI.dll" "$(ProjectDir)DLLS\GAC\" /F /R /Y
xcopy "$(outdir)\Host.dll" "$(ProjectDir)DLLS\GAC\" /F /R /Y
xcopy "$(SolutionDir)HOST\json*" "$(ProjectDir)TEMPLATE\LAYOUTS\json*" /F /R /Y
xcopy "$(SolutionDir)HOST*.js" "$(ProjectDir)TEMPLATE\LAYOUTS*.js" /F /R /Y
 
:end
 
echo PREBUILD COMPLETE

comments