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

Free up space by deleting samples as they build #1721

Merged
merged 4 commits into from
Jun 16, 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
14 changes: 14 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,17 @@ Task ("samples")

// build solutions locally
var solutions = GetFiles ("./output/samples/**/*.sln");

Information ("Solutions found:");
foreach (var sln in solutions) {
Information (" " + sln);
}

foreach (var sln in solutions) {
// might have been deleted due to a platform build and cleanup
if (!FileExists (sln))
continue;

var name = sln.GetFilenameWithoutExtension ();
var slnPlatform = name.GetExtension ();

Expand All @@ -460,6 +470,8 @@ Task ("samples")
if (!variants.Any ()) {
// there is no platform variant
BuildSample (sln);
// delete the built sample
CleanDirectories (sln.GetDirectory ().FullPath);
} else {
// skip as there is a platform variant
}
Expand All @@ -472,6 +484,8 @@ Task ("samples")
(isWin && slnPlatform == ".windows");
if (shouldBuild) {
BuildSample (sln);
// delete the built sample
CleanDirectories (sln.GetDirectory ().FullPath);
} else {
// skip this as this is not the correct platform
}
Expand Down