Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-a committed Sep 2, 2019
2 parents 0dac88a + 140a947 commit ac6b961
Show file tree
Hide file tree
Showing 20 changed files with 364 additions and 306 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ indent_size = 2
# requires the use of crlf line endings
[tasks.json]
end_of_line = crlf

# default for ide0065 contradicts sa1200
# see https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019
# and https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1200.md
csharp_using_directive_placement = outside_namespace
14 changes: 10 additions & 4 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed

## [1.0.1 - 2019-09-01]
## [1.0.2] - 2019-09-02
### Changed
- moved project into cake-contrb
- (GH-3) removed code warnings
- (GH-4) added some wyam documentation

## [1.0.1] - 2019-09-01
### Changed
- moved project into cake-contrib
- created a changelog
- (GH-2) many changes to internal project-structure

Expand All @@ -22,7 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial idea - working version mostly without documentation


[Unreleased]: https://github.com/cake-contrib/cake.asciidoctorj/compare/v1.0.1...HEAD
[1.0.1]: https://github.com/cake-contrib/cake.asciidoctorj/compare/v1.0.0...v1.0.1
[Unreleased]: https://github.com/cake-contrib/cake.asciidoctorj/compare/1.0.2...HEAD
[1.0.2]: https://github.com/cake-contrib/cake.asciidoctorj/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/cake-contrib/cake.asciidoctorj/compare/v1.0.0...1.0.1
[1.0.0]: https://github.com/cake-contrib/cake.asciidoctorj/compare/v0.0.1...v1.0.0
[0.0.1]: https://github.com/cake-contrib/cake.asciidoctorj/tree/v0.0.1
1 change: 1 addition & 0 deletions config.wyam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB");
13 changes: 13 additions & 0 deletions docs/input/index.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
Title: Cake.AsciiDoctorJ
NoSidebar: true
NoContainer: false
NoGutter: true
---

<div class="container">
<h1>What is it?</h1>
<p>
Cake.AsciiDoctorJ is an Addin for <a href="http://cakebuild.net/">Cake</a> to use <a href="https://github.com/asciidoctor/asciidoctorj">AsciiDoctorJ</a>.
</p>
</div>
5 changes: 1 addition & 4 deletions src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJAliasesFixture.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
namespace Cake.AsciiDoctorJ.Tests
{
using System.Collections.Generic;
using System.Linq;
using Cake.Core;
using Cake.Core.IO;
using Cake.Testing;
using Cake.Testing.Fixtures;
using Moq;

public class AsciiDoctorJAliasesFixture : AsciiDoctorJRunnerFixture
Expand All @@ -25,7 +22,7 @@ public AsciiDoctorJAliasesFixture()
argumentsMoq.Object,
ProcessRunner,
registryMoq.Object,
Tools,dataService.Object,
Tools, dataService.Object,
Configuration);
}

Expand Down
12 changes: 6 additions & 6 deletions src/Cake.AsciiDoctorJ.Tests/AsciiDoctorJAliasesTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using Cake.Core;
using FluentAssertions;
using Moq;
using NUnit.Framework;

namespace Cake.AsciiDoctorJ.Tests
{
using System;
using Cake.Core;
using FluentAssertions;
using Moq;
using NUnit.Framework;

[TestFixture]
[TestOf(typeof(AsciiDoctorJAliases))]
public class AsciiDoctorJAliasesTests
Expand Down
12 changes: 10 additions & 2 deletions src/Cake.AsciiDoctorJ.Tests/Cake.AsciiDoctorJ.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
<TargetFrameworks Condition="'$(OS)'!='Unix'">$(TargetFrameworks);net461</TargetFrameworks>

<IsPackable>false</IsPackable>
<CodeAnalysisRuleSet></CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp2.0|AnyCPU'">
<CodeAnalysisRuleSet></CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp2.0|AnyCPU'">
<CodeAnalysisRuleSet></CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
Expand All @@ -18,5 +27,4 @@
<ItemGroup>
<ProjectReference Include="../Cake.AsciiDoctorJ/Cake.AsciiDoctorJ.csproj" />
</ItemGroup>

</Project>
</Project>
12 changes: 6 additions & 6 deletions src/Cake.AsciiDoctorJ.Tests/SettingsExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Cake.Core;
using Cake.Core.IO;
using NUnit.Framework;
using FluentAssertions;
using Cake.Testing;

namespace Cake.AsciiDoctorJ.Tests
{
using Cake.Core;
using Cake.Core.IO;
using NUnit.Framework;
using FluentAssertions;
using Cake.Testing;

[TestFixture]
[TestOf(typeof(AsciiDoctorJRunnerSettingsExtensions))]
public class SettingsExtensionsTests
Expand Down
12 changes: 6 additions & 6 deletions src/Cake.AsciiDoctorJ.Tests/SettingsTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Cake.Core;
using Cake.Core.IO;
using NUnit.Framework;
using FluentAssertions;
using Cake.Testing;

namespace Cake.AsciiDoctorJ.Tests
{
using Cake.Core;
using Cake.Core.IO;
using NUnit.Framework;
using FluentAssertions;
using Cake.Testing;

[TestFixture]
[TestOf(typeof(AsciiDoctorJRunnerSettings))]
public class SettingsTests
Expand Down
52 changes: 29 additions & 23 deletions src/Cake.AsciiDoctorJ/AsciiDoctorJAliases.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
using Cake.Core;
using Cake.Core.Annotations;
using System;

namespace Cake.AsciiDoctorJ
{
using System;
using Cake.Core;
using Cake.Core.Annotations;

/// <summary>
/// Aliases for AsciiDoctorJ
/// <para>Functions to call <see href="https://asciidoctor.org/">AsciiDoctorJ</see>.</para>
/// <para>
/// In order to use this addin add the following to your build.cake.
/// <code><![CDATA[
/// #addin "nuget:?package=Cake.AsciiDoctorJ"
/// ]]></code>
/// </para>
/// </summary>
public static class AsciiDoctorJAliases
{
/// <summary>
/// Runs AsciiDoctorJ
/// Runs the tool using an action to configure seetings.
/// </summary>
/// <param name="context"></param>
/// <param name="configure"></param>
/// <returns></returns>
/// /// <example>
/// <param name="context">The <see cref="ICakeContext"/>.</param>
/// <param name="configure">An action to configure the <see cref="AsciiDoctorJRunnerSettings"/>.</param>
/// <example>
/// <code>
/// <![CDATA[
/// Task("Convert")
/// .Does(() =>
/// {
/// AsciiDoctorJ(s => s
/// .WithVerbose()
/// .WithDocType(DocType.Article)
/// .WithBackend("pdf")
/// .WithInputFile(file)
/// .WithDestinationDir(distDir));
/// .WithVerbose()
/// .WithDocType(DocType.Article)
/// .WithBackend("pdf")
/// .WithInputFile(file)
/// .WithDestinationDir(distDir));
/// });
/// ]]>
/// </code>
/// </example>
[CakeMethodAlias]
public static IAsciiDoctorJRunner AsciiDoctorJ(
[CakeAliasCategory("AsciiDoctorJ")]
public static void AsciiDoctorJ(
this ICakeContext context,
Action<AsciiDoctorJRunnerSettings> configure = null)
{
Expand All @@ -42,15 +48,14 @@ public static IAsciiDoctorJRunner AsciiDoctorJ(
}

var runner = new AsciiDoctorJRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
return runner.Run(configure);
runner.Run(configure);
}

/// <summary>
/// Runs AsciiDoctorJ
/// Runs the tool using the given <see cref="AsciiDoctorJRunnerSettings"/>.
/// </summary>
/// <param name="context"></param>
/// <param name="settings"></param>
/// <returns></returns>
/// <param name="context">The <see cref="ICakeContext"/>.</param>
/// <param name="settings">The <see cref="AsciiDoctorJRunnerSettings"/>.</param>
/// /// <example>
/// <code>
/// <![CDATA[
Expand All @@ -69,7 +74,8 @@ public static IAsciiDoctorJRunner AsciiDoctorJ(
/// </code>
/// </example>
[CakeMethodAlias]
public static IAsciiDoctorJRunner AsciiDoctorJ(
[CakeAliasCategory("AsciiDoctorJ")]
public static void AsciiDoctorJ(
this ICakeContext context,
AsciiDoctorJRunnerSettings settings)
{
Expand All @@ -84,7 +90,7 @@ public static IAsciiDoctorJRunner AsciiDoctorJ(
}

var runner = new AsciiDoctorJRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
return runner.Run(settings);
runner.Run(settings);
}
}
}
61 changes: 31 additions & 30 deletions src/Cake.AsciiDoctorJ/AsciiDoctorJRunner.cs
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Cake.Core;
using Cake.Core.IO;
using Cake.Core.Tooling;

[assembly: InternalsVisibleTo("Cake.AsciiDoctorJ.Tests")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Cake.AsciiDoctorJ.Tests")]

namespace Cake.AsciiDoctorJ
{
using System;
using System.Collections.Generic;
using Cake.Core;
using Cake.Core.IO;
using Cake.Core.Tooling;

/// <summary>
/// This is the runner. <see cref="Tool{TSettings}"/>
/// This is the runner. <see cref="Tool{TSettings}"/>.
/// </summary>
internal class AsciiDoctorJRunner : Tool<AsciiDoctorJRunnerSettings>, IAsciiDoctorJRunner
internal class AsciiDoctorJRunner : Tool<AsciiDoctorJRunnerSettings>
{
private ICakeEnvironment environment;
private readonly ICakeEnvironment environment;

/// <summary>
/// default ctor. <see cref="Tool{TSettings}(IFileSystem,ICakeEnvironment,IProcessRunner,IToolLocator)"/>
/// Initializes a new instance of the <see cref="AsciiDoctorJRunner"/> class.
/// <see cref="Tool{TSettings}(IFileSystem,ICakeEnvironment,IProcessRunner,IToolLocator)"/>.
/// </summary>
/// <param name="fileSystem"></param>
/// <param name="environment"></param>
/// <param name="processRunner"></param>
/// <param name="tools"></param>
/// <param name="fileSystem">The <see cref="IFileSystem"/>.</param>
/// <param name="environment">The <see cref="ICakeEnvironment"/>.</param>
/// <param name="processRunner">The <see cref="IProcessRunner"/>.</param>
/// <param name="tools">The <see cref="IToolLocator"/>.</param>
internal AsciiDoctorJRunner(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools)
: base(fileSystem, environment, processRunner, tools)
{
this.environment = environment;
}

/// <summary>
/// AsciiDoctorJ
/// Runs the tool using an action to configure seetings.
/// </summary>
/// <returns></returns>
protected override string GetToolName() => "AsciiDoctorJ Runner";

/// <summary>
/// AsciiDoctorJ.exe
/// </summary>
/// <returns></returns>
protected override IEnumerable<string> GetToolExecutableNames() => new[] { "asciidoctorj.exe", "asciidoctorj" };

internal AsciiDoctorJRunner Run(Action<AsciiDoctorJRunnerSettings> configure = null)
/// <param name="configure">The configuration action.</param>
internal void Run(Action<AsciiDoctorJRunnerSettings> configure = null)
{
var settings = new AsciiDoctorJRunnerSettings();
configure?.Invoke(settings);
return Run(settings);
Run(settings);
}

internal AsciiDoctorJRunner Run(AsciiDoctorJRunnerSettings settings)
/// <summary>
/// Runs the tool.
/// </summary>
/// <param name="settings">The settings.</param>
internal void Run(AsciiDoctorJRunnerSettings settings)
{
var args = new ProcessArgumentBuilder();
settings?.Evaluate(args, environment);
Run(settings, args);
return this;
}

/// <inheritdoc/>
protected override string GetToolName() => "AsciiDoctorJ Runner";

/// <inheritdoc/>
protected override IEnumerable<string> GetToolExecutableNames() => new[] { "asciidoctorj.exe", "asciidoctorj" };
}
}
Loading

0 comments on commit ac6b961

Please sign in to comment.