Skip to content

Commit

Permalink
GitTools#2874 - include schemas in the docs publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Feb 26, 2023
1 parent b29649b commit 8a58bc1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions build/common/Utilities/Paths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ public class Paths
public static readonly DirectoryPath Src = Root.Combine("src");
public static readonly DirectoryPath Docs = Root.Combine("docs");
public static readonly DirectoryPath Build = Root.Combine("build");
public static readonly DirectoryPath Schemas = Root.Combine("schemas");
public static readonly DirectoryPath Dogfood = Root.Combine("dogfood");
public static readonly DirectoryPath Integration = Root.Combine("tests").Combine("integration");

public static readonly DirectoryPath Nuspec = Build.Combine("nuspec");

public static readonly DirectoryPath TestOutput = Artifacts.Combine("test-results");
public static readonly DirectoryPath Packages = Artifacts.Combine("packages");
public static readonly DirectoryPath ArtifactsDocs = Artifacts.Combine("docs");

public static readonly DirectoryPath Native = Packages.Combine("native");
public static readonly DirectoryPath Nuget = Packages.Combine("nuget");
public static readonly DirectoryPath ArtifactsBinCmdline = Packages.Combine("prepare").Combine("cmdline");
public static readonly DirectoryPath ArtifactsBinPortable = Packages.Combine("prepare").Combine("portable");
}
5 changes: 5 additions & 0 deletions build/docs/Tasks/PreviewDocs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ public override void Run(BuildContext context)
{
if (context.WyamSettings is not null)
{
var schemaTargetDir = Paths.ArtifactsDocs.Combine("preview").Combine("schemas");
context.EnsureDirectoryExists(schemaTargetDir);
context.CopyDirectory(Paths.Schemas, schemaTargetDir);

context.WyamSettings.Preview = true;
context.WyamSettings.Watch = true;
context.WyamSettings.NoClean = true;
context.WyamSettings.Settings.Add("Host", "gittools.github.io");
context.Wyam(context.WyamSettings);
}
Expand Down
4 changes: 4 additions & 0 deletions build/docs/Tasks/PublishDocs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ private static void PublishDocumentation(BuildContext context)
context.Wyam(context.WyamSettings);
}

var schemaTargetDir = publishFolder.Combine("schemas");
context.EnsureDirectoryExists(schemaTargetDir);
context.CopyDirectory(Paths.Schemas, schemaTargetDir);

if (!context.GitHasUncommitedChanges(publishFolder)) return;

context.Information("Stage all changes...");
Expand Down

0 comments on commit 8a58bc1

Please sign in to comment.