-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.fsx
65 lines (48 loc) · 1.77 KB
/
build.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// --------------------------------------------------------------------------------------
// FAKE build script
// --------------------------------------------------------------------------------------
#I "packages/FAKE/tools"
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Git
open Fake.AssemblyInfoFile
open Fake.ReleaseNotesHelper
open System
open System.IO
// --------------------------------------------------------------------------------------
// Read release notes & version info from RELEASE_NOTES.md
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let gitHome = "https://github.com/mbraceproject"
let gitName = "mbrace-docs"
// --------------------------------------------------------------------------------------
// Clean
Target "Clean" (fun _ ->
CleanDirs [ "docs/output" ; "temp" ]
)
// --------------------------------------------------------------------------------------
// documentation
Target "GenerateDocs" (fun _ ->
executeFSIWithArgs "docs/tools" "generate.fsx" ["--define:RELEASE"] [] |> ignore
)
Target "ReleaseDocs" (fun _ ->
let tempDocsDir = "temp/gh-pages"
CleanDir tempDocsDir
Repository.cloneSingleBranch "" (gitHome + "/" + gitName + ".git") "gh-pages" tempDocsDir
fullclean tempDocsDir
CopyRecursive "docs/output" tempDocsDir true |> tracefn "%A"
StageAll tempDocsDir
Commit tempDocsDir (sprintf "Update generated documentation.")
Branches.push tempDocsDir
)
// --------------------------------------------------------------------------------------
// Run all targets by default. Invoke 'build <Target>' to override
Target "Default" DoNothing
Target "Release" DoNothing
"Clean"
==> "GenerateDocs"
==> "Default"
"Default"
==> "ReleaseDocs"
==> "Release"
//// start build
RunTargetOrDefault "Default"