Skip to content

Commit

Permalink
Using dotnet publish to find refs for docs
Browse files Browse the repository at this point in the history
This speeds up doc generation considerably and more reliably by relying on dotnet publish rather than trying to convice FCS to give the reference
  • Loading branch information
TheAngryByrd committed Oct 24, 2020
1 parent 10bfae0 commit 5b2930b
Show file tree
Hide file tree
Showing 10 changed files with 527 additions and 594 deletions.
14 changes: 0 additions & 14 deletions Content/Library/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -626,18 +626,6 @@ let buildDocs _ =
DocsTool.build ()

let watchDocs _ =
let watchBuild () =
!! srcGlob
|> Seq.map(fun proj -> fun () ->
dotnet.watch
(fun opt ->
opt |> DotNet.Options.withWorkingDirectory (IO.Path.GetDirectoryName proj))
"build"
""
|> ignore
)
|> Seq.iter (invokeAsync >> Async.Catch >> Async.Ignore >> Async.Start)
watchBuild ()
DocsTool.watch ()

let releaseDocs ctx =
Expand Down Expand Up @@ -699,13 +687,11 @@ Target.create "ReleaseDocs" releaseDocs
"UpdateChangelog" ?=> "GenerateAssemblyInfo"
"UpdateChangelog" ==> "PublishToNuGet"

"DotnetBuild" ==> "BuildDocs"
"BuildDocs" ==> "ReleaseDocs"
"BuildDocs" ?=> "PublishToNuget"
"DotnetPack" ?=> "BuildDocs"
"GenerateCoverageReport" ?=> "ReleaseDocs"

"DotnetBuild" ==> "WatchDocs"

"DotnetRestore"
==> "DotnetBuild"
Expand Down
4 changes: 3 additions & 1 deletion Content/Library/docsSrc/Tutorials/Getting_Started.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Getting Started

```fsharp
open MyLib._1
let foo = ()
let myAge = 21
let color = Say.FavoriteColor.Red
```

## Here is the path to downloading
## Here is the path to downloading

[lang=bash]
paket install MyLib.1
Expand Down
1 change: 1 addition & 0 deletions Content/Library/docsSrc/content/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ table.pre td.lines {

body {
font-family: 'Open Sans', serif;
background-color: #BADA55;
}

pre {
Expand Down
20 changes: 20 additions & 0 deletions Content/Library/docsTool/Prelude.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,23 @@ module Uri =
match Uri.TryCreate(url, UriKind.Absolute) with
| (true, v) -> v
| _ -> failwithf "Bad url %s" url

module Directory =
open System
open Fake.Core
let dispose (d : #IDisposable) = d.Dispose()
type DisposableDirectory (directory : string) =
do
Trace.tracefn "Created disposable directory %s" directory
static member Create() =
let tempPath = IO.Path.Combine(IO.Path.GetTempPath(), Guid.NewGuid().ToString("n"))
IO.Directory.CreateDirectory tempPath |> ignore

new DisposableDirectory(tempPath)
member x.Directory = directory
member x.DirectoryInfo = IO.DirectoryInfo(directory)

interface IDisposable with
member x.Dispose() =
Trace.tracefn "Deleting directory %s" directory
IO.Directory.Delete(x.Directory,true)
Loading

0 comments on commit 5b2930b

Please sign in to comment.