From 043139caaef0484ea1deab06d4b9223cfce4582f Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Sun, 19 Oct 2014 13:00:54 +0200 Subject: [PATCH] Fixes build for people without git in path and with various VS versions installed (no more need to have at least VS2012 installed) --- .gitignore | 1 + build/Build.bat | 4 ++- build/InstallGit.cmd | 33 ++++++++++++++++++++++++ src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 5 +++- src/Umbraco.Web/Umbraco.Web.csproj | 5 +++- src/umbraco.presentation.targets | 4 +++ 6 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 build/InstallGit.cmd diff --git a/.gitignore b/.gitignore index 4944af8024..284703ec00 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ src/*.boltdata/ /src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.panel.js /src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.config.js /src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.front.js +src/umbraco.sln.ide/* diff --git a/build/Build.bat b/build/Build.bat index 3c29377ae0..56439efbcf 100644 --- a/build/Build.bat +++ b/build/Build.bat @@ -14,7 +14,7 @@ ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %rel ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise you'd have to run build.cmd twice SET nuGetFolder=%CD%\..\src\packages\ -..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ +..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL ..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder% ECHO Removing the belle build folder to make sure everything is clean as a whistle @@ -27,6 +27,8 @@ DEL /F /Q UmbracoExamine.*.zip DEL /F /Q UmbracoCms.*.nupkg DEL /F /Q webpihash.txt +ECHO Making sure Git is in the path so that the build can succeed +CALL InstallGit.cmd ECHO Performing MSBuild and producing Umbraco binaries zip files %windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% diff --git a/build/InstallGit.cmd b/build/InstallGit.cmd new file mode 100644 index 0000000000..f10fe6c100 --- /dev/null +++ b/build/InstallGit.cmd @@ -0,0 +1,33 @@ +@ECHO OFF +SET oldPath=%PATH% + +git.exe 2> NUL +if %ERRORLEVEL%==9009 GOTO :trydefaultpath +GOTO :EOF + +:trydefaultpath +path=C:\Program Files (x86)\Git\cmd;%PATH% +git.exe 2> NUL +if %ERRORLEVEL%==9009 GOTO :showerror +GOTO :EOF + +:showerror +path=%oldPath% +ECHO Git is not in your path and could not be found in C:\Program Files (x86)\Git\bin +set /p install=" Do you want to install Git through Chocolatey [y/n]? " %=% +if %install%==y ( + GOTO :installgit +) else ( + GOTO :cantcontinue +) + +:cantcontinue +ECHO Can't complete the build without Git being in the path. Please add it to be able to continue. +GOTO :EOF + +:installgit +ECHO Installing Chocolatey first +@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin +ECHO Installing Git through Chocolatey +choco install git +path=C:\Program Files (x86)\Git\cmd;%path% diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 23d8751f30..9ae239c247 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -2517,7 +2517,10 @@ 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0 diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index dba212c35f..ae71e31078 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -2140,7 +2140,10 @@ 11.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0 diff --git a/src/umbraco.presentation.targets b/src/umbraco.presentation.targets index d3d5c924c0..c38a1da485 100644 --- a/src/umbraco.presentation.targets +++ b/src/umbraco.presentation.targets @@ -52,6 +52,10 @@ $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll + + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.Tasks.dll + +