diff --git a/Directory.Packages.props b/Directory.Packages.props
index c4b67d266..fdabf4ece 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -16,6 +16,7 @@
+
diff --git a/build.fsx b/build.fsx
index 6706d59d7..a9866d70a 100644
--- a/build.fsx
+++ b/build.fsx
@@ -50,9 +50,13 @@ let testStage =
$"dotnet test {solutionFile} --configuration {configuration} --no-build --blame --logger trx --results-directory TestResults -tl"
}
-pipeline "CI" {
- lintStage
+let buildStage =
+ stage "Build" {
+ run $"dotnet restore {solutionFile} -tl"
+ run $"dotnet build {solutionFile} --configuration {configuration} -tl"
+ }
+let cleanStage =
stage "Clean" {
run (fun _ ->
!!artifactsDir ++ "temp" |> Shell.cleanDirs
@@ -60,13 +64,14 @@ pipeline "CI" {
[ "bin"; "temp"; "tests/bin" ] |> Seq.iter Directory.ensure)
}
- stage "Build" {
- run $"dotnet restore {solutionFile} -tl"
- run $"dotnet build {solutionFile} --configuration {configuration} -tl"
- }
-
+let nugetStage =
stage "NuGet" { run $"dotnet pack {solutionFile} --output \"{artifactsDir}\" --configuration {configuration} -tl" }
+pipeline "CI" {
+ lintStage
+ cleanStage
+ buildStage
+ nugetStage
testStage
stage "GenerateDocs" {
@@ -93,4 +98,11 @@ pipeline "Verify" {
runIfOnlySpecified true
}
+pipeline "BuildAndPack" {
+ cleanStage
+ buildStage
+ nugetStage
+ runIfOnlySpecified true
+}
+
tryPrintPipelineCommandHelp ()
diff --git a/src/fsdocs-tool/BuildCommand.fs b/src/fsdocs-tool/BuildCommand.fs
index 33f9a94b8..e94790aa6 100644
--- a/src/fsdocs-tool/BuildCommand.fs
+++ b/src/fsdocs-tool/BuildCommand.fs
@@ -2,6 +2,7 @@ namespace fsdocs
open System.Collections.Concurrent
open CommandLine
+open Spectre.Console
open System
open System.Diagnostics
@@ -1580,16 +1581,16 @@ type CoreBuildOptions(watch) =
let dir = Path.GetDirectoryName(typeof.Assembly.Location)
// get template locations for in-package and in-repo and decide which to use later
- let inPackageLocations = Common.InPackageLocations(Path.Combine(dir, "..", "..", ".."))
- let inRepoLocations = Common.InRepoLocations(Path.Combine(dir, "..", "..", "..", "..", ".."))
+ let inNugetPackageLocations = Common.InNugetPackageLocations(Path.Combine(dir, "..", "..", ".."))
+ let inThisRepoLocations = Common.InDocsFolderLocations(Path.Combine(dir, "..", "..", "..", "..", "..", "docs"))
let defaultTemplate =
if this.nodefaultcontent then
None
- else if inPackageLocations.Exist() then
- Some inPackageLocations.template_html
- elif inRepoLocations.Exist() then
- Some inRepoLocations.template_html
+ else if inNugetPackageLocations.AllLocationsExist() then
+ Some inNugetPackageLocations.``templates/template.html``.Path
+ elif inThisRepoLocations.AllLocationsExist() then
+ Some inThisRepoLocations.``template.html``.Path
else
None
@@ -1598,22 +1599,22 @@ type CoreBuildOptions(watch) =
// The "extras" content goes in "."
// From .nuget\packages\fsdocs-tool\7.1.7\tools\net6.0\any
// to .nuget\packages\fsdocs-tool\7.1.7\extras
- if inPackageLocations.Exist() then
- printfn "using extra content from %s" inPackageLocations.extras
- (inPackageLocations.extras, ".")
+ if inNugetPackageLocations.AllLocationsExist() then
+ printfn "using extra content from %s" inNugetPackageLocations.extras.Path
+ (inNugetPackageLocations.extras.Path, ".")
else if
// This is for in-repo use only, assuming we are executing directly from
// src\fsdocs-tool\bin\Debug\net6.0\fsdocs.exe
// src\fsdocs-tool\bin\Release\net6.0\fsdocs.exe
- inRepoLocations.Exist()
+ inThisRepoLocations.AllLocationsExist()
then
- printfn "using extra content from %s" inRepoLocations.docs_content
- (inRepoLocations.docs_content, "content")
+ printfn "using extra content from %s" inThisRepoLocations.content.Path
+ (inThisRepoLocations.content.Path, "content")
else
printfn
"no extra content found at %s or %s"
- inPackageLocations.extras
- inRepoLocations.docs_content ]
+ inNugetPackageLocations.extras.Path
+ inThisRepoLocations.content.Path ]
// The incremental state (as well as the files written to disk)
let mutable latestApiDocModel = None
@@ -1671,12 +1672,12 @@ type CoreBuildOptions(watch) =
templateFiles
d
- OutputKind.Html, Some d
- | None ->
- printfn
- "note, no template file '%s' found, and no default template at '%s'"
- templateFiles
- inRepoLocations.template_html
+ OutputKind.Html, Some d
+ | None ->
+ printfn
+ "note, no template file '%s' found, and no default template at '%s'"
+ templateFiles
+ inThisRepoLocations.``template.html``.Path
OutputKind.Html, None
diff --git a/src/fsdocs-tool/InitCommand.fs b/src/fsdocs-tool/InitCommand.fs
index 6cfe312c9..8a926a727 100644
--- a/src/fsdocs-tool/InitCommand.fs
+++ b/src/fsdocs-tool/InitCommand.fs
@@ -3,14 +3,16 @@ namespace fsdocs
open System.IO
open CommandLine
+open Spectre.Console
+
[]
type InitCommand() =
let dir = Path.GetDirectoryName(typeof.Assembly.Location)
// get template locations for in-package and in-repo files and decide which to use later
- let inPackageLocations = Common.InPackageLocations(Path.Combine(dir, "..", "..", ".."))
- let inRepoLocations = Common.InRepoLocations(Path.Combine(dir, "..", "..", "..", "..", ".."))
+ let inNugetPackageLocations = Common.InNugetPackageLocations(Path.Combine(dir, "..", "..", ".."))
+ let inThisRepoLocations = Common.InDocsFolderLocations(Path.Combine(dir, "..", "..", "..", "..", "..", "docs"))
[