@@ -28,43 +28,41 @@ let rec collectModules pn pu nn nu (m: Module) =
2828
2929
3030let loader ( projectRoot : string ) ( siteContent : SiteContents ) =
31- try
32- let label = " FSharp.Compiler.Service"
33- let dll = Path.Combine( projectRoot, " .." , " .." , " artifacts" , " bin" , " fcs" , " Release" , " netcoreapp3.0" , " FSharp.Compiler.Service.dll" )
34- let libs = Path.Combine( projectRoot, " .." , " .." , " artifacts" , " bin" , " fcs" , " Release" , " netcoreapp3.0" )
31+ let label = " FSharp.Compiler.Service"
32+ let dll = Path.Combine( projectRoot, " .." , " .." , " artifacts" , " bin" , " fcs" , " Release" , " netstandard2.0" , " FSharp.Compiler.Service.dll" )
33+ let libs = Path.Combine( projectRoot, " .." , " .." , " artifacts" , " bin" , " fcs" , " Release" , " netstandard2.0" )
3534
36- printfn " generating api ref for %s at %s " label dll
35+ if ( not ( File.Exists dll )) then failwithf " Unable to find FCS dll at %s " dll
3736
38- let output = MetadataFormat.Generate ( dll , markDownComments = true , publicOnly = true , libDirs = [ libs ])
37+ printfn " generating api ref for %s at %s " label dll
3938
40- let allModules =
41- output.AssemblyGroup.Namespaces
42- |> List.collect ( fun n ->
43- List.collect ( collectModules n.Name n.Name n.Name n.Name) n.Modules
44- )
39+ let output = MetadataFormat.Generate( dll, markDownComments = true , publicOnly = true , libDirs = [ libs])
4540
46- let allTypes =
47- [
48- yield !
49- output.AssemblyGroup.Namespaces
50- |> List.collect ( fun n ->
51- n.Types |> List.map ( fun t -> { ParentName = n.Name; ParentUrlName = n.Name; NamespaceName = n.Name; NamespaceUrlName = n.Name; Info = t} )
52- )
53- yield !
54- allModules
55- |> List.collect ( fun n ->
56- n.Info.NestedTypes |> List.map ( fun t -> { ParentName = n.Info.Name; ParentUrlName = n.Info.UrlName; NamespaceName = n.NamespaceName; NamespaceUrlName = n.NamespaceUrlName; Info = t}) )
57- ]
58- let entities = {
59- Label = label
60- Modules = allModules
61- Types = allTypes
62- GeneratorOutput = output
63- }
64- siteContent.Add entities
65- printfn " generated api ref for %s at %s " label dll
66- with
67- | ex ->
68- printfn " %A " ex
41+ let allModules =
42+ output.AssemblyGroup.Namespaces
43+ |> List.collect ( fun n ->
44+ List.collect ( collectModules n.Name n.Name n.Name n.Name) n.Modules
45+ )
46+
47+ let allTypes =
48+ [
49+ yield !
50+ output.AssemblyGroup.Namespaces
51+ |> List.collect ( fun n ->
52+ n.Types |> List.map ( fun t -> { ParentName = n.Name; ParentUrlName = n.Name; NamespaceName = n.Name; NamespaceUrlName = n.Name; Info = t} )
53+ )
54+ yield !
55+ allModules
56+ |> List.collect ( fun n ->
57+ n.Info.NestedTypes |> List.map ( fun t -> { ParentName = n.Info.Name; ParentUrlName = n.Info.UrlName; NamespaceName = n.NamespaceName; NamespaceUrlName = n.NamespaceUrlName; Info = t}) )
58+ ]
59+ let entities = {
60+ Label = label
61+ Modules = allModules
62+ Types = allTypes
63+ GeneratorOutput = output
64+ }
65+ siteContent.Add entities
66+ printfn " generated api ref for %s at %s " label dll
6967
7068 siteContent
0 commit comments