Skip to content

Commit

Permalink
(GH-448) Keep nupkgs at end of build
Browse files Browse the repository at this point in the history
When running on CI system, nupkgs will still be deleted to help with
potential storage issues, but by default, locally, the nupkgs will be
kept around, unless expressly told to delete them.
  • Loading branch information
gep13 committed Sep 19, 2019
1 parent e54416f commit 6132173
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cake.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Teardown(context =>
}
// Clear nupkg files from tools directory
if(DirectoryExists(Context.Environment.WorkingDirectory.Combine("tools")))
if((!BuildParameters.IsLocalBuild || BuildParameters.ShouldDeleteCachedFiles) && DirectoryExists(Context.Environment.WorkingDirectory.Combine("tools")))
{
Information("Deleting nupkg files...");
var nupkgFiles = GetFiles(Context.Environment.WorkingDirectory.Combine("tools") + "/**/*.nupkg");
Expand Down
4 changes: 4 additions & 0 deletions Cake.Recipe/Content/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public static class BuildParameters
public static bool ShouldDownloadMilestoneReleaseNotes { get; private set;}
public static bool ShouldDownloadFullReleaseNotes { get; private set;}
public static bool ShouldNotifyBetaReleases { get; private set; }
public static bool ShouldDeleteCachedFiles { get; private set; }

public static FilePath MilestoneReleaseNotesFilePath { get; private set; }
public static FilePath FullReleaseNotesFilePath { get; private set; }
Expand Down Expand Up @@ -307,6 +308,7 @@ public static class BuildParameters
context.Information("ShouldDownloadFullReleaseNotes: {0}", ShouldDownloadFullReleaseNotes);
context.Information("ShouldDownloadMilestoneReleaseNotes: {0}", ShouldDownloadMilestoneReleaseNotes);
context.Information("ShouldNotifyBetaReleases: {0}", ShouldNotifyBetaReleases);
context.Information("ShouldDeleteCachedFiles: {0}", ShouldDeleteCachedFiles);
context.Information("ShouldGenerateDocumentation: {0}", ShouldGenerateDocumentation);
context.Information("ShouldRunIntegrationTests: {0}", ShouldRunIntegrationTests);
context.Information("ShouldRunGitVersion: {0}", ShouldRunGitVersion);
Expand Down Expand Up @@ -369,6 +371,7 @@ public static class BuildParameters
bool shouldDownloadMilestoneReleaseNotes = false,
bool shouldDownloadFullReleaseNotes = false,
bool shouldNotifyBetaReleases = false,
bool shouldDeleteCachedFiles = false,
FilePath milestoneReleaseNotesFilePath = null,
FilePath fullReleaseNotesFilePath = null,
bool shouldPublishMyGet = true,
Expand Down Expand Up @@ -462,6 +465,7 @@ public static class BuildParameters
ShouldDownloadFullReleaseNotes = shouldDownloadFullReleaseNotes;
ShouldDownloadMilestoneReleaseNotes = shouldDownloadMilestoneReleaseNotes;
ShouldNotifyBetaReleases = shouldNotifyBetaReleases;
ShouldDeleteCachedFiles = shouldDeleteCachedFiles;
ShouldRunDupFinder = shouldRunDupFinder;
ShouldRunInspectCode = shouldRunInspectCode;
ShouldRunCodecov = shouldRunCodecov;
Expand Down

0 comments on commit 6132173

Please sign in to comment.