Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build script #430

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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