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

Added a parameter for configuration(Debug/Release) on the cake build script #4145

Merged
merged 1 commit into from
Jul 29, 2021
Merged
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
15 changes: 8 additions & 7 deletions build/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ using System.Text.RegularExpressions;
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");

//////////////////////////////////////////////////////////////////////
// VERSIONS
Expand All @@ -35,7 +36,7 @@ var toolsDir = buildDir + "/tools";
var binDir = baseDir + "/bin";
var nupkgDir = binDir + "/nupkg";

var taefBinDir = baseDir + "/UITests/UITests.Tests.TAEF/bin/Release/netcoreapp3.1/win10-x86";
var taefBinDir = baseDir + $"/UITests/UITests.Tests.TAEF/bin/{configuration}/netcoreapp3.1/win10-x86";

var styler = toolsDir + "/XamlStyler.Console/tools/xstyler.exe";
var stylerFile = baseDir + "/settings.xamlstyler";
Expand Down Expand Up @@ -151,7 +152,7 @@ Task("BuildProjects")
{
MaxCpuCount = 0
}
.SetConfiguration("Release")
.SetConfiguration(configuration)
.WithTarget("Restore");

MSBuild(Solution, buildSettings);
Expand All @@ -163,7 +164,7 @@ Task("BuildProjects")
{
MaxCpuCount = 0
}
.SetConfiguration("Release")
.SetConfiguration(configuration)
.WithTarget("Build")
.WithProperty("GenerateLibraryLayout", "true");

Expand Down Expand Up @@ -215,7 +216,7 @@ Task("Package")
{
MaxCpuCount = 0
}
.SetConfiguration("Release")
.SetConfiguration(configuration)
.WithTarget("Pack")
.WithProperty("GenerateLibraryLayout", "true")
.WithProperty("PackageOutputPath", nupkgDir);
Expand Down Expand Up @@ -253,13 +254,13 @@ Task("Test")
ArgumentCustomization = arg => arg.Append("/logger:trx;LogFileName=VsTestResultsUwp.trx /framework:FrameworkUap10"),
};

VSTest(baseDir + "/**/Release/**/UnitTests.*.appxrecipe", testSettings);
VSTest(baseDir + $"/**/{configuration}/**/UnitTests.*.appxrecipe", testSettings);
}).DoesForEach(GetFiles(baseDir + "/**/UnitTests.*NetCore.csproj"), (file) =>
{
Information("\nRunning NetCore Unit Tests");
var testSettings = new DotNetCoreTestSettings
{
Configuration = "Release",
Configuration = configuration,
NoBuild = true,
Loggers = new[] { "trx;LogFilePrefix=VsTestResults" },
Verbosity = DotNetCoreVerbosity.Normal,
Expand Down Expand Up @@ -306,7 +307,7 @@ Task("MSTestUITest")

var testSettings = new DotNetCoreTestSettings
{
Configuration = "Release",
Configuration = configuration,
NoBuild = true,
Loggers = new[] { "trx;LogFilePrefix=VsTestResults" },
Verbosity = DotNetCoreVerbosity.Normal
Expand Down