diff --git a/.gitignore b/.gitignore index a6c4639191..5b5e7660c5 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,4 @@ apidocs/api/* build/docs.zip build/ui-docs.zip build/csharp-docs.zip +build/msbuild.log diff --git a/appveyor.yml b/appveyor.yml index db69da4978..fe8b02abc6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,15 +8,7 @@ build_script: FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i" - SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% - - ECHO %PATH% - - - ECHO Building Release %release% build%APPVEYOR_BUILD_NUMBER% - - - SET nuGetFolder=%CD%\..\src\packages\ + SET nuGetFolder=C:\Users\appveyor\.nuget\packages ..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL @@ -27,20 +19,20 @@ build_script: ..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet - + ECHO Building Release %release% build%APPVEYOR_BUILD_NUMBER% + SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% SET MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" - %MSBUILD% "../src/Umbraco.Tests/Umbraco.Tests.csproj" /verbosity:minimal - - - build.bat %release% build%APPVEYOR_BUILD_NUMBER% + %MSBUILD% "../src/Umbraco.Tests/Umbraco.Tests.csproj" /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly + build.bat nopause %release% build%APPVEYOR_BUILD_NUMBER% ECHO %PATH% test: assemblies: src\Umbraco.Tests\bin\Debug\Umbraco.Tests.dll artifacts: - path: build\UmbracoCms.* +- path: build\msbuild.log notifications: - provider: Slack auth_token: diff --git a/build/Build.bat b/build/Build.bat index 1167d9fcb6..fc0d8a69ea 100644 --- a/build/Build.bat +++ b/build/Build.bat @@ -11,20 +11,28 @@ FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SE FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i" REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version -IF [%1] NEQ [] (SET release=%1) -IF [%2] NEQ [] (SET comment=%2) ELSE (IF [%1] NEQ [] (SET "comment=")) +IF [%2] NEQ [] (SET release=%2) +IF [%3] NEQ [] (SET comment=%3) ELSE (IF [%2] NEQ [] (SET "comment=")) + +REM Get the "is continuous integration" from the parameters +SET "isci=0" +IF [%1] NEQ [] (SET isci=1) SET version=%release% - IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%) + +ECHO. ECHO Building Umbraco %version% +ECHO. ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release% +ECHO. ECHO Removing the belle build folder and bower_components folder to make sure everything is clean as a whistle RD ..\src\Umbraco.Web.UI.Client\build /Q /S RD ..\src\Umbraco.Web.UI.Client\bower_components /Q /S +ECHO. ECHO Removing existing built files to make sure everything is clean as a whistle RMDIR /Q /S _BuildOutput DEL /F /Q UmbracoCms.*.zip @@ -32,27 +40,56 @@ DEL /F /Q UmbracoExamine.*.zip DEL /F /Q UmbracoCms.*.nupkg DEL /F /Q webpihash.txt +ECHO. 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% /verbosity:minimal +REM Adding the default Git path so that if it's installed it can actually be found +REM This is necessary because SETLOCAL is on in InstallGit.cmd so that one might find Git, +REM but the path setting is lost due to SETLOCAL +path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH% + +ECHO. +ECHO Making sure we have a web.config +IF NOT EXIST %CD%\..\src\Umbraco.Web.UI\web.config COPY %CD%\..\src\Umbraco.Web.UI\web.Template.config %CD%\..\src\Umbraco.Web.UI\web.config + +ECHO. +ECHO. +ECHO Performing MSBuild and producing Umbraco binaries zip files +ECHO This takes a few minutes and logging is set to report warnings +ECHO and errors only so it might seems like nothing is happening for a while. +ECHO You can check the msbuild.log file for progress. +ECHO. +%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /p:NugetPackagesDirectory=%nuGetFolder% /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly /fileLogger +IF ERRORLEVEL 1 GOTO :error + +ECHO. ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project attrib +h ..\src\Umbraco.Web.UI.Client\node_modules +ECHO. ECHO Adding Web.config transform files to the NuGet package REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform +ECHO. ECHO Packing the NuGet release files ..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version% -Symbols -Verbosity quiet ..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version% -Verbosity quiet - -IF ERRORLEVEL 1 GOTO :showerror +IF ERRORLEVEL 1 GOTO :error -ECHO No errors were detected but you still may see some in the output, then it's time to investigate. -ECHO You might see some warnings but that is completely normal. +:success +ECHO. +ECHO No errors were detected! +ECHO There may still be some in the output, which you would need to investigate. +ECHO Warnings are usually normal. GOTO :EOF -:showerror -PAUSE +:error + +ECHO. +ECHO Errors were detected! + +REM don't pause if continuous integration else the build server waits forever +REM before cancelling the build (and, there is noone to read the output anyways) +IF isci NEQ 1 PAUSE diff --git a/build/InstallGit.cmd b/build/InstallGit.cmd index b6ba71df9b..26f8088f35 100644 --- a/build/InstallGit.cmd +++ b/build/InstallGit.cmd @@ -2,13 +2,13 @@ SETLOCAL REM SETLOCAL is on, so changes to the path not persist to the actual user's path -git.exe 2> NUL +git.exe --version if %ERRORLEVEL%==9009 GOTO :trydefaultpath GOTO :EOF :trydefaultpath path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH% -git.exe 2> NUL +git.exe --version if %ERRORLEVEL%==9009 GOTO :showerror GOTO :EOF