From 1c6d0737c766f4c1bc2faa78bbeaab656544751f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 16 Dec 2021 12:28:44 +0000 Subject: [PATCH 01/41] (maint) Update dependency IDisposableAnalyzers to v4.0.1 --- src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj b/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj index ca2a8904..46735dbd 100644 --- a/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj +++ b/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj @@ -39,7 +39,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 0c688ecce453c25d1919bd1d5d93ab2413839983 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Sun, 2 Jan 2022 23:53:09 +0100 Subject: [PATCH 02/41] (maint) implemented nullables --- global.json | 6 +++++ .../AsciiDoctorJRunnerTests.cs | 4 ++-- .../Cake.AsciiDoctorJ.Tests.csproj | 8 ------- .../Fixtures/AsciiDoctorJAliasesFixture.cs | 4 ++-- .../Fixtures/AsciiDoctorJRunnerFixture.cs | 4 ++-- src/Cake.AsciiDoctorJ.ruleset | 3 ++- src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs | 2 +- src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs | 7 ++---- .../AsciiDoctorJRunnerSettings.cs | 22 +++++++++---------- .../AsciiDoctorJRunnerSettingsExtensions.cs | 2 +- src/Directory.Build.props | 6 +++++ 11 files changed, 35 insertions(+), 33 deletions(-) create mode 100644 global.json create mode 100644 src/Directory.Build.props diff --git a/global.json b/global.json new file mode 100644 index 00000000..5e94f4b0 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "6.0.100", + "rollForward": "latestFeature" + } +} \ No newline at end of file diff --git a/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJRunnerTests.cs b/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJRunnerTests.cs index 1f78340a..8a7f8dd1 100644 --- a/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJRunnerTests.cs +++ b/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJRunnerTests.cs @@ -63,10 +63,10 @@ public void Should_not_throw_if_settings_and_action_are_null_on_fluent_invocatio { var fixture = new AsciiDoctorJRunnerFixture { - Settings = null + Settings = null! }; - var actual = fixture.RunFluent(null); + var actual = fixture.RunFluent(null!); actual.Args.ShouldBe(""); } diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index cc1ecf67..8b8d05c4 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -9,14 +9,6 @@ Cake.AsciiDoctorJ.Tests - - - - - - - - diff --git a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJAliasesFixture.cs b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJAliasesFixture.cs index b76cf296..bd95e795 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJAliasesFixture.cs +++ b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJAliasesFixture.cs @@ -33,13 +33,13 @@ public AsciiDoctorJAliasesFixture() internal void GivenContextIsNull() { - context = null; + context = null!; } internal new ToolFixtureResult RunFluent(Action configure) { context.AsciiDoctorJ(configure); - return ProcessRunner.Results.LastOrDefault(); + return ProcessRunner.Results.Last(); } protected override void RunTool() diff --git a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerFixture.cs b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerFixture.cs index 4d8ebb4a..5e0abbf6 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerFixture.cs +++ b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerFixture.cs @@ -14,14 +14,14 @@ public AsciiDoctorJRunnerFixture() public void GivenSettingsIsNull() { - Settings = null; + Settings = null!; } public ToolFixtureResult RunFluent(Action configure) { var tool = new AsciiDoctorJRunner(FileSystem, Environment, ProcessRunner, Tools); tool.Run(configure, Settings); - return ProcessRunner.Results.LastOrDefault(); + return ProcessRunner.Results.Last(); } protected override void RunTool() diff --git a/src/Cake.AsciiDoctorJ.ruleset b/src/Cake.AsciiDoctorJ.ruleset index 48e4826c..07f0334f 100644 --- a/src/Cake.AsciiDoctorJ.ruleset +++ b/src/Cake.AsciiDoctorJ.ruleset @@ -11,6 +11,7 @@ + @@ -21,4 +22,4 @@ - \ No newline at end of file + diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs index 1197d7a7..a6d84c54 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs @@ -42,7 +42,7 @@ public static class AsciiDoctorJAliases [CakeAliasCategory("AsciiDoctorJ")] public static void AsciiDoctorJ( this ICakeContext context, - Action configure = null) + Action? configure = null) { if (context == null) { diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs index 267ee115..0b2cc396 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs @@ -35,12 +35,9 @@ internal AsciiDoctorJRunner(IFileSystem fileSystem, ICakeEnvironment environment /// /// The configuration action. /// The settings. - internal void Run(Action configure = null, AsciiDoctorJRunnerSettings settings = null) + internal void Run(Action? configure = null, AsciiDoctorJRunnerSettings? settings = null) { - if (settings == null) - { - settings = new AsciiDoctorJRunnerSettings(); - } + settings ??= new AsciiDoctorJRunnerSettings(); configure?.Invoke(settings); Run(settings); diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs index 2c7ccbba..ab4d8d2c 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs @@ -52,14 +52,14 @@ public AsciiDoctorJRunnerSettings() /// template engine to use for the custom render templates (loads gem on demand). /// corresponds to: -E, --template-engine. /// - public string TemplateEngine { get; set; } + public string? TemplateEngine { get; set; } /// /// Gets or sets a value indicating the /// directory containing custom render templates the override the built-in set. /// corresponds to: -T, --template-dir. /// - public DirectoryPath TemplateDir { get; set; } + public DirectoryPath? TemplateDir { get; set; } /// /// Gets or sets a value indicating whether to @@ -97,7 +97,7 @@ public AsciiDoctorJRunnerSettings() /// output file(default: based on input file path); use - to output to STDOUT. /// corresponds to: -o, --out-file. /// - public FilePath Output { get; set; } + public FilePath? Output { get; set; } /// /// Gets or sets a value indicating whether to @@ -140,7 +140,7 @@ public AsciiDoctorJRunnerSettings() /// Default: Directory of source file. /// corresponds to: -D, --destination-dir. /// - public DirectoryPath DestinationDir { get; set; } + public DirectoryPath? DestinationDir { get; set; } /// /// Gets or sets a value indicating whether to @@ -162,7 +162,7 @@ public AsciiDoctorJRunnerSettings() /// Default: directory of source file. /// corresponds to: -B, --base-dir. /// - public DirectoryPath BaseDir { get; set; } + public DirectoryPath? BaseDir { get; set; } /// /// Gets or sets a value indicating whether to @@ -170,7 +170,7 @@ public AsciiDoctorJRunnerSettings() /// Default: html5. /// corresponds to: -b, --backend. /// - public string Backend { get; set; } + public string? Backend { get; set; } /// /// Gets the list of attributes to set on the document. @@ -219,7 +219,7 @@ internal void Evaluate(ProcessArgumentBuilder args, ICakeEnvironment environment if (SafeMode.HasValue) { // ReSharper disable PossibleNullReferenceException - args.Append("--safe-mode " + Enum.GetName(typeof(SafeMode), SafeMode.Value).ToLowerInvariant()); + args.Append("--safe-mode " + Enum.GetName(typeof(SafeMode), SafeMode.Value) !.ToLowerInvariant()); // ReSharper enable PossibleNullReferenceException } @@ -252,14 +252,14 @@ internal void Evaluate(ProcessArgumentBuilder args, ICakeEnvironment environment if (ERuby.HasValue) { // ReSharper disable PossibleNullReferenceException - args.Append("--eruby " + Enum.GetName(typeof(ERuby), ERuby.Value).ToLowerInvariant()); + args.Append("--eruby " + Enum.GetName(typeof(ERuby), ERuby.Value) !.ToLowerInvariant()); // ReSharper enable PossibleNullReferenceException } if (DocType.HasValue) { - args.Append("--doctype " + Enum.GetName(typeof(DocType), DocType.Value).ToLowerInvariant()); + args.Append("--doctype " + Enum.GetName(typeof(DocType), DocType.Value) !.ToLowerInvariant()); } if (DestinationDir != null) @@ -290,9 +290,9 @@ internal void Evaluate(ProcessArgumentBuilder args, ICakeEnvironment environment args.Append("--backend " + Backend); } - foreach (var kvp in Attributes) + foreach ((string key, string value) in Attributes) { - args.Append($"--attribute {kvp.Key}={kvp.Value}"); + args.Append($"--attribute {key}={value}"); } // input is last! diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs index 3e46623d..2442be9c 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs @@ -306,7 +306,7 @@ public static AsciiDoctorJRunnerSettings WithBackend(this AsciiDoctorJRunnerSett public static AsciiDoctorJRunnerSettings WithBuiltinBackend(this AsciiDoctorJRunnerSettings @this, BuiltinBackend backend) { // ReSharper disable PossibleNullReferenceException - @this.Backend = Enum.GetName(typeof(BuiltinBackend), backend).ToLowerInvariant(); + @this.Backend = Enum.GetName(typeof(BuiltinBackend), backend) !.ToLowerInvariant(); // ReSharper enable PossibleNullReferenceException return @this; diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..3aab2ef9 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,6 @@ + + + 10 + enable + + \ No newline at end of file From d52d4f9cf189ccdb3c9a6a3b002e6717725a254e Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Sun, 2 Jan 2022 23:58:16 +0100 Subject: [PATCH 03/41] (maint) switched to file-scoped namespaces --- .../AsciiDoctorJAliasesTests.cs | 103 ++- .../AsciiDoctorJRunnerTests.cs | 90 ++- .../Fixtures/AsciiDoctorJAliasesFixture.cs | 71 ++- .../Fixtures/AsciiDoctorJRunnerFixture.cs | 41 +- ...iDoctorJRunnerSettingsExtensionsFixture.cs | 17 +- .../SettingsExtensionsTests.cs | 400 ++++++------ src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs | 119 ++-- src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs | 163 +++-- src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs | 95 ++- .../AsciiDoctorJRunnerSettings.cs | 575 +++++++++-------- .../AsciiDoctorJRunnerSettingsExtensions.cs | 593 +++++++++--------- src/Cake.AsciiDoctorJ/BuiltinBackend.cs | 67 +- src/Cake.AsciiDoctorJ/DocType.cs | 35 +- src/Cake.AsciiDoctorJ/ERuby.cs | 27 +- src/Cake.AsciiDoctorJ/Namespaces.cs | 15 +- src/Cake.AsciiDoctorJ/SafeMode.cs | 43 +- 16 files changed, 1224 insertions(+), 1230 deletions(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJAliasesTests.cs b/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJAliasesTests.cs index becbb0d4..ddeb9a18 100644 --- a/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJAliasesTests.cs +++ b/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJAliasesTests.cs @@ -6,59 +6,58 @@ using Xunit; -namespace Cake.AsciiDoctorJ.Tests +namespace Cake.AsciiDoctorJ.Tests; + +public class AsciiDoctorJAliasesTests { - public class AsciiDoctorJAliasesTests + [Fact] + public void Should_throw_if_settings_are_null() + { + var fixture = new AsciiDoctorJAliasesFixture(); + fixture.GivenSettingsIsNull(); + + Action action = () => fixture.Run(); + action.ShouldThrow().ParamName.ShouldBe("settings"); + } + + [Fact] + public void Should_not_throw_if_settings_are_set() + { + var fixture = new AsciiDoctorJAliasesFixture(); + + var actual = fixture.Run(); + + actual.Args.ShouldBe(""); + } + + [Fact] + public void Should_not_throw_if_settings_are_null_but_called_fluently() { - [Fact] - public void Should_throw_if_settings_are_null() - { - var fixture = new AsciiDoctorJAliasesFixture(); - fixture.GivenSettingsIsNull(); - - Action action = () => fixture.Run(); - action.ShouldThrow().ParamName.ShouldBe("settings"); - } - - [Fact] - public void Should_not_throw_if_settings_are_set() - { - var fixture = new AsciiDoctorJAliasesFixture(); - - var actual = fixture.Run(); - - actual.Args.ShouldBe(""); - } - - [Fact] - public void Should_not_throw_if_settings_are_null_but_called_fluently() - { - var fixture = new AsciiDoctorJAliasesFixture(); - fixture.GivenSettingsIsNull(); - - var actual = fixture.RunFluent(x => { }); - - actual.Args.ShouldBe(""); - } - - [Fact] - public void Should_throw_if_context_is_null() - { - var fixture = new AsciiDoctorJAliasesFixture(); - fixture.GivenContextIsNull(); - - Action action = () => fixture.Run(); - action.ShouldThrow().ParamName.ShouldBe("context"); - } - - [Fact] - public void Should_throw_if_context_is_null_called_fluently() - { - var fixture = new AsciiDoctorJAliasesFixture(); - fixture.GivenContextIsNull(); - - Action action = () => fixture.RunFluent(x => { }); - action.ShouldThrow().ParamName.ShouldBe("context"); - } + var fixture = new AsciiDoctorJAliasesFixture(); + fixture.GivenSettingsIsNull(); + + var actual = fixture.RunFluent(x => { }); + + actual.Args.ShouldBe(""); + } + + [Fact] + public void Should_throw_if_context_is_null() + { + var fixture = new AsciiDoctorJAliasesFixture(); + fixture.GivenContextIsNull(); + + Action action = () => fixture.Run(); + action.ShouldThrow().ParamName.ShouldBe("context"); + } + + [Fact] + public void Should_throw_if_context_is_null_called_fluently() + { + var fixture = new AsciiDoctorJAliasesFixture(); + fixture.GivenContextIsNull(); + + Action action = () => fixture.RunFluent(x => { }); + action.ShouldThrow().ParamName.ShouldBe("context"); } } diff --git a/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJRunnerTests.cs b/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJRunnerTests.cs index 8a7f8dd1..5da70730 100644 --- a/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJRunnerTests.cs +++ b/src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJRunnerTests.cs @@ -8,67 +8,63 @@ using Xunit; -namespace Cake.AsciiDoctorJ.Tests +namespace Cake.AsciiDoctorJ.Tests; + +public class AsciiDoctorJRunnerTests { - public class AsciiDoctorJRunnerTests + [Fact] + public void Should_Throw_If_Settings_Are_Null() { - [Fact] - public void Should_Throw_If_Settings_Are_Null() - { - var fixture = new AsciiDoctorJRunnerFixture(); - fixture.GivenSettingsIsNull(); + var fixture = new AsciiDoctorJRunnerFixture(); + fixture.GivenSettingsIsNull(); - Action result = () => - { - fixture.Run(); - }; + Action result = () => + { + fixture.Run(); + }; - result.ShouldThrow(); - } + result.ShouldThrow(); + } - [Fact] - public void Should_throw_if_asciidoctorj_executable_was_not_found() - { - var fixture = new AsciiDoctorJRunnerFixture(); - fixture.GivenDefaultToolDoNotExist(); - const string expectedMessage = "Could not locate executable"; + [Fact] + public void Should_throw_if_asciidoctorj_executable_was_not_found() + { + var fixture = new AsciiDoctorJRunnerFixture(); + fixture.GivenDefaultToolDoNotExist(); + const string expectedMessage = "Could not locate executable"; - Action result = () => fixture.Run(); - result.ShouldThrow().Message.ShouldContain(expectedMessage); - } + Action result = () => fixture.Run(); + result.ShouldThrow().Message.ShouldContain(expectedMessage); + } - [Fact] - public void Should_not_throw_if_asciidoctorj_executable_was_found() - { - var fixture = new AsciiDoctorJRunnerFixture(); + [Fact] + public void Should_not_throw_if_asciidoctorj_executable_was_found() + { + var fixture = new AsciiDoctorJRunnerFixture(); - var actual = fixture.RunFluent(x => { }); + var actual = fixture.RunFluent(x => { }); - actual.Args.ShouldBe(""); - } + actual.Args.ShouldBe(""); + } - [Fact] - public void Should_not_throw_if_settings_are_null_on_fluent_invocation() - { - var fixture = new AsciiDoctorJRunnerFixture(); - fixture.GivenSettingsIsNull(); + [Fact] + public void Should_not_throw_if_settings_are_null_on_fluent_invocation() + { + var fixture = new AsciiDoctorJRunnerFixture(); + fixture.GivenSettingsIsNull(); - var actual = fixture.RunFluent(x => { }); + var actual = fixture.RunFluent(x => { }); - actual.Args.ShouldBe(""); - } + actual.Args.ShouldBe(""); + } - [Fact] - public void Should_not_throw_if_settings_and_action_are_null_on_fluent_invocation() - { - var fixture = new AsciiDoctorJRunnerFixture - { - Settings = null! - }; + [Fact] + public void Should_not_throw_if_settings_and_action_are_null_on_fluent_invocation() + { + var fixture = new AsciiDoctorJRunnerFixture { Settings = null! }; - var actual = fixture.RunFluent(null!); + var actual = fixture.RunFluent(null!); - actual.Args.ShouldBe(""); - } + actual.Args.ShouldBe(""); } } diff --git a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJAliasesFixture.cs b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJAliasesFixture.cs index bd95e795..c9435391 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJAliasesFixture.cs +++ b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJAliasesFixture.cs @@ -8,43 +8,42 @@ using Moq; -namespace Cake.AsciiDoctorJ.Tests.Fixtures +namespace Cake.AsciiDoctorJ.Tests.Fixtures; + +internal class AsciiDoctorJAliasesFixture : AsciiDoctorJRunnerFixture { - internal class AsciiDoctorJAliasesFixture : AsciiDoctorJRunnerFixture + private ICakeContext context; + + public AsciiDoctorJAliasesFixture() + { + var argumentsMoq = new Mock(); + var registryMoq = new Mock(); + var dataService = new Mock(); + context = new CakeContext( + FileSystem, + Environment, + Globber, + new FakeLog(), + argumentsMoq.Object, + ProcessRunner, + registryMoq.Object, + Tools, dataService.Object, + Configuration); + } + + internal void GivenContextIsNull() + { + context = null!; + } + + internal new ToolFixtureResult RunFluent(Action configure) + { + context.AsciiDoctorJ(configure); + return ProcessRunner.Results.Last(); + } + + protected override void RunTool() { - private ICakeContext context; - - public AsciiDoctorJAliasesFixture() - { - var argumentsMoq = new Mock(); - var registryMoq = new Mock(); - var dataService = new Mock(); - context = new CakeContext( - FileSystem, - Environment, - Globber, - new FakeLog(), - argumentsMoq.Object, - ProcessRunner, - registryMoq.Object, - Tools, dataService.Object, - Configuration); - } - - internal void GivenContextIsNull() - { - context = null!; - } - - internal new ToolFixtureResult RunFluent(Action configure) - { - context.AsciiDoctorJ(configure); - return ProcessRunner.Results.Last(); - } - - protected override void RunTool() - { - context.AsciiDoctorJ(Settings); - } + context.AsciiDoctorJ(Settings); } } diff --git a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerFixture.cs b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerFixture.cs index 5e0abbf6..34d4e010 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerFixture.cs +++ b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerFixture.cs @@ -3,31 +3,30 @@ using Cake.Testing.Fixtures; -namespace Cake.AsciiDoctorJ.Tests.Fixtures +namespace Cake.AsciiDoctorJ.Tests.Fixtures; + +public class AsciiDoctorJRunnerFixture : ToolFixture { - public class AsciiDoctorJRunnerFixture : ToolFixture + public AsciiDoctorJRunnerFixture() + : base("asciidoctorj.exe") { - public AsciiDoctorJRunnerFixture() - : base("asciidoctorj.exe") - { - } + } - public void GivenSettingsIsNull() - { - Settings = null!; - } + public void GivenSettingsIsNull() + { + Settings = null!; + } - public ToolFixtureResult RunFluent(Action configure) - { - var tool = new AsciiDoctorJRunner(FileSystem, Environment, ProcessRunner, Tools); - tool.Run(configure, Settings); - return ProcessRunner.Results.Last(); - } + public ToolFixtureResult RunFluent(Action configure) + { + var tool = new AsciiDoctorJRunner(FileSystem, Environment, ProcessRunner, Tools); + tool.Run(configure, Settings); + return ProcessRunner.Results.Last(); + } - protected override void RunTool() - { - var tool = new AsciiDoctorJRunner(FileSystem, Environment, ProcessRunner, Tools); - tool.Run(Settings); - } + protected override void RunTool() + { + var tool = new AsciiDoctorJRunner(FileSystem, Environment, ProcessRunner, Tools); + tool.Run(Settings); } } diff --git a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerSettingsExtensionsFixture.cs b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerSettingsExtensionsFixture.cs index c6c13f19..b272db64 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerSettingsExtensionsFixture.cs +++ b/src/Cake.AsciiDoctorJ.Tests/Fixtures/AsciiDoctorJRunnerSettingsExtensionsFixture.cs @@ -1,18 +1,17 @@ using Cake.Core.IO; using Cake.Testing; -namespace Cake.AsciiDoctorJ.Tests.Fixtures +namespace Cake.AsciiDoctorJ.Tests.Fixtures; + +public class AsciiDoctorJRunnerSettingsExtensionsFixture { - public class AsciiDoctorJRunnerSettingsExtensionsFixture + public string EvaluateArgs(AsciiDoctorJRunnerSettings settings) { - public string EvaluateArgs(AsciiDoctorJRunnerSettings settings) - { - var args = new ProcessArgumentBuilder(); - var environment = FakeEnvironment.CreateWindowsEnvironment(); + var args = new ProcessArgumentBuilder(); + var environment = FakeEnvironment.CreateWindowsEnvironment(); - settings.Evaluate(args, environment); + settings.Evaluate(args, environment); - return args.Render(); - } + return args.Render(); } } diff --git a/src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs b/src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs index 9727a096..e2bb919a 100644 --- a/src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs +++ b/src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs @@ -10,224 +10,230 @@ using Xunit; -namespace Cake.AsciiDoctorJ.Tests +namespace Cake.AsciiDoctorJ.Tests; + +public class SettingsExtensionsTests { - public class SettingsExtensionsTests + [Theory] + [ClassData(typeof(TestData))] + public void Should_convert_all_extensions_to_arguments(Action setFlag, + string expectedParam) { - [Theory] - [ClassData(typeof(TestData))] - public void Should_convert_all_extensions_to_arguments(Action setFlag, string expectedParam) - { - var fixture = new AsciiDoctorJRunnerSettingsExtensionsFixture(); - var sut = new AsciiDoctorJRunnerSettings(); + var fixture = new AsciiDoctorJRunnerSettingsExtensionsFixture(); + var sut = new AsciiDoctorJRunnerSettings(); + + setFlag(sut); + + var actual = fixture.EvaluateArgs(sut); + actual.ShouldContain(expectedParam); + } + + [Theory] + [ClassData(typeof(ArgSetterTestData))] + public void Should_convert_all_extensions_to_setArgs( + Action setFlag, + Func getFlag, + object expected) + { + var sut = new AsciiDoctorJRunnerSettings(); + setFlag(sut); - setFlag(sut); + var actual = getFlag(sut); - var actual = fixture.EvaluateArgs(sut); - actual.ShouldContain(expectedParam); + if (!(actual is string) && actual is IEnumerable enumerable) + { + enumerable.ShouldBe((IEnumerable)expected); + } + else + { + actual.ShouldBe(expected); } + } + + [Theory] + [ClassData(typeof(RetValTestData))] + public void Should_return_the_settings_for_fluent_re_use( + Func fluentMethod) + { + var sut = new AsciiDoctorJRunnerSettings(); - [Theory] - [ClassData(typeof(ArgSetterTestData))] - public void Should_convert_all_extensions_to_setArgs( - Action setFlag, - Func getFlag, - object expected) + var actual = fluentMethod(sut); + + actual.ShouldBe(sut); + } + + private class TestData : IEnumerable + { + private IEnumerable<(Action, string)> GetTestData() { - var sut = new AsciiDoctorJRunnerSettings(); - setFlag(sut); - - var actual = getFlag(sut); - - if (!(actual is string) && actual is IEnumerable enumerable) - { - enumerable.ShouldBe((IEnumerable)expected); - } - else - { - actual.ShouldBe(expected); - } + // flags + yield return (s => s.WithVersion(), "--version"); + yield return (s => s.WithVerbose(), "--verbose"); + yield return (s => s.WithTimingsMode(), "--timings"); + yield return (s => s.WithSectionNumbers(), "--section-numbers"); + yield return (s => s.WithRequire(), "--require"); + yield return (s => s.WithQuiet(), "--quiet"); + yield return (s => s.WithSuppressHeaderAndFooter(), "--no-header-footer"); + yield return (s => s.WithCompact(), "--compact"); + + // safemode-arg + yield return (s => s.WithSafeMode(SafeMode.Safe), "--safe-mode safe"); + yield return (s => s.WithSafeMode(SafeMode.Unsafe), "--safe-mode unsafe"); + yield return (s => s.WithSafeMode(SafeMode.Secure), "--safe-mode secure"); + yield return (s => s.WithSafeMode(SafeMode.Server), "--safe-mode server"); + + // eruby-arg + yield return (s => s.WithERuby(ERuby.Erb), "--eruby erb"); + yield return (s => s.WithERuby(ERuby.Erubis), "--eruby erubis"); + + // doctype-arg + yield return (s => s.WithDocType(DocType.Article), "--doctype article"); + yield return (s => s.WithDocType(DocType.Book), "--doctype book"); + yield return (s => s.WithDocType(DocType.Inline), "--doctype inline"); + + // builtin backend - arg + yield return (s => s.WithBuiltinBackend(BuiltinBackend.DocBook), "--backend docbook"); + yield return (s => s.WithBuiltinBackend(BuiltinBackend.DocBook5), "--backend docbook5"); + yield return (s => s.WithBuiltinBackend(BuiltinBackend.Html), "--backend html"); + yield return (s => s.WithBuiltinBackend(BuiltinBackend.Html5), "--backend html5"); + yield return (s => s.WithBuiltinBackend(BuiltinBackend.Manpage), "--backend manpage"); + yield return (s => s.WithBuiltinBackend(BuiltinBackend.Xhtml), "--backend xhtml"); + yield return (s => s.WithBuiltinBackend(BuiltinBackend.Xhtml5), "--backend xhtml5"); + + // misc args + yield return (s => s.WithTemplateEngine("some-engine"), "--template-engine some-engine"); + yield return (s => s.WithTemplateDir(new DirectoryPath("/foo")), "--template-dir \"/foo\""); + yield return (s => s.WithOutputFile(new FilePath("/foo.pdf")), "--out-file \"/foo.pdf\""); + yield return (s => s.WithLoadPath(new DirectoryPath("/foo")), "--load-path \"/foo\""); + yield return (s => s.WithLoadPaths(new[] { new DirectoryPath("/foo"), new DirectoryPath("/bar") }), + "--load-path \"/foo\" --load-path \"/bar\""); + yield return (s => s.WithDestinationDir(new DirectoryPath("/foo")), "--destination-dir \"/foo\""); + yield return (s => s.WithClassPath(new DirectoryPath("/foo")), "--classpath \"/foo\""); + yield return (s => s.WithClassPaths(new[] { new DirectoryPath("/foo"), new DirectoryPath("/bar") }), + "--classpath \"/foo\" --classpath \"/bar\""); + yield return (s => s.WithBaseDir(new DirectoryPath("/foo")), "--base-dir \"/foo\""); + yield return (s => s.WithBackend("pdf"), "--backend pdf"); + yield return (s => s.WithAttribute("foo", "bar"), "--attribute foo=bar"); + yield return (s => s.WithAttributes(new Dictionary { { "foo", "bar" }, { "bim", "bam" } }), + "--attribute foo=bar --attribute bim=bam"); + yield return (s => s.WithInputFile(new FilePath("/foo.adoc")), "/foo.adoc"); + yield return (s => s.WithInputFiles(new[] { new FilePath("/foo.adoc"), new FilePath("/bar.adoc") }), + "\"/foo.adoc\" \"/bar.adoc\""); } - [Theory] - [ClassData(typeof(RetValTestData))] - public void Should_return_the_settings_for_fluent_re_use(Func fluentMethod) + public IEnumerator GetEnumerator() { - var sut = new AsciiDoctorJRunnerSettings(); + return GetTestData().Select(x => new[] { (object)x.Item1, x.Item2 }).GetEnumerator(); + } - var actual = fluentMethod(sut); + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + } - actual.ShouldBe(sut); + private class ArgSetterTestData : IEnumerable + { + private IEnumerable<(Action, + Func, + object)> GetTestData() + { + // flags + yield return (s => s.WithVersion(), s => s.Version, true); + yield return (s => s.WithVerbose(), s => s.Verbose, true); + yield return (s => s.WithTimingsMode(), s => s.TimingsMode, true); + yield return (s => s.WithSectionNumbers(), s => s.SectionNumbers, true); + yield return (s => s.WithRequire(), s => s.Require, true); + yield return (s => s.WithQuiet(), s => s.Quiet, true); + yield return (s => s.WithSuppressHeaderAndFooter(), s => s.SuppressHeaderAndFooter, true); + yield return (s => s.WithCompact(), s => s.Compact, true); + + // safemode-arg + yield return (s => s.WithSafeMode(SafeMode.Safe), s => s.SafeMode, SafeMode.Safe); + yield return (s => s.WithSafeMode(SafeMode.Unsafe), s => s.SafeMode, SafeMode.Unsafe); + yield return (s => s.WithSafeMode(SafeMode.Secure), s => s.SafeMode, SafeMode.Secure); + yield return (s => s.WithSafeMode(SafeMode.Server), s => s.SafeMode, SafeMode.Server); + + // eruby-arg + yield return (s => s.WithERuby(ERuby.Erb), s => s.ERuby, ERuby.Erb); + yield return (s => s.WithERuby(ERuby.Erubis), s => s.ERuby, ERuby.Erubis); + + // doctype-arg + yield return (s => s.WithDocType(DocType.Article), s => s.DocType, DocType.Article); + yield return (s => s.WithDocType(DocType.Book), s => s.DocType, DocType.Book); + yield return (s => s.WithDocType(DocType.Inline), s => s.DocType, DocType.Inline); + + // misc args + var fooDir = new DirectoryPath("/foo"); + var barDir = new DirectoryPath("/bar"); + var fooPdf = new FilePath("foo.pdf"); + var fooAdoc = new FilePath("foo.adoc"); + var barAdoc = new FilePath("bar.adoc"); + var fooBar = new KeyValuePair("foo", "bar"); + var bimBam = new KeyValuePair("bim", "bam"); + yield return (s => s.WithTemplateEngine("some-engine"), s => s.TemplateEngine, "some-engine"); + yield return (s => s.WithTemplateDir(fooDir), s => s.TemplateDir, fooDir); + yield return (s => s.WithOutputFile(fooPdf), s => s.Output, fooPdf); + yield return (s => s.WithLoadPath(fooDir), s => s.LoadPath, new[] { fooDir }); + yield return (s => s.WithLoadPaths(new[] { fooDir, barDir }), s => s.LoadPath, new[] { fooDir, barDir }); + yield return (s => s.WithDestinationDir(fooDir), s => s.DestinationDir, fooDir); + yield return (s => s.WithClassPath(fooDir), s => s.ClassPath, new[] { fooDir }); + yield return (s => s.WithClassPaths(new[] { fooDir, barDir }), s => s.ClassPath, new[] { fooDir, barDir }); + yield return (s => s.WithBaseDir(fooDir), s => s.BaseDir, fooDir); + yield return (s => s.WithBackend("pdf"), s => s.Backend, "pdf"); + yield return (s => s.WithBuiltinBackend(BuiltinBackend.Html), s => s.Backend, "html"); + yield return (s => s.WithAttribute(fooBar.Key, fooBar.Value), s => s.Attributes, new[] { fooBar }); + yield return (s => s.WithAttributes(new[] { fooBar, bimBam }), s => s.Attributes, new[] { fooBar, bimBam }); + yield return (s => s.WithInputFile(fooAdoc), s => s.InputFiles, new[] { fooAdoc }); + yield return (s => s.WithInputFiles(new[] { fooAdoc, barAdoc }), s => s.InputFiles, + new[] { fooAdoc, barAdoc }); } - private class TestData : IEnumerable + public IEnumerator GetEnumerator() { - private IEnumerable<(Action, string)> GetTestData() - { - // flags - yield return (s => s.WithVersion(), "--version"); - yield return (s => s.WithVerbose(), "--verbose"); - yield return (s => s.WithTimingsMode(), "--timings"); - yield return (s => s.WithSectionNumbers(), "--section-numbers"); - yield return (s => s.WithRequire(), "--require"); - yield return (s => s.WithQuiet(), "--quiet"); - yield return (s => s.WithSuppressHeaderAndFooter(), "--no-header-footer"); - yield return (s => s.WithCompact(), "--compact"); - - // safemode-arg - yield return (s => s.WithSafeMode(SafeMode.Safe), "--safe-mode safe"); - yield return (s => s.WithSafeMode(SafeMode.Unsafe), "--safe-mode unsafe"); - yield return (s => s.WithSafeMode(SafeMode.Secure), "--safe-mode secure"); - yield return (s => s.WithSafeMode(SafeMode.Server), "--safe-mode server"); - - // eruby-arg - yield return (s => s.WithERuby(ERuby.Erb), "--eruby erb"); - yield return (s => s.WithERuby(ERuby.Erubis), "--eruby erubis"); - - // doctype-arg - yield return (s => s.WithDocType(DocType.Article), "--doctype article"); - yield return (s => s.WithDocType(DocType.Book), "--doctype book"); - yield return (s => s.WithDocType(DocType.Inline), "--doctype inline"); - - // builtin backend - arg - yield return (s => s.WithBuiltinBackend(BuiltinBackend.DocBook), "--backend docbook"); - yield return (s => s.WithBuiltinBackend(BuiltinBackend.DocBook5), "--backend docbook5"); - yield return (s => s.WithBuiltinBackend(BuiltinBackend.Html), "--backend html"); - yield return (s => s.WithBuiltinBackend(BuiltinBackend.Html5), "--backend html5"); - yield return (s => s.WithBuiltinBackend(BuiltinBackend.Manpage), "--backend manpage"); - yield return (s => s.WithBuiltinBackend(BuiltinBackend.Xhtml), "--backend xhtml"); - yield return (s => s.WithBuiltinBackend(BuiltinBackend.Xhtml5), "--backend xhtml5"); - - // misc args - yield return (s => s.WithTemplateEngine("some-engine"), "--template-engine some-engine"); - yield return (s => s.WithTemplateDir(new DirectoryPath("/foo")), "--template-dir \"/foo\""); - yield return (s => s.WithOutputFile(new FilePath("/foo.pdf")), "--out-file \"/foo.pdf\""); - yield return (s => s.WithLoadPath(new DirectoryPath("/foo")), "--load-path \"/foo\""); - yield return (s => s.WithLoadPaths(new[] { new DirectoryPath("/foo"), new DirectoryPath("/bar") }), "--load-path \"/foo\" --load-path \"/bar\""); - yield return (s => s.WithDestinationDir(new DirectoryPath("/foo")), "--destination-dir \"/foo\""); - yield return (s => s.WithClassPath(new DirectoryPath("/foo")), "--classpath \"/foo\""); - yield return (s => s.WithClassPaths(new[] { new DirectoryPath("/foo"), new DirectoryPath("/bar") }), "--classpath \"/foo\" --classpath \"/bar\""); - yield return (s => s.WithBaseDir(new DirectoryPath("/foo")), "--base-dir \"/foo\""); - yield return (s => s.WithBackend("pdf"), "--backend pdf"); - yield return (s => s.WithAttribute("foo", "bar"), "--attribute foo=bar"); - yield return (s => s.WithAttributes(new Dictionary { { "foo", "bar" }, { "bim", "bam" } }), "--attribute foo=bar --attribute bim=bam"); - yield return (s => s.WithInputFile(new FilePath("/foo.adoc")), "/foo.adoc"); - yield return (s => s.WithInputFiles(new[] { new FilePath("/foo.adoc"), new FilePath("/bar.adoc") }), "\"/foo.adoc\" \"/bar.adoc\""); - } - - public IEnumerator GetEnumerator() - { - return GetTestData().Select(x => new[] { (object)x.Item1, x.Item2 }).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + return GetTestData().Select(x => new[] { x.Item1, x.Item2, x.Item3 }).GetEnumerator(); } - private class ArgSetterTestData : IEnumerable + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + } + + private class RetValTestData : IEnumerable + { + private IEnumerable> GetTestData() { - private IEnumerable<(Action, - Func, - object)> GetTestData() - { - // flags - yield return (s => s.WithVersion(), s => s.Version, true); - yield return (s => s.WithVerbose(), s => s.Verbose, true); - yield return (s => s.WithTimingsMode(), s => s.TimingsMode, true); - yield return (s => s.WithSectionNumbers(), s => s.SectionNumbers, true); - yield return (s => s.WithRequire(), s => s.Require, true); - yield return (s => s.WithQuiet(), s => s.Quiet, true); - yield return (s => s.WithSuppressHeaderAndFooter(), s => s.SuppressHeaderAndFooter, true); - yield return (s => s.WithCompact(), s => s.Compact, true); - - // safemode-arg - yield return (s => s.WithSafeMode(SafeMode.Safe), s => s.SafeMode, SafeMode.Safe); - yield return (s => s.WithSafeMode(SafeMode.Unsafe), s => s.SafeMode, SafeMode.Unsafe); - yield return (s => s.WithSafeMode(SafeMode.Secure), s => s.SafeMode, SafeMode.Secure); - yield return (s => s.WithSafeMode(SafeMode.Server), s => s.SafeMode, SafeMode.Server); - - // eruby-arg - yield return (s => s.WithERuby(ERuby.Erb), s => s.ERuby, ERuby.Erb); - yield return (s => s.WithERuby(ERuby.Erubis), s => s.ERuby, ERuby.Erubis); - - // doctype-arg - yield return (s => s.WithDocType(DocType.Article), s => s.DocType, DocType.Article); - yield return (s => s.WithDocType(DocType.Book), s => s.DocType, DocType.Book); - yield return (s => s.WithDocType(DocType.Inline), s => s.DocType, DocType.Inline); - - // misc args - var fooDir = new DirectoryPath("/foo"); - var barDir = new DirectoryPath("/bar"); - var fooPdf = new FilePath("foo.pdf"); - var fooAdoc = new FilePath("foo.adoc"); - var barAdoc = new FilePath("bar.adoc"); - var fooBar = new KeyValuePair("foo", "bar"); - var bimBam = new KeyValuePair("bim", "bam"); - yield return (s => s.WithTemplateEngine("some-engine"), s => s.TemplateEngine, "some-engine"); - yield return (s => s.WithTemplateDir(fooDir), s => s.TemplateDir, fooDir); - yield return (s => s.WithOutputFile(fooPdf), s => s.Output, fooPdf); - yield return (s => s.WithLoadPath(fooDir), s => s.LoadPath, new[] { fooDir }); - yield return (s => s.WithLoadPaths(new[] { fooDir, barDir }), s => s.LoadPath, new[] { fooDir, barDir }); - yield return (s => s.WithDestinationDir(fooDir), s => s.DestinationDir, fooDir); - yield return (s => s.WithClassPath(fooDir), s => s.ClassPath, new[] { fooDir }); - yield return (s => s.WithClassPaths(new[] { fooDir, barDir }), s => s.ClassPath, new[] { fooDir, barDir }); - yield return (s => s.WithBaseDir(fooDir), s => s.BaseDir, fooDir); - yield return (s => s.WithBackend("pdf"), s => s.Backend, "pdf"); - yield return (s => s.WithBuiltinBackend(BuiltinBackend.Html), s => s.Backend, "html"); - yield return (s => s.WithAttribute(fooBar.Key, fooBar.Value), s => s.Attributes, new[] { fooBar }); - yield return (s => s.WithAttributes(new[] { fooBar, bimBam }), s => s.Attributes, new[] { fooBar, bimBam }); - yield return (s => s.WithInputFile(fooAdoc), s => s.InputFiles, new[] { fooAdoc }); - yield return (s => s.WithInputFiles(new[] { fooAdoc, barAdoc }), s => s.InputFiles, new[] { fooAdoc, barAdoc }); - } - - public IEnumerator GetEnumerator() - { - return GetTestData().Select(x => new[] { x.Item1, x.Item2, x.Item3 }).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + // flags + yield return s => s.WithVersion(); + yield return s => s.WithVerbose(); + yield return s => s.WithTimingsMode(); + yield return s => s.WithSectionNumbers(); + yield return s => s.WithRequire(); + yield return s => s.WithQuiet(); + yield return s => s.WithSuppressHeaderAndFooter(); + yield return s => s.WithCompact(); + + // args + yield return s => s.WithSafeMode(SafeMode.Safe); + yield return s => s.WithERuby(ERuby.Erubis); + yield return s => s.WithDocType(DocType.Inline); + yield return s => s.WithTemplateEngine("some-engine"); + yield return s => s.WithTemplateDir(new DirectoryPath("/foo")); + yield return s => s.WithOutputFile(new FilePath("/foo.pdf")); + yield return s => s.WithLoadPath(new DirectoryPath("/foo")); + yield return s => s.WithLoadPaths(new[] { new DirectoryPath("/foo"), new DirectoryPath("/bar") }); + yield return s => s.WithDestinationDir(new DirectoryPath("/foo")); + yield return s => s.WithClassPath(new DirectoryPath("/foo")); + yield return s => s.WithClassPaths(new[] { new DirectoryPath("/foo"), new DirectoryPath("/bar") }); + yield return s => s.WithBaseDir(new DirectoryPath("/foo")); + yield return s => s.WithBuiltinBackend(BuiltinBackend.Html); + yield return s => s.WithBackend("pdf"); + yield return s => s.WithAttribute("foo", "bar"); + yield return s => s.WithAttributes(new Dictionary { { "foo", "bar" }, { "bim", "bam" } }); + yield return s => s.WithInputFile(new FilePath("/foo.adoc")); + yield return s => s.WithInputFiles(new[] { new FilePath("/foo.adoc"), new FilePath("/bar.adoc") }); } - private class RetValTestData : IEnumerable + public IEnumerator GetEnumerator() { - private IEnumerable> GetTestData() - { - // flags - yield return s => s.WithVersion(); - yield return s => s.WithVerbose(); - yield return s => s.WithTimingsMode(); - yield return s => s.WithSectionNumbers(); - yield return s => s.WithRequire(); - yield return s => s.WithQuiet(); - yield return s => s.WithSuppressHeaderAndFooter(); - yield return s => s.WithCompact(); - - // args - yield return s => s.WithSafeMode(SafeMode.Safe); - yield return s => s.WithERuby(ERuby.Erubis); - yield return s => s.WithDocType(DocType.Inline); - yield return s => s.WithTemplateEngine("some-engine"); - yield return s => s.WithTemplateDir(new DirectoryPath("/foo")); - yield return s => s.WithOutputFile(new FilePath("/foo.pdf")); - yield return s => s.WithLoadPath(new DirectoryPath("/foo")); - yield return s => s.WithLoadPaths(new[] { new DirectoryPath("/foo"), new DirectoryPath("/bar") }); - yield return s => s.WithDestinationDir(new DirectoryPath("/foo")); - yield return s => s.WithClassPath(new DirectoryPath("/foo")); - yield return s => s.WithClassPaths(new[] { new DirectoryPath("/foo"), new DirectoryPath("/bar") }); - yield return s => s.WithBaseDir(new DirectoryPath("/foo")); - yield return s => s.WithBuiltinBackend(BuiltinBackend.Html); - yield return s => s.WithBackend("pdf"); - yield return s => s.WithAttribute("foo", "bar"); - yield return s => s.WithAttributes(new Dictionary { { "foo", "bar" }, { "bim", "bam" } }); - yield return s => s.WithInputFile(new FilePath("/foo.adoc")); - yield return s => s.WithInputFiles(new[] { new FilePath("/foo.adoc"), new FilePath("/bar.adoc") }); - } - - public IEnumerator GetEnumerator() - { - return GetTestData().Select(x => new[] { (object)x }).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + return GetTestData().Select(x => new[] { (object)x }).GetEnumerator(); } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } } diff --git a/src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs b/src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs index 1e044e77..ec040db0 100644 --- a/src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs +++ b/src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs @@ -1,77 +1,82 @@ using Shouldly; + using Xunit; + using System.Collections; using System.Collections.Generic; using System; + using Cake.AsciiDoctorJ.Tests.Fixtures; + using System.Linq; + using Cake.Core.IO; -namespace Cake.AsciiDoctorJ.Tests +namespace Cake.AsciiDoctorJ.Tests; + +public class SettingsTests { - public class SettingsTests + [Theory] + [ClassData(typeof(TestData))] + public void Should_convert_all_setters_to_arguments(Action setFlag, + string expectedParam) + { + var fixture = new AsciiDoctorJRunnerSettingsExtensionsFixture(); + var sut = new AsciiDoctorJRunnerSettings(); + + setFlag(sut); + + var actual = fixture.EvaluateArgs(sut); + actual.ShouldContain(expectedParam); + } + + private class TestData : IEnumerable { - [Theory] - [ClassData(typeof(TestData))] - public void Should_convert_all_setters_to_arguments(Action setFlag, string expectedParam) + private IEnumerable<(Action, string)> GetTestData() { - var fixture = new AsciiDoctorJRunnerSettingsExtensionsFixture(); - var sut = new AsciiDoctorJRunnerSettings(); + // flags + yield return (s => s.Version = true, "--version"); + yield return (s => s.Verbose = true, "--verbose"); + yield return (s => s.TimingsMode = true, "--timings"); + yield return (s => s.SectionNumbers = true, "--section-numbers"); + yield return (s => s.Require = true, "--require"); + yield return (s => s.Quiet = true, "--quiet"); + yield return (s => s.SuppressHeaderAndFooter = true, "--no-header-footer"); + yield return (s => s.Compact = true, "--compact"); - setFlag(sut); + // safemode-arg + yield return (s => s.SafeMode = SafeMode.Safe, "--safe-mode safe"); + yield return (s => s.SafeMode = SafeMode.Unsafe, "--safe-mode unsafe"); + yield return (s => s.SafeMode = SafeMode.Secure, "--safe-mode secure"); + yield return (s => s.SafeMode = SafeMode.Server, "--safe-mode server"); - var actual = fixture.EvaluateArgs(sut); - actual.ShouldContain(expectedParam); + // eruby-arg + yield return (s => s.ERuby = ERuby.Erb, "--eruby erb"); + yield return (s => s.ERuby = ERuby.Erubis, "--eruby erubis"); + + // doctype-arg + yield return (s => s.DocType = DocType.Article, "--doctype article"); + yield return (s => s.DocType = DocType.Book, "--doctype book"); + yield return (s => s.DocType = DocType.Inline, "--doctype inline"); + + // misc args + yield return (s => s.TemplateEngine = "some-engine", "--template-engine some-engine"); + yield return (s => s.TemplateDir = new DirectoryPath("/foo"), "--template-dir \"/foo\""); + yield return (s => s.Output = new FilePath("/foo.pdf"), "--out-file \"/foo.pdf\""); + yield return (s => s.LoadPath.Add(new DirectoryPath("/foo")), "--load-path \"/foo\""); + yield return (s => s.DestinationDir = new DirectoryPath("/foo"), "--destination-dir \"/foo\""); + yield return (s => s.ClassPath.Add(new DirectoryPath("/foo")), "--classpath \"/foo\""); + yield return (s => s.BaseDir = new DirectoryPath("/foo"), "--base-dir \"/foo\""); + yield return (s => s.Backend = "pdf", "--backend pdf"); + yield return (s => s.Attributes.Add("foo", "bar"), "--attribute foo=bar"); + yield return (s => s.InputFiles.Add(new FilePath("/foo.adoc")), "\"/foo.adoc\""); } - private class TestData : IEnumerable + public IEnumerator GetEnumerator() { - private IEnumerable<(Action, string)> GetTestData() - { - // flags - yield return (s => s.Version = true, "--version"); - yield return (s => s.Verbose = true, "--verbose"); - yield return (s => s.TimingsMode = true, "--timings"); - yield return (s => s.SectionNumbers = true, "--section-numbers"); - yield return (s => s.Require = true, "--require"); - yield return (s => s.Quiet = true, "--quiet"); - yield return (s => s.SuppressHeaderAndFooter = true, "--no-header-footer"); - yield return (s => s.Compact = true, "--compact"); - - // safemode-arg - yield return (s => s.SafeMode = SafeMode.Safe, "--safe-mode safe"); - yield return (s => s.SafeMode = SafeMode.Unsafe, "--safe-mode unsafe"); - yield return (s => s.SafeMode = SafeMode.Secure, "--safe-mode secure"); - yield return (s => s.SafeMode = SafeMode.Server, "--safe-mode server"); - - // eruby-arg - yield return (s => s.ERuby = ERuby.Erb, "--eruby erb"); - yield return (s => s.ERuby = ERuby.Erubis, "--eruby erubis"); - - // doctype-arg - yield return (s => s.DocType = DocType.Article, "--doctype article"); - yield return (s => s.DocType = DocType.Book, "--doctype book"); - yield return (s => s.DocType = DocType.Inline, "--doctype inline"); - - // misc args - yield return (s => s.TemplateEngine = "some-engine", "--template-engine some-engine"); - yield return (s => s.TemplateDir = new DirectoryPath("/foo"), "--template-dir \"/foo\""); - yield return (s => s.Output = new FilePath("/foo.pdf"), "--out-file \"/foo.pdf\""); - yield return (s => s.LoadPath.Add(new DirectoryPath("/foo")), "--load-path \"/foo\""); - yield return (s => s.DestinationDir = new DirectoryPath("/foo"), "--destination-dir \"/foo\""); - yield return (s => s.ClassPath.Add(new DirectoryPath("/foo")), "--classpath \"/foo\""); - yield return (s => s.BaseDir = new DirectoryPath("/foo"), "--base-dir \"/foo\""); - yield return (s => s.Backend = "pdf", "--backend pdf"); - yield return (s => s.Attributes.Add("foo", "bar"), "--attribute foo=bar"); - yield return (s => s.InputFiles.Add(new FilePath("/foo.adoc")), "\"/foo.adoc\""); - } - - public IEnumerator GetEnumerator() - { - return GetTestData().Select(x => new[] { (object)x.Item1, x.Item2 }).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + return GetTestData().Select(x => new[] { (object)x.Item1, x.Item2 }).GetEnumerator(); } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } } diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs index a6d84c54..2fe3ac06 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs @@ -3,96 +3,95 @@ using Cake.Core; using Cake.Core.Annotations; -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// Functions to call AsciiDoctorJ. +/// +/// In order to use this add-in, add the following to your build.cake. +/// +/// +/// +[CakeAliasCategory("asciidoctorj")] +public static class AsciiDoctorJAliases { /// - /// Functions to call AsciiDoctorJ. - /// - /// In order to use this add-in, add the following to your build.cake. - /// - /// + /// Runs the tool using an action to configure settings. /// - [CakeAliasCategory("asciidoctorj")] - public static class AsciiDoctorJAliases + /// The . + /// An action to configure the . + /// + /// + /// + /// { + /// AsciiDoctorJ(s => s + /// .WithVerbose() + /// .WithDocType(DocType.Article) + /// .WithBackend("pdf") + /// .WithInputFile(file) + /// .WithDestinationDir(distDir)); + /// }); + /// ]]> + /// + /// + [CakeMethodAlias] + [CakeAliasCategory("AsciiDoctorJ")] + public static void AsciiDoctorJ( + this ICakeContext context, + Action? configure = null) { - /// - /// Runs the tool using an action to configure settings. - /// - /// The . - /// An action to configure the . - /// - /// - /// - /// { - /// AsciiDoctorJ(s => s - /// .WithVerbose() - /// .WithDocType(DocType.Article) - /// .WithBackend("pdf") - /// .WithInputFile(file) - /// .WithDestinationDir(distDir)); - /// }); - /// ]]> - /// - /// - [CakeMethodAlias] - [CakeAliasCategory("AsciiDoctorJ")] - public static void AsciiDoctorJ( - this ICakeContext context, - Action? configure = null) + if (context == null) { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - var runner = new AsciiDoctorJRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); - runner.Run(configure); + throw new ArgumentNullException(nameof(context)); } - /// - /// Runs the tool using the given . - /// - /// The . - /// The . - /// /// - /// - /// - /// { - /// AsciiDoctorJ(new AsciiDoctorJRunnerSettings { - /// Verbose = true, - /// DocType = DocType.Article, - /// Backend = "pdf", - /// InputFiles = new[]{ file }, - /// DestinationDir = distDir - /// }); - /// }); - /// ]]> - /// - /// - [CakeMethodAlias] - [CakeAliasCategory("AsciiDoctorJ")] - public static void AsciiDoctorJ( - this ICakeContext context, - AsciiDoctorJRunnerSettings settings) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } + var runner = new AsciiDoctorJRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); + runner.Run(configure); + } - if (settings == null) - { - throw new ArgumentNullException(nameof(settings)); - } + /// + /// Runs the tool using the given . + /// + /// The . + /// The . + /// /// + /// + /// + /// { + /// AsciiDoctorJ(new AsciiDoctorJRunnerSettings { + /// Verbose = true, + /// DocType = DocType.Article, + /// Backend = "pdf", + /// InputFiles = new[]{ file }, + /// DestinationDir = distDir + /// }); + /// }); + /// ]]> + /// + /// + [CakeMethodAlias] + [CakeAliasCategory("AsciiDoctorJ")] + public static void AsciiDoctorJ( + this ICakeContext context, + AsciiDoctorJRunnerSettings settings) + { + if (context == null) + { + throw new ArgumentNullException(nameof(context)); + } - var runner = new AsciiDoctorJRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); - runner.Run(settings); + if (settings == null) + { + throw new ArgumentNullException(nameof(settings)); } + + var runner = new AsciiDoctorJRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); + runner.Run(settings); } -} +} \ No newline at end of file diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs index 0b2cc396..343ccdcf 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs @@ -7,62 +7,61 @@ [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Cake.AsciiDoctorJ.Tests")] -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// This is the runner. . +/// +internal class AsciiDoctorJRunner : Tool { + private readonly ICakeEnvironment environment; + /// - /// This is the runner. . + /// Initializes a new instance of the class. + /// . /// - internal class AsciiDoctorJRunner : Tool + /// The . + /// The . + /// The . + /// The . + internal AsciiDoctorJRunner(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools) + : base(fileSystem, environment, processRunner, tools) { - private readonly ICakeEnvironment environment; - - /// - /// Initializes a new instance of the class. - /// . - /// - /// The . - /// The . - /// The . - /// The . - internal AsciiDoctorJRunner(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools) - : base(fileSystem, environment, processRunner, tools) - { - this.environment = environment; - } + this.environment = environment; + } - /// - /// Runs the tool using an action to configure settings. - /// - /// The configuration action. - /// The settings. - internal void Run(Action? configure = null, AsciiDoctorJRunnerSettings? settings = null) - { - settings ??= new AsciiDoctorJRunnerSettings(); + /// + /// Runs the tool using an action to configure settings. + /// + /// The configuration action. + /// The settings. + internal void Run(Action? configure = null, AsciiDoctorJRunnerSettings? settings = null) + { + settings ??= new AsciiDoctorJRunnerSettings(); - configure?.Invoke(settings); - Run(settings); - } + configure?.Invoke(settings); + Run(settings); + } - /// - /// Runs the tool. - /// - /// The settings. - internal void Run(AsciiDoctorJRunnerSettings settings) + /// + /// Runs the tool. + /// + /// The settings. + internal void Run(AsciiDoctorJRunnerSettings settings) + { + if (settings == null) { - if (settings == null) - { - throw new ArgumentNullException(nameof(settings)); - } - - var args = new ProcessArgumentBuilder(); - settings.Evaluate(args, environment); - Run(settings, args); + throw new ArgumentNullException(nameof(settings)); } - /// - protected override string GetToolName() => "AsciiDoctorJ Runner"; - - /// - protected override IEnumerable GetToolExecutableNames() => new[] { "asciidoctorj.exe", "asciidoctorj" }; + var args = new ProcessArgumentBuilder(); + settings.Evaluate(args, environment); + Run(settings, args); } -} + + /// + protected override string GetToolName() => "AsciiDoctorJ Runner"; + + /// + protected override IEnumerable GetToolExecutableNames() => new[] { "asciidoctorj.exe", "asciidoctorj" }; +} \ No newline at end of file diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs index ab4d8d2c..f683b583 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs @@ -5,301 +5,300 @@ using Cake.Core.IO; using Cake.Core.Tooling; -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// The settings to configure the run of AsciiDoctorJ. +/// +public class AsciiDoctorJRunnerSettings : ToolSettings { /// - /// The settings to configure the run of AsciiDoctorJ. + /// Initializes a new instance of the class. /// - public class AsciiDoctorJRunnerSettings : ToolSettings + public AsciiDoctorJRunnerSettings() { - /// - /// Initializes a new instance of the class. - /// - public AsciiDoctorJRunnerSettings() + InputFiles = new List(); + LoadPath = new List(); + ClassPath = new List(); + Attributes = new Dictionary(); + } + + /// + /// Gets or sets a value indicating whether to + /// display the version and runtime environment. + /// Default: false. + /// corresponds to: -V, --version. + /// + public bool Version { get; set; } + + /// + /// Gets or sets a value indicating whether to + /// enable verbose mode. + /// Default: false. + /// corresponds to: -v, --verbose. + /// + public bool Verbose { get; set; } + + /// + /// Gets or sets a value indicating whether to + /// enable timings mode. + /// Default: false. + /// corresponds to: -t, --timings. + /// + public bool TimingsMode { get; set; } + + /// + /// Gets or sets a value indicating the + /// template engine to use for the custom render templates (loads gem on demand). + /// corresponds to: -E, --template-engine. + /// + public string? TemplateEngine { get; set; } + + /// + /// Gets or sets a value indicating the + /// directory containing custom render templates the override the built-in set. + /// corresponds to: -T, --template-dir. + /// + public DirectoryPath? TemplateDir { get; set; } + + /// + /// Gets or sets a value indicating whether to + /// auto-number section titles in the HTML backend. + /// Default: false. + /// corresponds to: -n, --section-numbers. + /// + public bool SectionNumbers { get; set; } + + /// + /// Gets or sets a value to + /// set safe mode level explicitly: [unsafe, safe, server, secure]. + /// Default: UNSAFE. + /// corresponds to: -S, --safe-mode. + /// + public SafeMode? SafeMode { get; set; } + + /// + /// Gets or sets a value indicating whether to + /// require the specified library before executing the processor. + /// corresponds to: -r, --require. + /// + public bool Require { get; set; } + + /// + /// Gets or sets a value indicating whether to + /// suppress warnings. + /// Default: false. + /// corresponds to: -q, --quiet. + /// + public bool Quiet { get; set; } + + /// + /// Gets or sets a value indicating the + /// output file(default: based on input file path); use - to output to STDOUT. + /// corresponds to: -o, --out-file. + /// + public FilePath? Output { get; set; } + + /// + /// Gets or sets a value indicating whether to + /// suppress output of header and footer. + /// Default: false. + /// corresponds to: -s, --no-header-footer. + /// + public bool SuppressHeaderAndFooter { get; set; } + + /// + /// Gets the list of input files to be processed. + /// + public IList InputFiles { get; } + + /// + /// Gets the list of directories to add to the $LOAD_PATH. + /// corresponds to: -I, --load-path. + /// + public IList LoadPath { get; } + + /// + /// Gets or sets a value to + /// specify eRuby implementation to render built-in templates: [erb, erubis]. + /// Default: erb. + /// corresponds to: -e, --eruby. + /// + public ERuby? ERuby { get; set; } + + /// + /// Gets or sets a value indicating the + /// document type to use when rendering output: [article, book, inline]. + /// Default: article. + /// corresponds to: -d, --doctype. + /// + public DocType? DocType { get; set; } + + /// + /// Gets or sets a value indicating the + /// destination output directory. + /// Default: Directory of source file. + /// corresponds to: -D, --destination-dir. + /// + public DirectoryPath? DestinationDir { get; set; } + + /// + /// Gets or sets a value indicating whether to + /// compact the output by removing blank lines. + /// Default: false. + /// corresponds to: -C, --compact. + /// + public bool Compact { get; set; } + + /// + /// Gets the list of directories to add to the classpath. + /// corresponds to: -cp, -classpath, --classpath. + /// + public IList ClassPath { get; } + + /// + /// Gets or sets a value indicating the + /// base directory containing the document and resources. + /// Default: directory of source file. + /// corresponds to: -B, --base-dir. + /// + public DirectoryPath? BaseDir { get; set; } + + /// + /// Gets or sets a value indicating whether to + /// set output format backend. + /// Default: html5. + /// corresponds to: -b, --backend. + /// + public string? Backend { get; set; } + + /// + /// Gets the list of attributes to set on the document. + /// Default: []. + /// corresponds to: -a, --attribute. + /// + public IDictionary Attributes { get; } + + /// + /// Processes the given settings and modifies the . + /// + /// The to modify. + /// The . + internal void Evaluate(ProcessArgumentBuilder args, ICakeEnvironment environment) + { + if (Version) + { + args.Append("--version"); + } + + if (Verbose) + { + args.Append("--verbose"); + } + + if (TimingsMode) + { + args.Append("--timings"); + } + + if (!string.IsNullOrEmpty(TemplateEngine)) + { + args.Append("--template-engine " + TemplateEngine); + } + + if (TemplateDir != null) + { + args.Append("--template-dir " + TemplateDir.MakeAbsolute(environment).FullPath.Quote()); + } + + if (SectionNumbers) + { + args.Append("--section-numbers"); + } + + if (SafeMode.HasValue) + { + // ReSharper disable PossibleNullReferenceException + args.Append("--safe-mode " + Enum.GetName(typeof(SafeMode), SafeMode.Value) !.ToLowerInvariant()); + + // ReSharper enable PossibleNullReferenceException + } + + if (Require) + { + args.Append("--require"); + } + + if (Quiet) + { + args.Append("--quiet"); + } + + if (Output != null) + { + args.Append("--out-file " + Output.MakeAbsolute(environment).FullPath.Quote()); + } + + if (SuppressHeaderAndFooter) + { + args.Append("--no-header-footer"); + } + + foreach (var p in LoadPath) + { + args.Append("--load-path " + p.MakeAbsolute(environment).FullPath.Quote()); + } + + if (ERuby.HasValue) + { + // ReSharper disable PossibleNullReferenceException + args.Append("--eruby " + Enum.GetName(typeof(ERuby), ERuby.Value) !.ToLowerInvariant()); + + // ReSharper enable PossibleNullReferenceException + } + + if (DocType.HasValue) + { + args.Append("--doctype " + Enum.GetName(typeof(DocType), DocType.Value) !.ToLowerInvariant()); + } + + if (DestinationDir != null) + { + // ReSharper disable PossibleNullReferenceException + args.Append("--destination-dir " + DestinationDir.MakeAbsolute(environment).FullPath.Quote()); + + // ReSharper enable PossibleNullReferenceException + } + + if (Compact) + { + args.Append("--compact"); + } + + foreach (var p in ClassPath) + { + args.Append("--classpath " + p.MakeAbsolute(environment).FullPath.Quote()); + } + + if (BaseDir != null) + { + args.Append("--base-dir " + BaseDir.MakeAbsolute(environment).FullPath.Quote()); + } + + if (!string.IsNullOrEmpty(Backend)) + { + args.Append("--backend " + Backend); + } + + foreach ((string key, string value) in Attributes) { - InputFiles = new List(); - LoadPath = new List(); - ClassPath = new List(); - Attributes = new Dictionary(); + args.Append($"--attribute {key}={value}"); } - /// - /// Gets or sets a value indicating whether to - /// display the version and runtime environment. - /// Default: false. - /// corresponds to: -V, --version. - /// - public bool Version { get; set; } - - /// - /// Gets or sets a value indicating whether to - /// enable verbose mode. - /// Default: false. - /// corresponds to: -v, --verbose. - /// - public bool Verbose { get; set; } - - /// - /// Gets or sets a value indicating whether to - /// enable timings mode. - /// Default: false. - /// corresponds to: -t, --timings. - /// - public bool TimingsMode { get; set; } - - /// - /// Gets or sets a value indicating the - /// template engine to use for the custom render templates (loads gem on demand). - /// corresponds to: -E, --template-engine. - /// - public string? TemplateEngine { get; set; } - - /// - /// Gets or sets a value indicating the - /// directory containing custom render templates the override the built-in set. - /// corresponds to: -T, --template-dir. - /// - public DirectoryPath? TemplateDir { get; set; } - - /// - /// Gets or sets a value indicating whether to - /// auto-number section titles in the HTML backend. - /// Default: false. - /// corresponds to: -n, --section-numbers. - /// - public bool SectionNumbers { get; set; } - - /// - /// Gets or sets a value to - /// set safe mode level explicitly: [unsafe, safe, server, secure]. - /// Default: UNSAFE. - /// corresponds to: -S, --safe-mode. - /// - public SafeMode? SafeMode { get; set; } - - /// - /// Gets or sets a value indicating whether to - /// require the specified library before executing the processor. - /// corresponds to: -r, --require. - /// - public bool Require { get; set; } - - /// - /// Gets or sets a value indicating whether to - /// suppress warnings. - /// Default: false. - /// corresponds to: -q, --quiet. - /// - public bool Quiet { get; set; } - - /// - /// Gets or sets a value indicating the - /// output file(default: based on input file path); use - to output to STDOUT. - /// corresponds to: -o, --out-file. - /// - public FilePath? Output { get; set; } - - /// - /// Gets or sets a value indicating whether to - /// suppress output of header and footer. - /// Default: false. - /// corresponds to: -s, --no-header-footer. - /// - public bool SuppressHeaderAndFooter { get; set; } - - /// - /// Gets the list of input files to be processed. - /// - public IList InputFiles { get; } - - /// - /// Gets the list of directories to add to the $LOAD_PATH. - /// corresponds to: -I, --load-path. - /// - public IList LoadPath { get; } - - /// - /// Gets or sets a value to - /// specify eRuby implementation to render built-in templates: [erb, erubis]. - /// Default: erb. - /// corresponds to: -e, --eruby. - /// - public ERuby? ERuby { get; set; } - - /// - /// Gets or sets a value indicating the - /// document type to use when rendering output: [article, book, inline]. - /// Default: article. - /// corresponds to: -d, --doctype. - /// - public DocType? DocType { get; set; } - - /// - /// Gets or sets a value indicating the - /// destination output directory. - /// Default: Directory of source file. - /// corresponds to: -D, --destination-dir. - /// - public DirectoryPath? DestinationDir { get; set; } - - /// - /// Gets or sets a value indicating whether to - /// compact the output by removing blank lines. - /// Default: false. - /// corresponds to: -C, --compact. - /// - public bool Compact { get; set; } - - /// - /// Gets the list of directories to add to the classpath. - /// corresponds to: -cp, -classpath, --classpath. - /// - public IList ClassPath { get; } - - /// - /// Gets or sets a value indicating the - /// base directory containing the document and resources. - /// Default: directory of source file. - /// corresponds to: -B, --base-dir. - /// - public DirectoryPath? BaseDir { get; set; } - - /// - /// Gets or sets a value indicating whether to - /// set output format backend. - /// Default: html5. - /// corresponds to: -b, --backend. - /// - public string? Backend { get; set; } - - /// - /// Gets the list of attributes to set on the document. - /// Default: []. - /// corresponds to: -a, --attribute. - /// - public IDictionary Attributes { get; } - - /// - /// Processes the given settings and modifies the . - /// - /// The to modify. - /// The . - internal void Evaluate(ProcessArgumentBuilder args, ICakeEnvironment environment) + // input is last! + foreach (var f in InputFiles) { - if (Version) - { - args.Append("--version"); - } - - if (Verbose) - { - args.Append("--verbose"); - } - - if (TimingsMode) - { - args.Append("--timings"); - } - - if (!string.IsNullOrEmpty(TemplateEngine)) - { - args.Append("--template-engine " + TemplateEngine); - } - - if (TemplateDir != null) - { - args.Append("--template-dir " + TemplateDir.MakeAbsolute(environment).FullPath.Quote()); - } - - if (SectionNumbers) - { - args.Append("--section-numbers"); - } - - if (SafeMode.HasValue) - { - // ReSharper disable PossibleNullReferenceException - args.Append("--safe-mode " + Enum.GetName(typeof(SafeMode), SafeMode.Value) !.ToLowerInvariant()); - - // ReSharper enable PossibleNullReferenceException - } - - if (Require) - { - args.Append("--require"); - } - - if (Quiet) - { - args.Append("--quiet"); - } - - if (Output != null) - { - args.Append("--out-file " + Output.MakeAbsolute(environment).FullPath.Quote()); - } - - if (SuppressHeaderAndFooter) - { - args.Append("--no-header-footer"); - } - - foreach (var p in LoadPath) - { - args.Append("--load-path " + p.MakeAbsolute(environment).FullPath.Quote()); - } - - if (ERuby.HasValue) - { - // ReSharper disable PossibleNullReferenceException - args.Append("--eruby " + Enum.GetName(typeof(ERuby), ERuby.Value) !.ToLowerInvariant()); - - // ReSharper enable PossibleNullReferenceException - } - - if (DocType.HasValue) - { - args.Append("--doctype " + Enum.GetName(typeof(DocType), DocType.Value) !.ToLowerInvariant()); - } - - if (DestinationDir != null) - { - // ReSharper disable PossibleNullReferenceException - args.Append("--destination-dir " + DestinationDir.MakeAbsolute(environment).FullPath.Quote()); - - // ReSharper enable PossibleNullReferenceException - } - - if (Compact) - { - args.Append("--compact"); - } - - foreach (var p in ClassPath) - { - args.Append("--classpath " + p.MakeAbsolute(environment).FullPath.Quote()); - } - - if (BaseDir != null) - { - args.Append("--base-dir " + BaseDir.MakeAbsolute(environment).FullPath.Quote()); - } - - if (!string.IsNullOrEmpty(Backend)) - { - args.Append("--backend " + Backend); - } - - foreach ((string key, string value) in Attributes) - { - args.Append($"--attribute {key}={value}"); - } - - // input is last! - foreach (var f in InputFiles) - { - args.Append(f.MakeAbsolute(environment).FullPath.Quote()); - } + args.Append(f.MakeAbsolute(environment).FullPath.Quote()); } } -} +} \ No newline at end of file diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs index 2442be9c..6ff7f714 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs @@ -3,342 +3,341 @@ using Cake.Core.IO; -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// Extensions for fluent writing of . +/// +public static class AsciiDoctorJRunnerSettingsExtensions { /// - /// Extensions for fluent writing of . + /// Add a list of files to . /// - public static class AsciiDoctorJRunnerSettingsExtensions + /// The that extended by this. + /// The list of files to add to . + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithInputFiles(this AsciiDoctorJRunnerSettings @this, IEnumerable files) { - /// - /// Add a list of files to . - /// - /// The that extended by this. - /// The list of files to add to . - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithInputFiles(this AsciiDoctorJRunnerSettings @this, IEnumerable files) + foreach (var f in files) { - foreach (var f in files) - { - @this.InputFiles.Add(f); - } - - return @this; + @this.InputFiles.Add(f); } - /// - /// Add a single File to . - /// - /// The that extended by this. - /// The file to add to . - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithInputFile(this AsciiDoctorJRunnerSettings @this, FilePath file) - { - @this.InputFiles.Add(file); - return @this; - } + return @this; + } - /// - /// Set to true. - /// - /// The that extended by this. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithVersion(this AsciiDoctorJRunnerSettings @this) - { - @this.Version = true; - return @this; - } + /// + /// Add a single File to . + /// + /// The that extended by this. + /// The file to add to . + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithInputFile(this AsciiDoctorJRunnerSettings @this, FilePath file) + { + @this.InputFiles.Add(file); + return @this; + } - /// - /// set to true. - /// - /// The that extended by this. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithVerbose(this AsciiDoctorJRunnerSettings @this) - { - @this.Verbose = true; - return @this; - } + /// + /// Set to true. + /// + /// The that extended by this. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithVersion(this AsciiDoctorJRunnerSettings @this) + { + @this.Version = true; + return @this; + } - /// - /// set to true. - /// - /// The that extended by this. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithTimingsMode(this AsciiDoctorJRunnerSettings @this) - { - @this.TimingsMode = true; - return @this; - } + /// + /// set to true. + /// + /// The that extended by this. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithVerbose(this AsciiDoctorJRunnerSettings @this) + { + @this.Verbose = true; + return @this; + } - /// - /// Set the . - /// - /// The that extended by this. - /// The name of the template-engine to use. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithTemplateEngine(this AsciiDoctorJRunnerSettings @this, string engine) - { - @this.TemplateEngine = engine; - return @this; - } + /// + /// set to true. + /// + /// The that extended by this. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithTimingsMode(this AsciiDoctorJRunnerSettings @this) + { + @this.TimingsMode = true; + return @this; + } - /// - /// Set the . - /// - /// The that extended by this. - /// The directory to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithTemplateDir(this AsciiDoctorJRunnerSettings @this, DirectoryPath dir) - { - @this.TemplateDir = dir; - return @this; - } + /// + /// Set the . + /// + /// The that extended by this. + /// The name of the template-engine to use. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithTemplateEngine(this AsciiDoctorJRunnerSettings @this, string engine) + { + @this.TemplateEngine = engine; + return @this; + } - /// - /// Set to true. - /// - /// The that extended by this. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithSectionNumbers(this AsciiDoctorJRunnerSettings @this) - { - @this.SectionNumbers = true; - return @this; - } + /// + /// Set the . + /// + /// The that extended by this. + /// The directory to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithTemplateDir(this AsciiDoctorJRunnerSettings @this, DirectoryPath dir) + { + @this.TemplateDir = dir; + return @this; + } - /// - /// Set - /// For possible values . - /// - /// The that extended by this. - /// The to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithSafeMode(this AsciiDoctorJRunnerSettings @this, SafeMode mode) - { - @this.SafeMode = mode; - return @this; - } + /// + /// Set to true. + /// + /// The that extended by this. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithSectionNumbers(this AsciiDoctorJRunnerSettings @this) + { + @this.SectionNumbers = true; + return @this; + } - /// - /// Set to true. - /// - /// The that extended by this. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithRequire(this AsciiDoctorJRunnerSettings @this) - { - @this.Require = true; - return @this; - } + /// + /// Set + /// For possible values . + /// + /// The that extended by this. + /// The to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithSafeMode(this AsciiDoctorJRunnerSettings @this, SafeMode mode) + { + @this.SafeMode = mode; + return @this; + } - /// - /// Set to true. - /// - /// The that extended by this. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithQuiet(this AsciiDoctorJRunnerSettings @this) - { - @this.Quiet = true; - return @this; - } + /// + /// Set to true. + /// + /// The that extended by this. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithRequire(this AsciiDoctorJRunnerSettings @this) + { + @this.Require = true; + return @this; + } - /// - /// Set the . - /// - /// The that extended by this. - /// the to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithOutputFile(this AsciiDoctorJRunnerSettings @this, FilePath output) - { - @this.Output = output; - return @this; - } + /// + /// Set to true. + /// + /// The that extended by this. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithQuiet(this AsciiDoctorJRunnerSettings @this) + { + @this.Quiet = true; + return @this; + } + + /// + /// Set the . + /// + /// The that extended by this. + /// the to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithOutputFile(this AsciiDoctorJRunnerSettings @this, FilePath output) + { + @this.Output = output; + return @this; + } + + /// + /// Set to true. + /// + /// The that extended by this. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithSuppressHeaderAndFooter(this AsciiDoctorJRunnerSettings @this) + { + @this.SuppressHeaderAndFooter = true; + return @this; + } - /// - /// Set to true. - /// - /// The that extended by this. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithSuppressHeaderAndFooter(this AsciiDoctorJRunnerSettings @this) + /// + /// Adds multiple paths to . + /// + /// The that extended by this. + /// The list of directories to add to . + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithLoadPaths(this AsciiDoctorJRunnerSettings @this, IEnumerable paths) + { + foreach (var p in paths) { - @this.SuppressHeaderAndFooter = true; - return @this; + @this.LoadPath.Add(p); } - /// - /// Adds multiple paths to . - /// - /// The that extended by this. - /// The list of directories to add to . - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithLoadPaths(this AsciiDoctorJRunnerSettings @this, IEnumerable paths) - { - foreach (var p in paths) - { - @this.LoadPath.Add(p); - } + return @this; + } - return @this; - } + /// + /// Adds one path to . + /// + /// The that extended by this. + /// The directory to add to . + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithLoadPath(this AsciiDoctorJRunnerSettings @this, DirectoryPath path) + { + @this.LoadPath.Add(path); + return @this; + } - /// - /// Adds one path to . - /// - /// The that extended by this. - /// The directory to add to . - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithLoadPath(this AsciiDoctorJRunnerSettings @this, DirectoryPath path) - { - @this.LoadPath.Add(path); - return @this; - } + /// + /// Sets + /// Possible values . + /// + /// The that extended by this. + /// The to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithERuby(this AsciiDoctorJRunnerSettings @this, ERuby eRuby) + { + @this.ERuby = eRuby; + return @this; + } - /// - /// Sets - /// Possible values . - /// - /// The that extended by this. - /// The to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithERuby(this AsciiDoctorJRunnerSettings @this, ERuby eRuby) - { - @this.ERuby = eRuby; - return @this; - } + /// + /// Sets the + /// Possible Values . + /// + /// The that extended by this. + /// The to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithDocType(this AsciiDoctorJRunnerSettings @this, DocType docType) + { + @this.DocType = docType; + return @this; + } - /// - /// Sets the - /// Possible Values . - /// - /// The that extended by this. - /// The to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithDocType(this AsciiDoctorJRunnerSettings @this, DocType docType) - { - @this.DocType = docType; - return @this; - } + /// + /// Sets the . + /// + /// The that extended by this. + /// the to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithDestinationDir(this AsciiDoctorJRunnerSettings @this, DirectoryPath dir) + { + @this.DestinationDir = dir; + return @this; + } - /// - /// Sets the . - /// - /// The that extended by this. - /// the to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithDestinationDir(this AsciiDoctorJRunnerSettings @this, DirectoryPath dir) - { - @this.DestinationDir = dir; - return @this; - } + /// + /// Sets to true. + /// + /// The that extended by this. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithCompact(this AsciiDoctorJRunnerSettings @this) + { + @this.Compact = true; + return @this; + } - /// - /// Sets to true. - /// - /// The that extended by this. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithCompact(this AsciiDoctorJRunnerSettings @this) + /// + /// Add multiple paths to . + /// + /// The that extended by this. + /// the list of directories to add to . + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithClassPaths(this AsciiDoctorJRunnerSettings @this, IEnumerable paths) + { + foreach (var p in paths) { - @this.Compact = true; - return @this; + @this.ClassPath.Add(p); } - /// - /// Add multiple paths to . - /// - /// The that extended by this. - /// the list of directories to add to . - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithClassPaths(this AsciiDoctorJRunnerSettings @this, IEnumerable paths) - { - foreach (var p in paths) - { - @this.ClassPath.Add(p); - } + return @this; + } - return @this; - } + /// + /// Add one path to . + /// + /// The that extended by this. + /// the directory to add to . + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithClassPath(this AsciiDoctorJRunnerSettings @this, DirectoryPath path) + { + @this.ClassPath.Add(path); + return @this; + } - /// - /// Add one path to . - /// - /// The that extended by this. - /// the directory to add to . - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithClassPath(this AsciiDoctorJRunnerSettings @this, DirectoryPath path) - { - @this.ClassPath.Add(path); - return @this; - } + /// + /// Sets the . + /// + /// The that extended by this. + /// The directory to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithBaseDir(this AsciiDoctorJRunnerSettings @this, DirectoryPath dir) + { + @this.BaseDir = dir; + return @this; + } - /// - /// Sets the . - /// - /// The that extended by this. - /// The directory to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithBaseDir(this AsciiDoctorJRunnerSettings @this, DirectoryPath dir) - { - @this.BaseDir = dir; - return @this; - } + /// + /// Set the + /// Use this only if you need a non-builtin backend (e.g. "pdf") + /// For builtin backends use . + /// + /// The that extended by this. + /// The name of the backend to use. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithBackend(this AsciiDoctorJRunnerSettings @this, string backend) + { + @this.Backend = backend; + return @this; + } - /// - /// Set the - /// Use this only if you need a non-builtin backend (e.g. "pdf") - /// For builtin backends use . - /// - /// The that extended by this. - /// The name of the backend to use. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithBackend(this AsciiDoctorJRunnerSettings @this, string backend) - { - @this.Backend = backend; - return @this; - } + /// + /// Set the to a builtin backend. + /// Possible values are . + /// For non-builtin backends (i.e. plugins) use . + /// + /// The that extended by this. + /// The to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithBuiltinBackend(this AsciiDoctorJRunnerSettings @this, BuiltinBackend backend) + { + // ReSharper disable PossibleNullReferenceException + @this.Backend = Enum.GetName(typeof(BuiltinBackend), backend) !.ToLowerInvariant(); - /// - /// Set the to a builtin backend. - /// Possible values are . - /// For non-builtin backends (i.e. plugins) use . - /// - /// The that extended by this. - /// The to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithBuiltinBackend(this AsciiDoctorJRunnerSettings @this, BuiltinBackend backend) - { - // ReSharper disable PossibleNullReferenceException - @this.Backend = Enum.GetName(typeof(BuiltinBackend), backend) !.ToLowerInvariant(); + // ReSharper enable PossibleNullReferenceException + return @this; + } - // ReSharper enable PossibleNullReferenceException - return @this; - } + /// + /// Add multiple attributes to . + /// + /// The that extended by this. + /// The key of the attribute to set. + /// The value of the attribute to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithAttribute(this AsciiDoctorJRunnerSettings @this, string key, string value) + { + @this.Attributes[key] = value; + return @this; + } - /// - /// Add multiple attributes to . - /// - /// The that extended by this. - /// The key of the attribute to set. - /// The value of the attribute to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithAttribute(this AsciiDoctorJRunnerSettings @this, string key, string value) + /// + /// Add one attribute to . + /// + /// The that extended by this. + /// The list of key-value-pairs to set. + /// The reference to the . + public static AsciiDoctorJRunnerSettings WithAttributes(this AsciiDoctorJRunnerSettings @this, IEnumerable> attrs) + { + foreach (var kvp in attrs) { - @this.Attributes[key] = value; - return @this; + @this.Attributes[kvp.Key] = kvp.Value; } - /// - /// Add one attribute to . - /// - /// The that extended by this. - /// The list of key-value-pairs to set. - /// The reference to the . - public static AsciiDoctorJRunnerSettings WithAttributes(this AsciiDoctorJRunnerSettings @this, IEnumerable> attrs) - { - foreach (var kvp in attrs) - { - @this.Attributes[kvp.Key] = kvp.Value; - } - - return @this; - } + return @this; } } diff --git a/src/Cake.AsciiDoctorJ/BuiltinBackend.cs b/src/Cake.AsciiDoctorJ/BuiltinBackend.cs index bbae4599..0f60c03e 100644 --- a/src/Cake.AsciiDoctorJ/BuiltinBackend.cs +++ b/src/Cake.AsciiDoctorJ/BuiltinBackend.cs @@ -1,44 +1,43 @@ -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// The builtin backends. Use +/// to use these values to modify . +/// +public enum BuiltinBackend { /// - /// The builtin backends. Use - /// to use these values to modify . + /// html backend /// - public enum BuiltinBackend - { - /// - /// html backend - /// - Html, + Html, - /// - /// html5 backend - /// - Html5, + /// + /// html5 backend + /// + Html5, - /// - /// xhtml backend - /// - Xhtml, + /// + /// xhtml backend + /// + Xhtml, - /// - /// xhtml5 backend - /// - Xhtml5, + /// + /// xhtml5 backend + /// + Xhtml5, - /// - /// docbook backend - /// - DocBook, + /// + /// docbook backend + /// + DocBook, - /// - /// docbook5 backend - /// - DocBook5, + /// + /// docbook5 backend + /// + DocBook5, - /// - /// manpage backend - /// - Manpage, - } + /// + /// manpage backend + /// + Manpage, } diff --git a/src/Cake.AsciiDoctorJ/DocType.cs b/src/Cake.AsciiDoctorJ/DocType.cs index e078d8b7..5dc4299b 100644 --- a/src/Cake.AsciiDoctorJ/DocType.cs +++ b/src/Cake.AsciiDoctorJ/DocType.cs @@ -1,23 +1,22 @@ -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// The document types to use for . +/// +public enum DocType { /// - /// The document types to use for . + /// Article /// - public enum DocType - { - /// - /// Article - /// - Article, + Article, - /// - /// Book - /// - Book, + /// + /// Book + /// + Book, - /// - /// Inline - /// - Inline, - } -} + /// + /// Inline + /// + Inline, +} \ No newline at end of file diff --git a/src/Cake.AsciiDoctorJ/ERuby.cs b/src/Cake.AsciiDoctorJ/ERuby.cs index f7ac07f6..a561fbe7 100644 --- a/src/Cake.AsciiDoctorJ/ERuby.cs +++ b/src/Cake.AsciiDoctorJ/ERuby.cs @@ -1,18 +1,17 @@ -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// The eRuby values to use for . +/// +public enum ERuby { /// - /// The eRuby values to use for . + /// ERB /// - public enum ERuby - { - /// - /// ERB - /// - Erb, + Erb, - /// - /// erubis - /// - Erubis, - } -} + /// + /// erubis + /// + Erubis, +} \ No newline at end of file diff --git a/src/Cake.AsciiDoctorJ/Namespaces.cs b/src/Cake.AsciiDoctorJ/Namespaces.cs index 9dc2f60b..56042bd8 100644 --- a/src/Cake.AsciiDoctorJ/Namespaces.cs +++ b/src/Cake.AsciiDoctorJ/Namespaces.cs @@ -8,15 +8,14 @@ // ReSharper disable UnusedMember.Global // ReSharper disable UnusedType.Global -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// This namespace contain types related to running AsciiDoctorJ. +/// +[CompilerGenerated] +internal class NamespaceDoc { - /// - /// This namespace contain types related to running AsciiDoctorJ. - /// - [CompilerGenerated] - internal class NamespaceDoc - { - } } #pragma warning restore SA1403 // File may only contain a single namespace diff --git a/src/Cake.AsciiDoctorJ/SafeMode.cs b/src/Cake.AsciiDoctorJ/SafeMode.cs index 44a3bc67..0451cd7e 100644 --- a/src/Cake.AsciiDoctorJ/SafeMode.cs +++ b/src/Cake.AsciiDoctorJ/SafeMode.cs @@ -1,28 +1,27 @@ -namespace Cake.AsciiDoctorJ +namespace Cake.AsciiDoctorJ; + +/// +/// The SafeModes values to use with . +/// +public enum SafeMode { /// - /// The SafeModes values to use with . + /// unsafe /// - public enum SafeMode - { - /// - /// unsafe - /// - Unsafe, + Unsafe, - /// - /// safe - /// - Safe, + /// + /// safe + /// + Safe, - /// - /// server - /// - Server, + /// + /// server + /// + Server, - /// - /// secure - /// - Secure, - } -} + /// + /// secure + /// + Secure, +} \ No newline at end of file From 1fcb206b84661ffbec47936dc835f283bd9cc063 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Mon, 3 Jan 2022 00:00:21 +0100 Subject: [PATCH 04/41] (maint) added .git-blame-ignore-revs and exclude the the move to file scoped namespaces from git-blame. --- src/.git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/.git-blame-ignore-revs diff --git a/src/.git-blame-ignore-revs b/src/.git-blame-ignore-revs new file mode 100644 index 00000000..694e77ac --- /dev/null +++ b/src/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# file-scoped-namespaces +d52d4f9cf189ccdb3c9a6a3b002e6717725a254e From ab21c23cf5d8f60343eea9092598a54b1ba97051 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Mon, 3 Jan 2022 00:15:57 +0100 Subject: [PATCH 05/41] (maint) update JetBrains.ReSharper.CommandLineTools to 2021.3.2, to support c# 10. --- .config/dotnet-tools.json | 2 +- recipe.cake | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 38bd0eac..727dfd76 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "0.38.4", + "version": "0.38.5", "commands": [ "dotnet-cake" ] diff --git a/recipe.cake b/recipe.cake index 58cd28c8..9dfb997d 100644 --- a/recipe.cake +++ b/recipe.cake @@ -16,11 +16,42 @@ BuildParameters.SetParameters( appVeyorAccountName: "cakecontrib", shouldRunDotNetCorePack: true, shouldUseDeterministicBuilds: true, + shouldRunDupFinder: false, // dupFinder is discontinued since 2021.3 + shouldRunInspectCode: false, // we're shipping a custom version of it below preferredBuildProviderType: BuildProviderType.GitHubActions, preferredBuildAgentOperatingSystem: PlatformFamily.Linux); BuildParameters.PrintParameters(Context); ToolSettings.SetToolSettings(context: Context); +ToolSettings.SetToolPreprocessorDirectives( + reSharperTools: "#tool nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2021.3.2"); + +// additional workaround for https://github.com/cake-contrib/Cake.Recipe/issues/862 +// to suppress the --build/--no-build warning that is generated in the default +BuildParameters.Tasks.InspectCodeTask = Task("InspectCode2021") + .WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping due to not running on Windows") + .Does(data => RequireTool(ToolSettings.ReSharperTools, () => { + var inspectCodeLogFilePath = BuildParameters.Paths.Directories.InspectCodeTestResults.CombineWithFilePath("inspectcode.xml"); + + var settings = new InspectCodeSettings() { + SolutionWideAnalysis = true, + OutputFile = inspectCodeLogFilePath, + ArgumentCustomization = x => x.Append("--no-build") + }; + + if (FileExists(BuildParameters.SourceDirectoryPath.CombineWithFilePath(BuildParameters.ResharperSettingsFileName))) + { + settings.Profile = BuildParameters.SourceDirectoryPath.CombineWithFilePath(BuildParameters.ResharperSettingsFileName); + } + + InspectCode(BuildParameters.SolutionFilePath, settings); + + // Pass path to InspectCode log file to Cake.Issues.Recipe + IssuesParameters.InputFiles.InspectCodeLogFilePath = inspectCodeLogFilePath; + }) +); +BuildParameters.Tasks.AnalyzeTask.IsDependentOn("InspectCode2021"); +IssuesBuildTasks.ReadIssuesTask.IsDependentOn("InspectCode2021"); Build.RunDotNetCore(); From 0871a02551cfb9739e2e96e0ceb5f35038209f33 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 30 Jan 2022 11:50:12 +0000 Subject: [PATCH 06/41] (maint) Update dependency coverlet.msbuild to v3.1.1 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 8b8d05c4..92af7b27 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From d341fa4c0f2788f171c1b5e237f79c403eed8e72 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 6 Feb 2022 17:08:18 +0000 Subject: [PATCH 07/41] (maint) Update dependency coverlet.msbuild to v3.1.2 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 92af7b27..52917abb 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From caf3f910619ae90296949caabe751b3d02d6c64d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 16 Feb 2022 16:01:17 +0000 Subject: [PATCH 08/41] (maint) Update dependency Microsoft.NET.Test.Sdk to v17.1.0 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 52917abb..e9645ad0 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -15,7 +15,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From c56ac811f3470ba36f75f758754b70f070265105 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 20 Feb 2022 02:28:25 +0000 Subject: [PATCH 09/41] (maint) Update dependency Cake.Testing to v2.1.0 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index e9645ad0..7a06493a 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 7a61e9c1e331568f2972bfb92c26a759b631baef Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 24 Feb 2022 08:29:52 +0000 Subject: [PATCH 10/41] (maint) Update actions/setup-dotnet action to v1.9.1 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca6414f9..d023eb1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v2 - name: Fetch all tags and branches run: git fetch --prune --unshallow - - uses: actions/setup-dotnet@v1.9.0 + - uses: actions/setup-dotnet@v1.9.1 with: dotnet-version: | 2.1.818 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e7473f43..9d3dc0f2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v1.9.0 + - uses: actions/setup-dotnet@v1.9.1 with: dotnet-version: | 2.1.818 From df44065d626f42b11e82f4e117ad251f3877f706 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 25 Feb 2022 09:24:19 +0000 Subject: [PATCH 11/41] (maint) Update actions/setup-dotnet action to v2 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d023eb1d..ec005bc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v2 - name: Fetch all tags and branches run: git fetch --prune --unshallow - - uses: actions/setup-dotnet@v1.9.1 + - uses: actions/setup-dotnet@v2.0.0 with: dotnet-version: | 2.1.818 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9d3dc0f2..377bd184 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v1.9.1 + - uses: actions/setup-dotnet@v2.0.0 with: dotnet-version: | 2.1.818 From d9ec78e72b737645604e33e09cdbd61b8ba6308b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 26 Feb 2022 16:32:23 +0000 Subject: [PATCH 12/41] (maint) Update dependency Moq to v4.17.1 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 7a06493a..59e6ac7f 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all From 7a0aa0bb8c0c2d9519339f086c7774a0938fc439 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 3 Mar 2022 18:04:22 +0000 Subject: [PATCH 13/41] (maint) Update actions/upload-artifact action to v3 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec005bc6..5ae06dd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ jobs: cake-version: 0.38.5 cake-bootstrap: true - name: Upload Issues - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: if-no-files-found: warn name: ${{ matrix.os }} Issues @@ -76,7 +76,7 @@ jobs: BuildArtifacts/report.html BuildArtifacts/**/coverlet/*.xml - name: Upload Packages - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: runner.os == 'Windows' with: if-no-files-found: warn From 6c3713d575f04b621a44ade1a6add6590c661bdf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 4 Mar 2022 20:27:44 +0000 Subject: [PATCH 14/41] (maint) Update actions/checkout action to v3 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/publishDocs.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ae06dd7..db3c9131 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Fetch all tags and branches run: git fetch --prune --unshallow - uses: actions/setup-dotnet@v2.0.0 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 377bd184..de312094 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 diff --git a/.github/workflows/publishDocs.yml b/.github/workflows/publishDocs.yml index cb4eade3..03e1b5c3 100644 --- a/.github/workflows/publishDocs.yml +++ b/.github/workflows/publishDocs.yml @@ -15,7 +15,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Fetch all tags and branches run: git fetch --prune --unshallow From b4062a79016980e853f2925d7e47e08fc827a750 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 6 Mar 2022 15:44:27 +0000 Subject: [PATCH 15/41] (maint) Update dependency IDisposableAnalyzers to v4.0.2 --- src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj b/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj index 46735dbd..fbef979b 100644 --- a/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj +++ b/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj @@ -39,7 +39,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From f19d64598be88ba2230e34cb0f4c05e4b72d287e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 7 Mar 2022 07:45:27 +0000 Subject: [PATCH 16/41] (maint) Update dependency Moq to v4.17.2 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 59e6ac7f..6e4c27af 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all From 42fcfa46a8ce59b3f746e435327db70c627eba09 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 21 Mar 2022 09:50:58 +0000 Subject: [PATCH 17/41] (maint) Update actions/cache action to v3 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/publishDocs.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db3c9131..cd3635de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: 5.0.x 6.0.x - name: Cache Tools - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: .cake key: ${{ runner.os }}-cake-${{ hashFiles('recipe.cake') }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index de312094..5ebef8af 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,7 +47,7 @@ jobs: 6.0.x - name: Cache Tools - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: .cake key: ${{ runner.os }}-cake-${{ hashFiles('recipe.cake') }} diff --git a/.github/workflows/publishDocs.yml b/.github/workflows/publishDocs.yml index 03e1b5c3..c26a2a0c 100644 --- a/.github/workflows/publishDocs.yml +++ b/.github/workflows/publishDocs.yml @@ -21,7 +21,7 @@ jobs: run: git fetch --prune --unshallow - name: Cache Tools - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: tools key: ${{ runner.os }}-doc-tools-${{ hashFiles('recipe.cake') }} From 79355fe40a00d03ca1e64599472d329b8b068f92 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 25 Apr 2022 14:52:52 +0000 Subject: [PATCH 18/41] (maint) Update github/codeql-action action to v2 --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5ebef8af..a9a27bb4 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -54,7 +54,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -71,4 +71,4 @@ jobs: cake-bootstrap: true - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 \ No newline at end of file + uses: github/codeql-action/analyze@v2 \ No newline at end of file From 30fce1cfc0a0b7fbbd92f907172466c0f54a5d09 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 30 Apr 2022 20:25:18 +0000 Subject: [PATCH 19/41] (maint) Update dependency Cake.Testing to v2.2.0 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 6e4c27af..0810ee48 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 847e779acd37369017a682470208db6265f9c948 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 4 May 2022 18:29:59 +0000 Subject: [PATCH 20/41] (maint) Update dependency xunit.runner.visualstudio to v2.4.4 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 0810ee48..7ba939b1 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -28,7 +28,7 @@ - + runtime; build; native; contentfiles; analyzers all From adc22cf69db733afa58ec4990fa9ae08021c5c9c Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 5 May 2022 18:17:05 +0000 Subject: [PATCH 21/41] (maint) Update dependency xunit.runner.visualstudio to v2.4.5 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 7ba939b1..e27159a5 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -28,7 +28,7 @@ - + runtime; build; native; contentfiles; analyzers all From 1f85d8e19e5ec574d9533ed63bbe04dff5a399be Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 9 May 2022 13:05:36 +0000 Subject: [PATCH 22/41] (maint) Update actions/setup-dotnet action to v2.1.0 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd3635de..da75e0d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v3 - name: Fetch all tags and branches run: git fetch --prune --unshallow - - uses: actions/setup-dotnet@v2.0.0 + - uses: actions/setup-dotnet@v2.1.0 with: dotnet-version: | 2.1.818 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a9a27bb4..6ac2872b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v2.0.0 + - uses: actions/setup-dotnet@v2.1.0 with: dotnet-version: | 2.1.818 From 2e823b8dbb1264ed934db18babb6f603b90f911a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 12 May 2022 00:19:16 +0000 Subject: [PATCH 23/41] (maint) Update dependency Moq to v4.18.0 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index e27159a5..afdfc174 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all From 79e80a7363f0c0f214859c1decccf2cdb16cdadc Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 15 May 2022 22:02:58 +0000 Subject: [PATCH 24/41] (maint) Update dependency Microsoft.NET.Test.Sdk to v17.2.0 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index afdfc174..3b0b9a14 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -15,7 +15,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From eeb2b2aa0332dffb1de4d367c31266ffbb4f6ee8 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 16 May 2022 11:21:23 +0000 Subject: [PATCH 25/41] (maint) Update dependency Moq to v4.18.1 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 3b0b9a14..fad55ac4 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all From 409d1ab1c32ebfd4c08c1c1fb2c15f3cd78b8591 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Wed, 10 Aug 2022 23:46:59 +0200 Subject: [PATCH 26/41] (maint) pinned to Cake 1.3.0 and bumped Cake.recipe to 3 according to https://cake-contrib.github.io/Cake.Recipe/docs/upgrading/2.x-to-3.x --- .config/dotnet-tools.json | 2 +- .github/workflows/build.yml | 3 +-- .github/workflows/codeql-analysis.yml | 3 +-- .github/workflows/publishDocs.yml | 3 +-- build.ps1 | 2 -- build.sh | 2 -- recipe.cake | 35 +-------------------------- 7 files changed, 5 insertions(+), 45 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 727dfd76..4903ba5f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "0.38.5", + "version": "1.3.0", "commands": [ "dotnet-cake" ] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da75e0d1..91e739e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,8 +65,7 @@ jobs: script-path: recipe.cake target: CI verbosity: Diagnostic - cake-version: 0.38.5 - cake-bootstrap: true + cake-version: 1.3.0 - name: Upload Issues uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6ac2872b..5215a40b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -67,8 +67,7 @@ jobs: with: script-path: recipe.cake target: DotNetCore-Build - cake-version: 0.38.5 - cake-bootstrap: true + cake-version: 1.3.0 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/.github/workflows/publishDocs.yml b/.github/workflows/publishDocs.yml index c26a2a0c..b7a73a02 100644 --- a/.github/workflows/publishDocs.yml +++ b/.github/workflows/publishDocs.yml @@ -32,5 +32,4 @@ jobs: script-path: recipe.cake target: Force-Publish-Documentation verbosity: Diagnostic - cake-version: 0.38.5 - cake-bootstrap: true \ No newline at end of file + cake-version: 1.3.0 \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 23487193..7771a98b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -15,8 +15,6 @@ function Run([string[]]$arguments) { Run tool, restore -Run cake, recipe.cake, --bootstrap - $arguments = @("cake"; "recipe.cake") $arguments += @($args) diff --git a/build.sh b/build.sh index 794d59af..222f7af8 100644 --- a/build.sh +++ b/build.sh @@ -1,6 +1,4 @@ #!/bin/bash dotnet tool restore -dotnet cake recipe.cake --bootstrap - dotnet cake recipe.cake "$@" \ No newline at end of file diff --git a/recipe.cake b/recipe.cake index 9dfb997d..40d71b7d 100644 --- a/recipe.cake +++ b/recipe.cake @@ -1,7 +1,4 @@ -#load nuget:?package=Cake.Recipe&version=2.2.1 - -// Workaround for https://github.com/cake-contrib/Cake.Recipe/issues/854 -#tool nuget:?package=NuGet.CommandLine&version=5.8.1 +#load nuget:?package=Cake.Recipe&version=3.0.1 Environment.SetVariableNames(); @@ -16,7 +13,6 @@ BuildParameters.SetParameters( appVeyorAccountName: "cakecontrib", shouldRunDotNetCorePack: true, shouldUseDeterministicBuilds: true, - shouldRunDupFinder: false, // dupFinder is discontinued since 2021.3 shouldRunInspectCode: false, // we're shipping a custom version of it below preferredBuildProviderType: BuildProviderType.GitHubActions, preferredBuildAgentOperatingSystem: PlatformFamily.Linux); @@ -24,34 +20,5 @@ BuildParameters.SetParameters( BuildParameters.PrintParameters(Context); ToolSettings.SetToolSettings(context: Context); -ToolSettings.SetToolPreprocessorDirectives( - reSharperTools: "#tool nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2021.3.2"); - -// additional workaround for https://github.com/cake-contrib/Cake.Recipe/issues/862 -// to suppress the --build/--no-build warning that is generated in the default -BuildParameters.Tasks.InspectCodeTask = Task("InspectCode2021") - .WithCriteria(() => BuildParameters.BuildAgentOperatingSystem == PlatformFamily.Windows, "Skipping due to not running on Windows") - .Does(data => RequireTool(ToolSettings.ReSharperTools, () => { - var inspectCodeLogFilePath = BuildParameters.Paths.Directories.InspectCodeTestResults.CombineWithFilePath("inspectcode.xml"); - - var settings = new InspectCodeSettings() { - SolutionWideAnalysis = true, - OutputFile = inspectCodeLogFilePath, - ArgumentCustomization = x => x.Append("--no-build") - }; - - if (FileExists(BuildParameters.SourceDirectoryPath.CombineWithFilePath(BuildParameters.ResharperSettingsFileName))) - { - settings.Profile = BuildParameters.SourceDirectoryPath.CombineWithFilePath(BuildParameters.ResharperSettingsFileName); - } - - InspectCode(BuildParameters.SolutionFilePath, settings); - - // Pass path to InspectCode log file to Cake.Issues.Recipe - IssuesParameters.InputFiles.InspectCodeLogFilePath = inspectCodeLogFilePath; - }) -); -BuildParameters.Tasks.AnalyzeTask.IsDependentOn("InspectCode2021"); -IssuesBuildTasks.ReadIssuesTask.IsDependentOn("InspectCode2021"); Build.RunDotNetCore(); From 46b61f0477e1eb9aa2c010f0f238e09d7ef08037 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 25 Sep 2022 15:57:00 +0000 Subject: [PATCH 27/41] (maint) Update dependency Moq to v4.18.2 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index fad55ac4..49d8d2cf 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all From 63061128f13d913b419bb6c0127866fc192c7120 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 25 Sep 2022 20:01:07 +0000 Subject: [PATCH 28/41] (maint) Update dependency Shouldly to v4.1.0 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 49d8d2cf..98e39bb3 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -21,7 +21,7 @@ all - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 6fdfd688b52b93fbeaed5280a5030aad8cc50e2e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 02:51:22 +0000 Subject: [PATCH 29/41] (maint) Update dependency xunit.analyzers to v1 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 98e39bb3..89240c78 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -27,7 +27,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers all From 205d6e804dd147ac4ff4e83430a979e3e02da83f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 05:32:44 +0000 Subject: [PATCH 30/41] (maint) Update dependency xunit to v2.4.2 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 89240c78..29114e6e 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -26,7 +26,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers From f3595b7f66322e35aafa9dc9aff11e7e4a7b250c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 06:23:58 +0000 Subject: [PATCH 31/41] (maint) Update dependency Microsoft.NET.Test.Sdk to v17.3.1 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 29114e6e..b7086b13 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -15,7 +15,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From a812aa97f648886b19387543be53cef83c9c1d4c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:58:45 +0000 Subject: [PATCH 32/41] (maint) Update actions/setup-dotnet action to v3 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91e739e7..6938cf57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v3 - name: Fetch all tags and branches run: git fetch --prune --unshallow - - uses: actions/setup-dotnet@v2.1.0 + - uses: actions/setup-dotnet@v3.0.0 with: dotnet-version: | 2.1.818 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5215a40b..7c203a9f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v2.1.0 + - uses: actions/setup-dotnet@v3.0.0 with: dotnet-version: | 2.1.818 From eb83cbf09ff8a6c47bdcfbaecb7978073706570e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Oct 2022 21:03:41 +0000 Subject: [PATCH 33/41] (maint) Update dependency Microsoft.NET.Test.Sdk to v17.3.2 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index b7086b13..0b57f7a8 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -15,7 +15,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From a2986ff23daf5012ca86ea01694f41a34cb6b5d4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 12:27:09 +0000 Subject: [PATCH 34/41] (maint) Update actions/setup-dotnet action to v3.0.1 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6938cf57..cbb8644c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v3 - name: Fetch all tags and branches run: git fetch --prune --unshallow - - uses: actions/setup-dotnet@v3.0.0 + - uses: actions/setup-dotnet@v3.0.1 with: dotnet-version: | 2.1.818 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7c203a9f..c007b7e3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v3.0.0 + - uses: actions/setup-dotnet@v3.0.1 with: dotnet-version: | 2.1.818 From 35f9923f68de6a9d3a490bb57a83b94a55ebd709 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 15:48:24 +0000 Subject: [PATCH 35/41] (maint) Update dependency dotnet-sdk to v6.0.401 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 5e94f4b0..dd5faedb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.100", + "version": "6.0.401", "rollForward": "latestFeature" } } \ No newline at end of file From ef99a6707456004669c8c9abdbb6c6b78d8ef745 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 08:56:44 +0000 Subject: [PATCH 36/41] (maint) Update dependency dotnet-sdk to v6.0.402 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index dd5faedb..b18be33e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.401", + "version": "6.0.402", "rollForward": "latestFeature" } } \ No newline at end of file From edf2bb223da43af927b5ecf2bb2a622a71a93ef5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Oct 2022 17:46:40 +0000 Subject: [PATCH 37/41] (maint) Update actions/setup-dotnet action to v3.0.2 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cbb8644c..d98fb15a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v3 - name: Fetch all tags and branches run: git fetch --prune --unshallow - - uses: actions/setup-dotnet@v3.0.1 + - uses: actions/setup-dotnet@v3.0.2 with: dotnet-version: | 2.1.818 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c007b7e3..5f79e59b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v3.0.1 + - uses: actions/setup-dotnet@v3.0.2 with: dotnet-version: | 2.1.818 From e5d729cf57e56074fa74fbb1b5392d9a900b8a22 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 29 Oct 2022 16:09:22 +0000 Subject: [PATCH 38/41] (maint) Update dependency coverlet.msbuild to v3.2.0 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 0b57f7a8..2499634b 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -11,7 +11,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From d2eaebafb5e5478adf5bf7e8c512d66fa735dff3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 29 Oct 2022 20:15:32 +0000 Subject: [PATCH 39/41] (maint) Update dependency Cake.Testing to v2.3.0 --- src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 2499634b..f4610f62 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 4309c50075fa05369980e0c9de066e5185737baa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 29 Oct 2022 20:21:52 +0000 Subject: [PATCH 40/41] (maint) Update actions/setup-dotnet action to v3.0.3 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d98fb15a..25c704e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v3 - name: Fetch all tags and branches run: git fetch --prune --unshallow - - uses: actions/setup-dotnet@v3.0.2 + - uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: | 2.1.818 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5f79e59b..8105da64 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@v3.0.2 + - uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: | 2.1.818 From 7a31b67caee7444f18062c8848610237c9cdfc32 Mon Sep 17 00:00:00 2001 From: Nils Andresen Date: Fri, 18 Nov 2022 11:45:53 +0100 Subject: [PATCH 41/41] Update Cake.Core to 3.0.0 --- .github/workflows/build.yml | 6 +++--- .github/workflows/codeql-analysis.yml | 10 +++------- build.ps1 | 2 +- global.json | 10 +++++----- .../Cake.AsciiDoctorJ.Tests.csproj | 7 ++++--- src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj | 10 +++------- 6 files changed, 19 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25c704e5..9be11a63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: WYAM_DEPLOY_REMOTE: ${{ github.event.repository.html_url }} steps: - - name: Checkout the repository + - name: Checkout the repository uses: actions/checkout@v3 - name: Fetch all tags and branches run: git fetch --prune --unshallow @@ -54,6 +54,7 @@ jobs: 3.1.x 5.0.x 6.0.x + 7.0.x - name: Cache Tools uses: actions/cache@v3 with: @@ -64,7 +65,6 @@ jobs: with: script-path: recipe.cake target: CI - verbosity: Diagnostic cake-version: 1.3.0 - name: Upload Issues uses: actions/upload-artifact@v3 @@ -80,4 +80,4 @@ jobs: with: if-no-files-found: warn name: package - path: BuildArtifacts/Packages/**/* \ No newline at end of file + path: BuildArtifacts/Packages/**/* diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 8105da64..98f3b158 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -40,11 +40,7 @@ jobs: - uses: actions/setup-dotnet@v3.0.3 with: - dotnet-version: | - 2.1.818 - 3.1.x - 5.0.x - 6.0.x + dotnet-version: 7.0.x - name: Cache Tools uses: actions/cache@v3 @@ -58,7 +54,7 @@ jobs: with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. + # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main @@ -70,4 +66,4 @@ jobs: cake-version: 1.3.0 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 \ No newline at end of file + uses: github/codeql-action/analyze@v2 diff --git a/build.ps1 b/build.ps1 index 7771a98b..54020424 100644 --- a/build.ps1 +++ b/build.ps1 @@ -18,4 +18,4 @@ Run tool, restore $arguments = @("cake"; "recipe.cake") $arguments += @($args) -Run $arguments \ No newline at end of file +Run $arguments diff --git a/global.json b/global.json index b18be33e..77c776f8 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { - "sdk": { - "version": "6.0.402", - "rollForward": "latestFeature" - } -} \ No newline at end of file + "sdk": { + "version": "7.0.100", + "rollForward": "latestFeature" + } +} diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index f4610f62..c598cc62 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -1,7 +1,8 @@ - netcoreapp3.1;net5.0;net6.0 + netcoreapp3.1 + net6.0;net7.0 ..\Cake.AsciiDoctorJ.ruleset false @@ -10,12 +11,12 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj b/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj index fbef979b..eae93157 100644 --- a/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj +++ b/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1;net5.0;net6.0 + net6.0;net7.0 true true $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb @@ -37,16 +37,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - runtime; build; native; contentfiles; analyzers all