Skip to content

Commit

Permalink
Update build script (#430)
Browse files Browse the repository at this point in the history
- remove support for VS2017
- add support for running in CI
- remove clutter while restoring NuGet packages
  • Loading branch information
FroggieFrog authored Jul 7, 2022
1 parent ac45e71 commit a520712
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
7 changes: 1 addition & 6 deletions build/StartCakeBuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 15 additions & 6 deletions build/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ var configuration = Argument<string>("configuration", "DEBUG");

//from cake source:
/// <summary>
/// MSBuild tool version: <c>Visual Studio 2017</c>
/// </summary>
//VS2017 = 6,
/// <summary>
/// MSBuild tool version: <c>Visual Studio 2019</c>
/// </summary>
//VS2019 = 7,
Expand All @@ -31,6 +27,7 @@ var configuration = Argument<string>("configuration", "DEBUG");

var msbuildVersion = Argument<int>("msbuildVersion", 7);
var useBinaryLog = Argument<bool>("useBinaryLog", false);
var isWorkflowRun = Argument<bool>("isWorkflowRun", false);

//////////////////////////////////////////////////////////////////////
// PREPARATION
Expand Down Expand Up @@ -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);
}
});

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a520712

Please sign in to comment.