From a52071254a28635a0a5b9aa310ee1e4612c5c40f Mon Sep 17 00:00:00 2001 From: FroggieFrog Date: Thu, 7 Jul 2022 10:59:32 +0200 Subject: [PATCH] Update build script (#430) - remove support for VS2017 - add support for running in CI - remove clutter while restoring NuGet packages --- build/StartCakeBuild.bat | 7 +------ build/build.cake | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/build/StartCakeBuild.bat b/build/StartCakeBuild.bat index 5e4792b7..56bbb3e0 100644 --- a/build/StartCakeBuild.bat +++ b/build/StartCakeBuild.bat @@ -29,17 +29,12 @@ goto :BUILD_MODE_PROMPT set "MSBUILD_VERSION=%~1" goto :MSBUILD_VERSION_CHECK :MSBUILD_VERSION_PROMPT -set /p "MSBUILD_VERSION=Enter MSBUILD_VERSION (VS2017[6] | VS2019[7]| VS2022[10]): " +set /p "MSBUILD_VERSION=Enter MSBUILD_VERSION (VS2019[7] | VS2022[10]): " :MSBUILD_VERSION_CHECK if "%MSBUILD_VERSION%"=="" goto :MSBUILD_VERSION_PROMPT set MSBUILD_VERSION_RESULT=false -if "%MSBUILD_VERSION%"=="6" set MSBUILD_VERSION_RESULT=true if "%MSBUILD_VERSION%"=="7" set MSBUILD_VERSION_RESULT=true if "%MSBUILD_VERSION%"=="10" set MSBUILD_VERSION_RESULT=true -if "%MSBUILD_VERSION%"=="VS2017" ( -set MSBUILD_VERSION_RESULT=true -set MSBUILD_VERSION=6 -) if "%MSBUILD_VERSION%"=="VS2019" ( set MSBUILD_VERSION_RESULT=true set MSBUILD_VERSION=7 diff --git a/build/build.cake b/build/build.cake index 909249cb..61279560 100644 --- a/build/build.cake +++ b/build/build.cake @@ -17,10 +17,6 @@ var configuration = Argument("configuration", "DEBUG"); //from cake source: /// -/// MSBuild tool version: Visual Studio 2017 -/// -//VS2017 = 6, -/// /// MSBuild tool version: Visual Studio 2019 /// //VS2019 = 7, @@ -31,6 +27,7 @@ var configuration = Argument("configuration", "DEBUG"); var msbuildVersion = Argument("msbuildVersion", 7); var useBinaryLog = Argument("useBinaryLog", false); +var isWorkflowRun = Argument("isWorkflowRun", false); ////////////////////////////////////////////////////////////////////// // PREPARATION @@ -114,11 +111,17 @@ var restoreNuGetTask = Task("Restore-NuGet-Packages") .IsDependentOn(cleanTask) .Does(() => { + var settings = new NuGetRestoreSettings + { + Verbosity= NuGetVerbosity.Quiet,//NuGetVerbosity.Normal, + NoCache = false + }; + foreach (var curSolutionFile in solutionFiles) { var curSolutionFileName = System.IO.Path.GetFileName(curSolutionFile); Information($"{DateTime.Now:hh:mm:ss.ff} restoring NuGet packages for {curSolutionFileName}"); - NuGetRestore(curSolutionFile); + NuGetRestore(curSolutionFile, settings); } }); @@ -177,6 +180,12 @@ var buildTask = Task("Build") NoLogo = true }; + if(isWorkflowRun) + { + msBuildSettings.NoConsoleLogger = false; + //msBuildSettings.Verbosity = Verbosity.Normal; + } + if(useBinaryLog) { msBuildSettings.BinaryLogger = new MSBuildBinaryLogSettings @@ -322,7 +331,7 @@ var zipTask = Task("Compress-Output") .IsDependentOn(copyFilesTask) .Does(() => { - if(configuration.Equals("DEBUG", StringComparison.OrdinalIgnoreCase)) + if(configuration.Equals("DEBUG", StringComparison.OrdinalIgnoreCase) || isWorkflowRun) { return; }