Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added libdirs to fake5 doc generation. #1912

Merged
merged 1 commit into from
May 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ open System.Reflection
//let execContext = Fake.Core.Context.FakeExecutionContext.Create false "build.fsx" []
//Fake.Core.Context.setExecutionContext (Fake.Core.Context.RuntimeContext.Fake execContext)
//#endif
#load "src/app/Fake.DotNet.FSFormatting/FSFormatting.fs"
// #load "src/app/Fake.DotNet.FSFormatting/FSFormatting.fs"
open System.IO
open Fake.Api
open Fake.Core
Expand Down Expand Up @@ -419,17 +419,31 @@ Target.create "GenerateDocs" (fun _ ->

Directory.ensure apidocsDir

let dllsAndLibDirs (dllPattern:IGlobbingPattern) =
let dlls =
dllPattern
|> Seq.distinctBy Path.GetFileName
|> List.ofSeq
let libDirs =
dlls
|> Seq.map Path.GetDirectoryName
|> Seq.distinct
|> List.ofSeq
(dlls,libDirs)
// FAKE 5 module documentation
let fake5ApidocsDir = apidocsDir @@ "v5"
Directory.ensure fake5ApidocsDir
let fake5Dlls =
!! "./src/app/Fake.*/bin/Release/**/Fake.*.dll"
|> Seq.distinctBy Path.GetFileName

let fake5Dlls, fake5LibDirs =
!! "./src/app/Fake.*/bin/Release/**/Fake.*.dll"
|> dllsAndLibDirs

fake5Dlls
|> FSFormatting.createDocsForDlls (fun s ->
{ s with
OutputDirectory = fake5ApidocsDir
LayoutRoots = fake5LayoutRoots
LibDirs = fake5LibDirs
// TODO: CurrentPage shouldn't be required as it's written in the template, but it is -> investigate
ProjectParameters = ("api-docs-prefix", "/apidocs/v5/") :: ("CurrentPage", "APIReference") :: projInfo
SourceRepository = githubLink + "/blob/master" })
Expand Down Expand Up @@ -465,7 +479,7 @@ Target.create "GenerateDocs" (fun _ ->
// FAKE 5 legacy documentation
let fake5LegacyApidocsDir = apidocsDir @@ "v5/legacy"
Directory.ensure fake5LegacyApidocsDir
let fake5LegacyDlls =
let fake5LegacyDlls, fake5LegacyLibDirs =
!! "./build/**/Fake.*.dll"
++ "./build/FakeLib.dll"
-- "./build/**/Fake.Experimental.dll"
Expand All @@ -474,37 +488,37 @@ Target.create "GenerateDocs" (fun _ ->
-- "./build/**/FAKE.FSharp.Compiler.Service.dll"
-- "./build/**/Fake.IIS.dll"
-- "./build/**/Fake.Deploy.Lib.dll"
|> Seq.distinctBy Path.GetFileName
|> dllsAndLibDirs

fake5LegacyDlls
|> FSFormatting.createDocsForDlls (fun s ->
{ s with
OutputDirectory = fake5LegacyApidocsDir
LayoutRoots = legacyLayoutRoots
LibDirs = [ "./build" ]
LibDirs = fake5LegacyLibDirs
// TODO: CurrentPage shouldn't be required as it's written in the template, but it is -> investigate
ProjectParameters = ("api-docs-prefix", "/apidocs/v5/legacy/") :: ("CurrentPage", "APIReference") :: projInfo
SourceRepository = githubLink + "/blob/master" })

// FAKE 4 legacy documentation
let fake4LegacyApidocsDir = apidocsDir @@ "v4"
Directory.ensure fake4LegacyApidocsDir
let fake4LegacyDlls =
let fake4LegacyDlls, fake4LegacyLibDirs =
!! "./packages/docs/FAKE/tools/Fake.*.dll"
++ "./packages/docs/FAKE/tools/FakeLib.dll"
-- "./packages/docs/FAKE/tools/Fake.Experimental.dll"
-- "./packages/docs/FAKE/tools/FSharp.Compiler.Service.dll"
-- "./packages/docs/FAKE/tools/FAKE.FSharp.Compiler.Service.dll"
-- "./packages/docs/FAKE/tools/Fake.IIS.dll"
-- "./packages/docs/FAKE/tools/Fake.Deploy.Lib.dll"
|> Seq.distinctBy Path.GetFileName
|> dllsAndLibDirs

fake4LegacyDlls
|> FSFormatting.createDocsForDlls (fun s ->
{ s with
OutputDirectory = fake4LegacyApidocsDir
LayoutRoots = fake4LayoutRoots
LibDirs = [ "./packages/docs/FAKE/tools" ]
LibDirs = fake4LegacyLibDirs
// TODO: CurrentPage shouldn't be required as it's written in the template, but it is -> investigate
ProjectParameters = ("api-docs-prefix", "/apidocs/v4/") ::("CurrentPage", "APIReference") :: projInfo
SourceRepository = githubLink + "/blob/hotfix_fake4" })
Expand Down