From fce9759b4e6682a7c2a0810c4fad86253c0a66ba Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Wed, 23 Aug 2023 11:53:03 +0100 Subject: [PATCH] (#992) Provide ability to set ignore of KuduSync 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. --- Source/Cake.Recipe/Content/toolsettings.cake | 5 ++++- Source/Cake.Recipe/Content/wyam.cake | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Cake.Recipe/Content/toolsettings.cake b/Source/Cake.Recipe/Content/toolsettings.cake index bbe5ddad..0f6912f2 100644 --- a/Source/Cake.Recipe/Content/toolsettings.cake +++ b/Source/Cake.Recipe/Content/toolsettings.cake @@ -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; } @@ -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..."); @@ -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) diff --git a/Source/Cake.Recipe/Content/wyam.cake b/Source/Cake.Recipe/Content/wyam.cake index 20a5dbf2..ff7ab749 100644 --- a/Source/Cake.Recipe/Content/wyam.cake +++ b/Source/Cake.Recipe/Content/wyam.cake @@ -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))