diff --git a/.all-contributorsrc b/.all-contributorsrc index 6f76a32d..1c91a76f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -33,6 +33,15 @@ "contributions": [ "doc" ] + }, + { + "login": "mcpride", + "name": "Marco Stolze", + "avatar_url": "https://avatars.githubusercontent.com/u/1053528?v=4", + "profile": "https://mcpride.github.io", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index f92dbdeb..77cacb6f 100644 --- a/README.md +++ b/README.md @@ -66,11 +66,14 @@ Thanks goes to these wonderful people ([emoji key][emoji-key]): - - - - - + + + + + + + +

Nils Andresen

💻 📖

Pascal Berger

🐛 💻

DiDoHH

📖
Nils Andresen
Nils Andresen

💻 📖
Pascal Berger
Pascal Berger

🐛 💻
DiDoHH
DiDoHH

📖
Marco Stolze
Marco Stolze

🐛
diff --git a/global.json b/global.json index 77c776f8..b6ff0a69 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "7.0.102", "rollForward": "latestFeature" } } diff --git a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj index 17947b41..83ecde91 100644 --- a/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj +++ b/src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj @@ -16,14 +16,14 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs b/src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs index e2bb919a..6e424de0 100644 --- a/src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs +++ b/src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs @@ -25,7 +25,7 @@ public void Should_convert_all_extensions_to_arguments(Action 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.WithRequire("asciidoctor-epub3"), "--require asciidoctor-epub3"); yield return (s => s.WithQuiet(), "--quiet"); yield return (s => s.WithSuppressHeaderAndFooter(), "--no-header-footer"); yield return (s => s.WithCompact(), "--compact"); @@ -116,7 +116,7 @@ private class TestData : IEnumerable 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.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\""); } @@ -140,7 +140,6 @@ private class ArgSetterTestData : IEnumerable 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); @@ -168,6 +167,7 @@ private class ArgSetterTestData : IEnumerable var barAdoc = new FilePath("bar.adoc"); var fooBar = new KeyValuePair("foo", "bar"); var bimBam = new KeyValuePair("bim", "bam"); + var libs = new[]{"some-library", "another-library"}; 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); @@ -184,6 +184,8 @@ private class ArgSetterTestData : IEnumerable 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 }); + yield return (s => s.WithRequire(libs), s => s.Require, libs); + } public IEnumerator GetEnumerator() diff --git a/src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs b/src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs index ec040db0..87b0c98f 100644 --- a/src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs +++ b/src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs @@ -39,7 +39,6 @@ private class TestData : IEnumerable 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"); @@ -70,6 +69,7 @@ private class TestData : IEnumerable 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\""); + yield return (s => s.Require.Add("asciidoctor-diagram"), "--require asciidoctor-diagram"); } public IEnumerator GetEnumerator() diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs index f683b583..1ff2d82a 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettings.cs @@ -21,6 +21,7 @@ public AsciiDoctorJRunnerSettings() LoadPath = new List(); ClassPath = new List(); Attributes = new Dictionary(); + Require = new List(); } /// @@ -82,7 +83,7 @@ public AsciiDoctorJRunnerSettings() /// require the specified library before executing the processor. /// corresponds to: -r, --require. /// - public bool Require { get; set; } + public IList Require { get; set; } /// /// Gets or sets a value indicating whether to @@ -224,9 +225,9 @@ internal void Evaluate(ProcessArgumentBuilder args, ICakeEnvironment environment // ReSharper enable PossibleNullReferenceException } - if (Require) + foreach (var req in Require) { - args.Append("--require"); + args.Append("--require " + req); } if (Quiet) diff --git a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs index 6ff7f714..c3f1f290 100644 --- a/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs +++ b/src/Cake.AsciiDoctorJ/AsciiDoctorJRunnerSettingsExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using Cake.Core.IO; @@ -124,9 +125,9 @@ public static AsciiDoctorJRunnerSettings WithSafeMode(this AsciiDoctorJRunnerSet /// /// The that extended by this. /// The reference to the . - public static AsciiDoctorJRunnerSettings WithRequire(this AsciiDoctorJRunnerSettings @this) + public static AsciiDoctorJRunnerSettings WithRequire(this AsciiDoctorJRunnerSettings @this, params string[] require) { - @this.Require = true; + require.ToList().ForEach(@this.Require.Add); return @this; } diff --git a/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj b/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj index eae93157..f8261d90 100644 --- a/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj +++ b/src/Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj @@ -48,7 +48,7 @@ all - + all runtime; build; native; contentfiles; analyzers; buildtransitive