diff --git a/.gitignore b/.gitignore
index 7c02228a..00c7a87f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ _TeamCity*
*.aps
*.opensdf
*.cachefile
+*.swp
# Upgrades
_UpgradeReport_Files/
diff --git a/build.fsx b/build.fsx
index ad5529b1..328c816c 100644
--- a/build.fsx
+++ b/build.fsx
@@ -750,15 +750,41 @@ let provideDocExtraFiles() =
ReadFileAsString fileName ]
|> ReplaceFile ("docs/content" > docName)
+let buildDocumentationTarget fsiargs target =
+ trace (sprintf "Building documentation (%s), this could take some time, please wait..." target)
+ let fakePath = "packages" @@ "FAKE" @@ "tools" @@ "FAKE.exe"
+ let fakeStartInfo script workingDirectory args fsiargs environmentVars =
+ (fun (info: System.Diagnostics.ProcessStartInfo) ->
+ info.FileName <- System.IO.Path.GetFullPath fakePath
+ info.Arguments <- sprintf "%s --fsiargs -d:FAKE %s \"%s\"" args fsiargs script
+ info.WorkingDirectory <- workingDirectory
+ let setVar k v =
+ info.EnvironmentVariables.[k] <- v
+ for (k, v) in environmentVars do
+ setVar k v
+ setVar "MSBuild" msBuildExe
+ setVar "GIT" Git.CommandHelper.gitPath
+ setVar "FSI" fsiPath)
+ let executeFAKEWithOutput workingDirectory script fsiargs envArgs =
+ let exitCode =
+ ExecProcessWithLambdas
+ (fakeStartInfo script workingDirectory "" fsiargs envArgs)
+ TimeSpan.MaxValue false ignore ignore
+ System.Threading.Thread.Sleep 1000
+ exitCode
+ let exit = executeFAKEWithOutput "docs/tools" "build-docs.fsx" fsiargs ["target", target]
+ if exit <> 0 then
+ failwith "Generating documentation failed"
+ ()
+
let generateDocs fail local =
- let args = if local then [] else ["--define:RELEASE"]
- if executeFSIWithArgs "docs/tools" "build-docs.fsx" args [] then
- traceImportant "Docs generated"
- else
- if fail then
- failwith "Generating documentation failed"
- else
- traceImportant "generating documentation failed"
+ let args = if local then "" else "--define:RELEASE"
+ try
+ buildDocumentationTarget args "Default"
+ traceImportant "Documentation generated"
+ with
+ | e when not fail ->
+ failwith "Generating documentation failed"
Target "Docs" (fun _ ->
provideDocExtraFiles ()
diff --git a/docs/tools/build-docs.fsx b/docs/tools/build-docs.fsx
index 1ab826e6..9540a5b0 100644
--- a/docs/tools/build-docs.fsx
+++ b/docs/tools/build-docs.fsx
@@ -60,7 +60,7 @@ let layoutRoots =
let copyFiles() =
CopyRecursive files output true |> Log "Copying file: "
ensureDirectory (output @@ "content")
- CopyRecursive (formatting @@ "styles") (output @@ "content") true
+ CopyRecursive (formatting @@ "styles") (output @@ "content") true
|> Log "Copying styles and scripts: "
// Build API reference from XML comments
diff --git a/docs/tools/templates/template.cshtml b/docs/tools/templates/template.cshtml
index d4df7824..873282d6 100644
--- a/docs/tools/templates/template.cshtml
+++ b/docs/tools/templates/template.cshtml
@@ -37,7 +37,7 @@