Skip to content

Commit 8327840

Browse files
committed
include the cake.wyam2 source to fix the docs tasks
1 parent fc5b3ff commit 8327840

File tree

12 files changed

+608
-12
lines changed

12 files changed

+608
-12
lines changed

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ name: Verify & Publish Docs
22

33
on:
44
workflow_dispatch:
5+
repository_dispatch:
6+
types: [release]
57
push:
68
branches:
7-
# - main
8-
- 'support/*'
9+
- main
910
paths:
1011
- docs/**
1112
- package*.json
@@ -15,8 +16,7 @@ on:
1516
- .github/workflows/docs.yml
1617
pull_request:
1718
branches:
18-
# - main
19-
- 'support/*'
19+
- main
2020
paths:
2121
- docs/**
2222
- package*.json

build/Directory.Packages.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<PackageVersion Include="Cake.Docker" Version="1.1.2" />
1313
<PackageVersion Include="Cake.Git" Version="2.0.0" />
1414
<PackageVersion Include="Cake.Json" Version="7.0.1" />
15-
<PackageVersion Include="Cake.Wyam2" Version="3.0.0" />
1615
<PackageVersion Include="xunit.assert" Version="2.4.2" />
1716
</ItemGroup>
18-
</Project>
17+
</Project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#nullable disable
2+
namespace Common.Addins.Cake.Wyam;
3+
4+
/// <summary>
5+
/// Settings for specifying NuGet packages.
6+
/// </summary>
7+
public class NuGetSettings
8+
{
9+
/// <summary>
10+
/// Specifies that prerelease packages are allowed.
11+
/// </summary>
12+
public bool Prerelease { get; set; }
13+
14+
/// <summary>
15+
/// Specifies that unlisted packages are allowed.
16+
/// </summary>
17+
public bool Unlisted { get; set; }
18+
19+
/// <summary>
20+
/// Indicates that only the specified package source(s) should be used to find the package.
21+
/// </summary>
22+
public bool Exclusive { get; set; }
23+
24+
/// <summary>
25+
/// Specifies the version of the package to use.
26+
/// </summary>
27+
public string Version { get; set; }
28+
29+
/// <summary>
30+
/// Specifies the package source(s) to get the package from.
31+
/// </summary>
32+
public IEnumerable<string> Source { get; set; }
33+
34+
/// <summary>
35+
/// The package to install.
36+
/// </summary>
37+
public string Package { get; set; }
38+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#nullable disable
2+
namespace Common.Addins.Cake.Wyam;
3+
4+
/// <summary>
5+
/// <para>Contains functionality related to <see href="https://github.com/Wyam2/wyam">Wyam2</see>.</para>
6+
/// <para>
7+
/// In order to use the commands for this alias, include the following in your build.cake file to download and install from NuGet.org, or specify the ToolPath within the WyamSettings class:
8+
/// <code>
9+
/// #addin "nuget:?package=Cake.Wyam2"
10+
/// #tool "nuget:?package=Wyam2"
11+
/// </code>
12+
/// </para>
13+
/// </summary>
14+
/// <remarks>
15+
/// Make sure to remove existing references to old Cake.Wyam addin (https://www.nuget.org/packages/Wyam/).
16+
/// </remarks>
17+
[CakeAliasCategory("Wyam2")]
18+
public static class WyamAliases
19+
{
20+
/// <summary>
21+
/// Runs Wyam2 using the specified settings.
22+
/// </summary>
23+
/// <param name="context">The context.</param>
24+
/// <example>
25+
/// <code>
26+
/// Wyam();
27+
/// </code>
28+
/// </example>
29+
[CakeMethodAlias]
30+
public static void Wyam(this ICakeContext context)
31+
{
32+
if (context == null)
33+
{
34+
throw new ArgumentNullException(nameof(context));
35+
}
36+
37+
Wyam(context, new WyamSettings());
38+
}
39+
40+
/// <summary>
41+
/// Runs Wyam2 using the specified settings.
42+
/// </summary>
43+
/// <param name="context">The context.</param>
44+
/// <param name="settings">The settings.</param>
45+
/// <example>
46+
/// <code>
47+
/// Wyam(new WyamSettings()
48+
/// {
49+
/// OutputPath = Directory("C:/Output")
50+
/// });
51+
/// </code>
52+
/// </example>
53+
[CakeMethodAlias]
54+
public static void Wyam(this ICakeContext context, WyamSettings settings)
55+
{
56+
if (context == null)
57+
{
58+
throw new ArgumentNullException(nameof(context));
59+
}
60+
61+
WyamRunner runner = new WyamRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
62+
runner.Run(settings);
63+
}
64+
}

0 commit comments

Comments
 (0)