-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathProgram.cs
More file actions
40 lines (33 loc) · 1.48 KB
/
Copy pathProgram.cs
File metadata and controls
40 lines (33 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Statiq.App;
using Statiq.Common;
using Statiq.Docs;
// Replaces config.wyam. Everything declarative lives in statiq.json;
// only the code-analysis inputs need the bootstrapper.
// Generating the API reference is what makes the build slow: ~2900 extra pages,
// three minutes instead of twenty seconds. The old Wyam script skipped it by
// not passing "SourceFiles" at all, and we do the same rather than just
// suppressing the output - otherwise the API index page is still generated and
// links to pages that were never written. build.cake sets this for every target
// except CIBuild; see its --api argument.
bool skipApi = string.Equals(
Environment.GetEnvironmentVariable("MAHAPPS_DOCS_SKIP_API"),
"true",
StringComparison.OrdinalIgnoreCase);
Bootstrapper bootstrapper = Bootstrapper
.Factory
.CreateDocs(args)
// The MahApps.Metro submodule is source input for the API docs, not
// site content - keep Statiq from reading it as pages.
.AddExcludedPath("mahapps")
.AddSetting(DocsKeys.ApiPath, "api");
if (!skipApi)
{
bootstrapper = bootstrapper
// Same glob as the old build.cake "SourceFiles" setting. Statiq
// resolves this relative to the input path, so "../mahapps" is
// <root>/mahapps.
.AddSourceFiles(
"../mahapps/src/**/{!bin,!obj,!packages,!*.Tests,!*.Build,!*.Samples,!Microsoft.Windows.Shell,}/**/*.cs")
.AddSetting(DocsKeys.OutputApiDocuments, true);
}
return await bootstrapper.RunAsync();