Skip to content

Commit a9b4f81

Browse files
authored
Merge pull request #3227 from windows-toolkit/splitBuildTests
Splitted build, tests and packaging into individual yaml steps.
2 parents f092232 + 335d237 commit a9b4f81

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

azure-pipelines.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ steps:
5252
#- powershell: .\build\Install-WindowsSdkISO.ps1 17763
5353
# displayName: Insider SDK
5454

55-
- powershell: .\build\build.ps1 -target=Default
56-
displayName: Build
55+
- powershell: .\build\build.ps1 -target=Build
56+
displayName: Build
57+
58+
- powershell: .\build\build.ps1 -target=Test
59+
displayName: Test
60+
61+
- powershell: .\build\build.ps1 -target=Package
62+
displayName: Package
5763

5864
- task: PublishTestResults@2
5965
inputs:

build/build.cake

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ void VerifyHeaders(bool Replace)
9494
}
9595
}
9696

97+
void RetrieveVersion()
98+
{
99+
Information("\nRetrieving version...");
100+
var results = StartPowershellFile(versionClient);
101+
Version = results[1].Properties["NuGetPackageVersion"].Value.ToString();
102+
Information("\nBuild Version: " + Version);
103+
}
104+
97105
//////////////////////////////////////////////////////////////////////
98106
// DEFAULT TASK
99107
//////////////////////////////////////////////////////////////////////
@@ -137,14 +145,11 @@ Task("Version")
137145

138146
NuGetInstall(new []{"nerdbank.gitversioning"}, installSettings);
139147

140-
Information("\nRetrieving version...");
141-
var results = StartPowershellFile(versionClient);
142-
Version = results[1].Properties["NuGetPackageVersion"].Value.ToString();
143-
Information("\nBuild Version: " + Version);
148+
RetrieveVersion();
144149
});
145150

146-
Task("Build")
147-
.Description("Build all projects and get the assemblies")
151+
Task("BuildProjects")
152+
.Description("Build all projects")
148153
.IsDependentOn("Version")
149154
.Does(() =>
150155
{
@@ -173,9 +178,9 @@ Task("Build")
173178
});
174179

175180
Task("InheritDoc")
176-
.Description("Updates <inheritdoc /> tags from base classes, interfaces, and similar methods")
177-
.IsDependentOn("Build")
178-
.Does(() =>
181+
.Description("Updates <inheritdoc /> tags from base classes, interfaces, and similar methods")
182+
.IsDependentOn("BuildProjects")
183+
.Does(() =>
179184
{
180185
Information("\nDownloading InheritDoc...");
181186
var installSettings = new NuGetInstallSettings {
@@ -201,9 +206,13 @@ Task("InheritDoc")
201206
Information("\nFinished generating documentation with InheritDoc");
202207
});
203208

209+
Task("Build")
210+
.Description("Build all projects runs InheritDoc")
211+
.IsDependentOn("BuildProjects")
212+
.IsDependentOn("InheritDoc");
213+
204214
Task("Package")
205215
.Description("Pack the NuPkg")
206-
.IsDependentOn("InheritDoc")
207216
.Does(() =>
208217
{
209218
// Invoke the pack target in the end
@@ -236,12 +245,14 @@ Task("Package")
236245
buildSettings.SetPlatformTarget(PlatformTarget.x86);
237246
MSBuild(Solution, buildSettings);
238247

248+
RetrieveVersion();
249+
239250
var nuGetPackSettings = new NuGetPackSettings
240251
{
241252
OutputDirectory = nupkgDir,
242253
Version = Version
243254
};
244-
255+
245256
var nuspecs = GetFiles("./*.nuspec");
246257
foreach (var nuspec in nuspecs)
247258
{
@@ -264,7 +275,6 @@ public string getMSTestAdapterPath(){
264275

265276
Task("Test")
266277
.Description("Runs all Tests")
267-
.IsDependentOn("Build")
268278
.Does(() =>
269279
{
270280
var vswhere = VSWhereLatest(new VSWhereLatestSettings
@@ -300,7 +310,8 @@ Task("Test")
300310
//////////////////////////////////////////////////////////////////////
301311

302312
Task("Default")
303-
.IsDependentOn("Test")
313+
.IsDependentOn("Build")
314+
.IsDependentOn("Test")
304315
.IsDependentOn("Package");
305316

306317
Task("UpdateHeaders")

0 commit comments

Comments
 (0)