Skip to content

Commit

Permalink
(#992) Provide ability to set ignore of KuduSync
Browse files Browse the repository at this point in the history
Rather than hard-coding the ignore list, here we have added a
ToolSettings property, which will allow this ignore list to be set
within the recipe.cake file, to control exactly what files are ignored
during a sync.

The default value of the ignore list remains the same as it was
previously.
  • Loading branch information
gep13 committed Aug 23, 2023
1 parent cace39f commit fce9759
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Source/Cake.Recipe/Content/toolsettings.cake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public static class ToolSettings
public static int MaxCpuCount { get; private set; }
public static string TargetFrameworkPathOverride { get; private set; }
public static bool SkipDuplicatePackages { get; private set; }
public static string KuduSyncIgnore { get; private set; }

public static string CodecovTool { get; private set; }
public static string CoverallsTool { get; private set; }
Expand Down Expand Up @@ -93,7 +94,8 @@ public static class ToolSettings
MSBuildToolVersion buildMSBuildToolVersion = MSBuildToolVersion.Default,
int? maxCpuCount = null,
DirectoryPath targetFrameworkPathOverride = null,
bool skipDuplicatePackages = false
bool skipDuplicatePackages = false,
string kuduSyncIgnore = null
)
{
context.Information("Setting up tools...");
Expand All @@ -105,6 +107,7 @@ public static class ToolSettings
BuildPlatformTarget = buildPlatformTarget ?? PlatformTarget.MSIL;
BuildMSBuildToolVersion = buildMSBuildToolVersion;
MaxCpuCount = maxCpuCount ?? 0;
KuduSyncIgnore = kuduSyncIgnore ?? ".git;CNAME";
if (BuildParameters.ShouldUseTargetFrameworkPath && targetFrameworkPathOverride == null)
{
if (context.Environment.Runtime.IsCoreClr)
Expand Down
2 changes: 1 addition & 1 deletion Source/Cake.Recipe/Content/wyam.cake
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void PublishDocumentation()
Information("Sync output files...");
Kudu.Sync(BuildParameters.Paths.Directories.PublishedDocumentation, publishFolder, new KuduSyncSettings {
ArgumentCustomization = args=>args.Append("--ignore").AppendQuoted(".git;CNAME")
ArgumentCustomization = args=>args.Append("--ignore").AppendQuoted(ToolSettings.KuduSyncIgnore)
});
if (GitHasUncommitedChanges(publishFolder))
Expand Down

0 comments on commit fce9759

Please sign in to comment.