Skip to content

Commit 4357f9a

Browse files
committed
chore: add "update documentation" targets to build.fsx
1 parent 2ff3e4e commit 4357f9a

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

build.fsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ Target.create "Clean" (fun _ ->
132132

133133

134134

135-
136-
//Target "CleanDocs" (fun _ ->
137-
// CleanDirs ["docs/output"]
138-
//)
135+
// --------------------------------------------------------------------------------------
136+
// Clean the folders created by fsdocs when generating documentation
137+
Target.create "CleanDocs" (fun _ -> !! "output" ++ ".fsdocs" |> Shell.cleanDirs)
139138

140139
// --------------------------------------------------------------------------------------
141140
// Build library & test project
@@ -149,6 +148,22 @@ Target.create "Build" (fun _ ->
149148

150149
DotNet.build setParams "ExcelProvider.sln")
151150

151+
// --------------------------------------------------------------------------------------
152+
// Generate the documentation
153+
Target.create "GenerateDocs" (fun _ ->
154+
155+
let result =
156+
DotNet.exec
157+
id
158+
"fsdocs"
159+
("build --properties Configuration=Release --strict --eval --clean --parameters fsdocs-package-version "
160+
+ release.NugetVersion)
161+
162+
if not result.OK then
163+
printfn "Errors while generating docs: %A" result.Messages
164+
failwith "Failed to generate docs")
165+
166+
152167

153168
// --------------------------------------------------------------------------------------
154169
// Run the unit tests using test runner
@@ -382,8 +397,7 @@ Target.create "All" ignore
382397
==> "Build"
383398
==> "RunTests"
384399
==> "CopyBinaries"
385-
// ==> "GenerateReferenceDocs"
386-
// ==> "GenerateDocs"
400+
==> "GenerateDocs"
387401
==> "All"
388402
// =?> ("ReleaseDocs",isLocalBuild)
389403

0 commit comments

Comments
 (0)