diff --git a/csharp/Build.cmd b/csharp/Build.cmd index 4e8a283..4fa273c 100644 --- a/csharp/Build.cmd +++ b/csharp/Build.cmd @@ -5,11 +5,13 @@ SET CMDHOME=%~dp0 @REM Remove trailing backslash \ set CMDHOME=%CMDHOME:~0,-1% -@REM Set some .NET directory locations required if running from PowerShell prompt. -if "%FrameworkDir%" == "" set FrameworkDir=%WINDIR%\Microsoft.NET\Framework -if "%FrameworkVersion%" == "" set FrameworkVersion=v4.0.30319 +@REM Set msbuild location. +SET VisualStudioVersion=12.0 + +SET MSBUILDEXEDIR=%programfiles(x86)%\MSBuild\%VisualStudioVersion%\Bin +if NOT EXIST "%MSBUILDEXEDIR%\." SET MSBUILDEXEDIR=%programfiles%\MSBuild\%VisualStudioVersion%\Bin +if NOT EXIST "%MSBUILDEXEDIR%\." GOTO :ErrorMSBUILD -SET MSBUILDEXEDIR=%FrameworkDir%\%FrameworkVersion% SET MSBUILDEXE=%MSBUILDEXEDIR%\MSBuild.exe SET MSBUILDOPT=/verbosity:minimal @@ -63,6 +65,12 @@ if EXIST %PROJ_NAME%.nuspec ( @GOTO :EOF +:ErrorMSBUILD +set RC=1 +@echo ===== Build FAILED due to missing MSBUILD.EXE. ===== +@echo ===== Mobius requires "Developer Command Prompt for VS2013" and above ===== +exit /B %RC% + :ErrorStop set RC=%ERRORLEVEL% if "%STEP%" == "" set STEP=%CONFIGURATION% diff --git a/csharp/Clean.cmd b/csharp/Clean.cmd index 64ecbc4..e8454b6 100644 --- a/csharp/Clean.cmd +++ b/csharp/Clean.cmd @@ -1,3 +1,3 @@ -FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q "%%G" -FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G" -@REM FOR /F "tokens=*" %%G IN ('DIR /B /AD /S TestResults') DO RMDIR /S /Q "%%G" \ No newline at end of file +@ECHO OFF +FOR /D /R . %%G IN (bin) DO @IF EXIST "%%G" (@echo RDMR /S /Q "%%G" & rd /s /q "%%G") +FOR /D /R . %%G IN (obj) DO @IF EXIST "%%G" (@echo RDMR /S /Q "%%G" & rd /s /q "%%G") \ No newline at end of file diff --git a/examples/Build.cmd b/examples/Build.cmd index ae0a13d..4ac6da6 100644 --- a/examples/Build.cmd +++ b/examples/Build.cmd @@ -5,11 +5,12 @@ SET CMDHOME=%~dp0 @REM Remove trailing backslash \ set CMDHOME=%CMDHOME:~0,-1% -@REM Set some .NET directory locations required if running from PowerShell prompt. -if "%FrameworkDir%" == "" set FrameworkDir=%WINDIR%\Microsoft.NET\Framework -if "%FrameworkVersion%" == "" set FrameworkVersion=v4.0.30319 +@REM Set msbuild location. +SET VisualStudioVersion=12.0 + +SET MSBUILDEXEDIR=%programfiles(x86)%\MSBuild\%VisualStudioVersion%\Bin +if NOT EXIST "%MSBUILDEXEDIR%\." SET MSBUILDEXEDIR=%programfiles%\MSBuild\%VisualStudioVersion%\Bin -SET MSBUILDEXEDIR=%FrameworkDir%\%FrameworkVersion% SET MSBUILDEXE=%MSBUILDEXEDIR%\MSBuild.exe SET MSBUILDOPT=/verbosity:minimal diff --git a/examples/Clean.cmd b/examples/Clean.cmd index 64ecbc4..e8454b6 100644 --- a/examples/Clean.cmd +++ b/examples/Clean.cmd @@ -1,3 +1,3 @@ -FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q "%%G" -FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G" -@REM FOR /F "tokens=*" %%G IN ('DIR /B /AD /S TestResults') DO RMDIR /S /Q "%%G" \ No newline at end of file +@ECHO OFF +FOR /D /R . %%G IN (bin) DO @IF EXIST "%%G" (@echo RDMR /S /Q "%%G" & rd /s /q "%%G") +FOR /D /R . %%G IN (obj) DO @IF EXIST "%%G" (@echo RDMR /S /Q "%%G" & rd /s /q "%%G") \ No newline at end of file