forked from fsprojects/FAKE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTMLHelpWorkShopHelper.fs
More file actions
24 lines (21 loc) · 1.11 KB
/
Copy pathHTMLHelpWorkShopHelper.fs
File metadata and controls
24 lines (21 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[<AutoOpen>]
/// Contains a task which allows to use [HTML Help Workshop](http://msdn.microsoft.com/en-us/library/windows/desktop/ms670169(v=vs.85).aspx) in order to compile a help project.
module Fake.HTMLHelpWorkShopHelper
open System
/// Uses the HTML Help Workshop to compile a help project and returns the generated file names of the generated files.
/// ## Parameters
///
/// - `helpCompiler` - The filename of the HTML Help WorkShop tool.
/// - `projectFile` - The fileName of the help project.
let CompileHTMLHelpProject helpCompiler projectFile =
traceStartTask "HTMLHelpWorkshop" projectFile
let fi = new IO.FileInfo(projectFile)
if not fi.Exists then invalidArg "projectFile" "Projectfile doesn't exist."
if ExecProcess (fun info ->
info.FileName <- helpCompiler
info.Arguments <- fi.FullName |> toParam ) System.TimeSpan.MaxValue <> 1
then failwith "Error in HTML Help Workshop"
let name = fi.Name.Split('.').[0]
traceEndTask "HTMLHelpWorkshop" projectFile
[ fi.Directory.FullName @@ sprintf "%s.chm" name
fi.Directory.FullName @@ sprintf "%s.hh" name]