diff --git a/ClickToBuild.cmd b/ClickToBuild.cmd index 3c0b68c2d..38d5db736 100644 --- a/ClickToBuild.cmd +++ b/ClickToBuild.cmd @@ -1,35 +1,29 @@ +FOR %%b in ( + "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" + "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" + "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" -if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" goto initialize2k8on64Dev12 -if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" goto initialize2k8Dev12 -if exist "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" goto initialize2k8on64Dev11 -if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" goto initialize2k8Dev11 - + "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" + "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" + "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" + ) do ( + if exist %%b ( + call %%b x86 + goto build + ) +) + echo "Unable to detect suitable environment. Build may not succeed." -goto build - - -:initialize2k8Dev12 -call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 -goto build - -:initialize2k8on64Dev12 -call "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 -goto build - -:initialize2k8Dev11 -call "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86 -goto build - -:initialize2k8on64Dev11 -call "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86 -goto build :build -if "%~1"=="" msbuild /t:Build Orchard.proj -msbuild /t:%~1 Orchard.proj + +SET target=%1 +SET project=%2 + +IF "%target%" == "" SET target=Build +IF "%project%" =="" SET project=Orchard.proj + +msbuild /t:%target% %project% pause -goto end - -:end diff --git a/ClickToBuildAzurePackage.cmd b/ClickToBuildAzurePackage.cmd index 89f5cba72..5f6eb1300 100644 --- a/ClickToBuildAzurePackage.cmd +++ b/ClickToBuildAzurePackage.cmd @@ -1,35 +1,6 @@ +SET target=%1 -if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" goto initialize2k8on64Dev12 -if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" goto initialize2k8Dev12 -if exist "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" goto initialize2k8on64Dev11 -if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" goto initialize2k8Dev11 +IF "%target%"=="" SET target=Build -echo "Unable to detect suitable environment. Build may not succeed." -goto build +ClickToBuild %target% AzurePackage.proj - -:initialize2k8Dev12 -call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 -goto build - -:initialize2k8on64Dev12 -call "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 -goto build - -:initialize2k8Dev11 -call "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86 -goto build - -:initialize2k8on64Dev11 -call "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86 -goto build - -:build -if "%~1"=="" msbuild /t:Build AzurePackage.proj -msbuild /t:%~1 AzurePackage.proj - -pause -goto end - - -:end diff --git a/build.cmd b/build.cmd index 97f51bea8..f2a1903ac 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1 @@ -if "%~1"=="" call clicktobuild -call clicktobuild %~1 \ No newline at end of file +clicktobuild %*