@@ -46,16 +46,25 @@ module TemporaryDocumentationHelpers =
46
46
FsiEval : bool }
47
47
48
48
49
- let private run toolPath command =
50
- if 0 <> Process.execSimple (( fun info ->
51
- { info with
52
- FileName = toolPath
53
- Arguments = command }) >> Process.withFramework) System.TimeSpan.MaxValue
49
+ let private run toolPath arguments =
50
+ Command.RawCommand
51
+ (
52
+ toolPath,
53
+ arguments
54
+ )
55
+ |> CreateProcess.fromCommand
56
+ |> CreateProcess.withFramework
57
+ |> CreateProcess.ensureExitCode
58
+ |> Proc.run
59
+ |> ignore
54
60
55
- then failwithf " FSharp.Formatting %s failed." command
56
61
57
62
let createDocs p =
58
- let toolPath = Tools.findToolInSubPath " fsformatting.exe" ( Directory.GetCurrentDirectory() @@ " lib/Formatting" )
63
+ let toolPath =
64
+ match ProcessUtils.tryFindLocalTool " " " fsformatting.exe" [( Directory.GetCurrentDirectory() @@ " /lib" )] with
65
+ | Some tool -> tool
66
+ | _ -> failwith " FSFormatting executable not found"
67
+ //let toolPath = Tools.findToolInSubPath "fsformatting.exe" (Directory.GetCurrentDirectory() @@ "lib/Formatting")
59
68
60
69
let defaultLiterateArguments =
61
70
{ ToolPath = toolPath
@@ -82,10 +91,7 @@ module TemporaryDocumentationHelpers =
82
91
|> Seq.append
83
92
([ " literate" ; " --processdirectory" ] @ layoutroots @ [ " --inputdirectory" ; source; " --templatefile" ; template;
84
93
" --outputDirectory" ; outputDir] @ fsiEval @ [ " --replacements" ])
85
- |> Seq.map ( fun s ->
86
- if s.StartsWith " \" " then s
87
- else sprintf " \" %s \" " s)
88
- |> String.separated " "
94
+ |> Arguments.OfArgs
89
95
run arguments.ToolPath command
90
96
printfn " Successfully generated docs for %s " source
91
97
@@ -139,6 +145,8 @@ let gitRaw = Environment.environVarOrDefault "gitRaw" "https://raw.githubusercon
139
145
140
146
let website = " /FSharp.Plotly"
141
147
148
+ let pkgDir = " pkg"
149
+
142
150
// --------------------------------------------------------------------------------------
143
151
// END TODO: The rest of the file includes standard build steps
144
152
// --------------------------------------------------------------------------------------
@@ -243,23 +251,18 @@ Target.create "Build" (fun _ ->
243
251
Target.create " RunTests" ( fun _ ->
244
252
let assemblies = !! testAssemblies
245
253
246
- let setParams f =
247
- match Environment.isWindows with
248
- | true ->
249
- fun p ->
250
- { p with
251
- FileName = f}
252
- | false ->
253
- fun p ->
254
- { p with
255
- FileName = " mono"
256
- Arguments = f }
257
254
assemblies
258
- |> Seq.map ( fun f ->
259
- Process.execSimple ( setParams f) System.TimeSpan.MaxValue
255
+ |> Seq.iter ( fun f ->
256
+ Command.RawCommand (
257
+ f,
258
+ Arguments.OfArgs []
259
+ )
260
+ |> CreateProcess.fromCommand
261
+ |> CreateProcess.withFramework
262
+ |> CreateProcess.ensureExitCode
263
+ |> Proc.run
264
+ |> ignore
260
265
)
261
- |> Seq.reduce (+)
262
- |> ( fun i -> if i > 0 then failwith " " )
263
266
)
264
267
265
268
// --------------------------------------------------------------------------------------
@@ -268,10 +271,11 @@ Target.create "RunTests" (fun _ ->
268
271
Target.create " NuGet" ( fun _ ->
269
272
Paket.pack( fun p ->
270
273
{ p with
271
- OutputPath = " bin"
274
+ ToolType = ToolType.CreateLocalTool()
275
+ OutputPath = pkgDir
272
276
Version = release.NugetVersion
273
- ReleaseNotes = String.toLines release.Notes })
274
- )
277
+ ReleaseNotes = release.Notes |> String.toLines })
278
+ )
275
279
276
280
Target.create " PublishNuget" ( fun _ ->
277
281
Paket.push( fun p ->
@@ -366,8 +370,8 @@ Target.create "Docs" (fun _ ->
366
370
Shell.rename " docsrc/content/release-notes.md" " docsrc/content/RELEASE_NOTES.md"
367
371
368
372
File.delete " docsrc/content/license.md"
369
- Shell.copyFile " docsrc/content/" " LICENSE.txt "
370
- Shell.rename " docsrc/content/license.md" " docsrc/content/LICENSE.txt "
373
+ Shell.copyFile " docsrc/content/" " LICENSE"
374
+ Shell.rename " docsrc/content/license.md" " docsrc/content/LICENSE"
371
375
372
376
373
377
DirectoryInfo.getSubDirectories ( DirectoryInfo.ofPath templates)
0 commit comments