code_junkie

MSBuild, example that filters entire solution of .cs files

Nov 11th, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. MSBuild <scriptfilename> /t:targetname
  2.  
  3. <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  4. <Import Project="Project.csproj" Condition="Exists(Project.csproj')"/>
  5.  
  6. <Target Name="Test">
  7. <Message Text="@(Compile)"/>
  8. </Target>
  9. </Project>
  10.  
  11. <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  12. <Import Project="Project.csproj" Condition="Exists(Project.csproj')"/>
  13.  
  14. <Target Name="Test">
  15. <Message Text="%(Compile.FullPath)"/>
  16. </Target>
  17. </Project>
  18.  
  19. C:projects_PlaySimpleIpService>type \sysrdswbld1publicbinmrb-vs2008.cmd
  20. @echo off
  21.  
  22. call "c:Program FilesMicrosoft Visual Studio 9.0VCvcvarsall.bat"
  23.  
  24. echo %0 %*
  25. echo %0 %* >> %MrB-LOG%
  26. cd
  27. if not ""=="%~dp1" pushd %~dp1
  28. cd
  29. if exist %~nx1 (
  30. echo VS2008 build of '%~nx1'.
  31. echo VS2008 build of '%~nx1'. >> %MrB-LOG%
  32. set MrB-BUILDLOG=%MrB-BASE%%MrB-WORK%.%MrB-NICEDATE%.%MrB-NICETIME%.build-errors.log
  33. msbuild.exe %~nx1 /t:Rebuild /p:Configuration=Release > %MrB-BUILDLOG%
  34. findstr /r /c:"[1-9][0-9]* Error(s)" %MrB-BUILDLOG%
  35. if not errorlevel 1 (
  36. echo ERROR: sending notification email for build errors in '%~nx1'.
  37. echo ERROR: sending notification email for build errors in '%~nx1'. >> %MrB-LOG%
  38. call mrb-email "Mr Build isn't happy about build errors in '%~nx1'" %MrB-BUILDLOG%
  39. ) else (
  40. findstr /r /c:"[1-9][0-9]* Warning(s)" %MrB-BUILDLOG%
  41. if not errorlevel 1 (
  42. echo ERROR: sending notification email for build warnings in '%~nx1'.
  43. echo ERROR: sending notification email for build warnings in '%~nx1'. >> %MrB-LOG%
  44. call mrb-email "Mr Build isn't happy about build warnings in '%~nx1'" %MrB-BUILDLOG%
  45. ) else (
  46. echo Successful build of '%~nx1'.
  47. echo Successful build of '%~nx1'. >> %MrB-LOG%
  48. )
  49. )
  50. ) else (
  51. echo ERROR '%1' doesn't exist.
  52. echo ERROR '%1' doesn't exist. >> %MrB-LOG%
  53. )
  54. popd
Add Comment
Please, Sign In to add comment