Skip to content

Commit 25f5a8c

Browse files
committed
Added a parameter for configuration(Debug/Release) on the cake build script
1 parent 9326ea2 commit 25f5a8c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

build/build.cake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ using System.Text.RegularExpressions;
1616
//////////////////////////////////////////////////////////////////////
1717

1818
var target = Argument("target", "Default");
19+
var configuration = Argument("configuration", "Release");
1920

2021
//////////////////////////////////////////////////////////////////////
2122
// VERSIONS
@@ -35,7 +36,7 @@ var toolsDir = buildDir + "/tools";
3536
var binDir = baseDir + "/bin";
3637
var nupkgDir = binDir + "/nupkg";
3738

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

4041
var styler = toolsDir + "/XamlStyler.Console/tools/xstyler.exe";
4142
var stylerFile = baseDir + "/settings.xamlstyler";
@@ -151,7 +152,7 @@ Task("BuildProjects")
151152
{
152153
MaxCpuCount = 0
153154
}
154-
.SetConfiguration("Release")
155+
.SetConfiguration(configuration)
155156
.WithTarget("Restore");
156157

157158
MSBuild(Solution, buildSettings);
@@ -163,7 +164,7 @@ Task("BuildProjects")
163164
{
164165
MaxCpuCount = 0
165166
}
166-
.SetConfiguration("Release")
167+
.SetConfiguration(configuration)
167168
.WithTarget("Build")
168169
.WithProperty("GenerateLibraryLayout", "true");
169170

@@ -215,7 +216,7 @@ Task("Package")
215216
{
216217
MaxCpuCount = 0
217218
}
218-
.SetConfiguration("Release")
219+
.SetConfiguration(configuration)
219220
.WithTarget("Pack")
220221
.WithProperty("GenerateLibraryLayout", "true")
221222
.WithProperty("PackageOutputPath", nupkgDir);
@@ -253,13 +254,13 @@ Task("Test")
253254
ArgumentCustomization = arg => arg.Append("/logger:trx;LogFileName=VsTestResultsUwp.trx /framework:FrameworkUap10"),
254255
};
255256

256-
VSTest(baseDir + "/**/Release/**/UnitTests.*.appxrecipe", testSettings);
257+
VSTest(baseDir + $"/**/{configuration}/**/UnitTests.*.appxrecipe", testSettings);
257258
}).DoesForEach(GetFiles(baseDir + "/**/UnitTests.*NetCore.csproj"), (file) =>
258259
{
259260
Information("\nRunning NetCore Unit Tests");
260261
var testSettings = new DotNetCoreTestSettings
261262
{
262-
Configuration = "Release",
263+
Configuration = configuration,
263264
NoBuild = true,
264265
Loggers = new[] { "trx;LogFilePrefix=VsTestResults" },
265266
Verbosity = DotNetCoreVerbosity.Normal,
@@ -306,7 +307,7 @@ Task("MSTestUITest")
306307

307308
var testSettings = new DotNetCoreTestSettings
308309
{
309-
Configuration = "Release",
310+
Configuration = configuration,
310311
NoBuild = true,
311312
Loggers = new[] { "trx;LogFilePrefix=VsTestResults" },
312313
Verbosity = DotNetCoreVerbosity.Normal

0 commit comments

Comments
 (0)