Author: drewbai
Date: Tue May 26 19:14:23 2009
New Revision: 778853

URL: http://svn.apache.org/viewvc?rev=778853&view=rev
Log:
STONEHENGE-63 part 2
Add path prereq and path checking and add 
errorlevel on return

Modified:
    incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd

Modified: incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd
URL: 
http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd?rev=778853&r1=778852&r2=778853&view=diff
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd (original)
+++ incubator/stonehenge/trunk/stocktrader/dotnet/BuildDotNet.cmd Tue May 26 
19:14:23 2009
@@ -30,9 +30,17 @@
   'REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5" 
/v MSBuildToolsPath'
 ) DO SET MSBuildToolsPath=%%B
 
-...@echo MSBuildToolsPath=%MSBuildToolsPath%
+...@echo MSBuildToolsPath=%MSBuildToolsPath%
+
+
+
+...@if not exist %MSBuildToolsPath%\MSbuild.exe Goto :Error2
+
+...@echo Build the solutions.
 
 cd .\setup_utilities\SetupActions
+...@if not exist SetupActions.sln Goto :Error1
+
 @echo Build SetupActions
 "%MSBuildToolsPath%msbuild" SetupActions.sln /t:Clean /p:Configuration=Debug
 "%MSBuildToolsPath%msbuild" SetupActions.sln /t:Clean /p:Configuration=release
@@ -40,6 +48,8 @@
 "%MSBuildToolsPath%msbuild" SetupActions.sln /t:Build 
/p:Configuration=release;Platform="Any CPU"
 
 cd ..\..\order_processor
+...@if not exist OrderProcessorSolution.sln Goto :Error1
+
 @echo Build order_processor
 "%MSBuildToolsPath%msbuild" OrderProcessorSolution.sln /t:Clean 
/p:Configuration=Debug
 "%MSBuildToolsPath%msbuild" OrderProcessorSolution.sln /t:Clean 
/p:Configuration=release
@@ -47,6 +57,8 @@
 "%MSBuildToolsPath%msbuild" OrderProcessorSolution.sln /t:Build 
/p:Configuration=release;Platform="Any CPU"
 
 cd ..\business_service
+...@if not exist BusinessServiceSolution.sln Goto :Error1
+
 @echo Build business_service
 "%MSBuildToolsPath%msbuild" BusinessServiceSolution.sln /t:Clean 
/p:Configuration=Debug
 "%MSBuildToolsPath%msbuild" BusinessServiceSolution.sln /t:Clean 
/p:Configuration=release
@@ -54,6 +66,8 @@
 "%MSBuildToolsPath%msbuild" BusinessServiceSolution.sln /t:Build 
/p:Configuration=release;Platform="Any CPU"
 
 cd ..\trader_client
+...@if not exist StockTraderWebAppSolution.sln Goto :Error1
+
 @echo Build trader_client
 "%MSBuildToolsPath%msbuild" StockTraderWebAppSolution.sln /t:Clean 
/p:Configuration=Debug
 "%MSBuildToolsPath%msbuild" StockTraderWebAppSolution.sln /t:Clean 
/p:Configuration=release
@@ -63,9 +77,29 @@
 
 @cd ..
 
-...@echo Done!
-...@pause
+...@goto :Exit
 
+:Error1
+...@echo Are you missing required solutions/directories? Cannot find the 
solution files (.sln) 
+...@echo This build script expects to build:
+...@echo .\setup_utilities\SetupActions\
+...@echo ..\..\order_processor
+...@echo ..\business_service
+...@echo ..\trader_client\
+...@echo These file directories are expected under the directory where this 
script is running from. 
+...@set ERRORLEVEL=1
+...@goto Exit
+
+:Error2
+...@echo You are missing msbuild.exe which was expected at %MSBuildToolsPath%. 
Do you Have .Net3.5 SP1 properly installed?
+...@set ERRORLEVEL=2
+...@goto Exit
+
+:Exit 
+...@echo ERRORLEVEL is %ERRORLEVEL%
+...@echo Done!
+...@pause
+...@exit ERRORLEVEL
 
 
 


Reply via email to