forked from panesofglass/VegaHub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.fsx
93 lines (76 loc) · 2.49 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#if BOOT
open Fake
module FB = Fake.Boot
FB.Prepare {
FB.Config.Default __SOURCE_DIRECTORY__ with
NuGetDependencies =
let (!!) x = FB.NuGetDependency.Create x
[
!!"FAKE"
!!"NuGet.Build"
!!"NuGet.Core"
!!"NUnit.Runners"
]
}
#endif
#load ".build/boot.fsx"
open System.IO
open Fake
open Fake.AssemblyInfoFile
open Fake.MSBuild
(* properties *)
let projectName = "VegaHub"
let version = if isLocalBuild then "2.0." + System.DateTime.UtcNow.ToString("yMMdd") else buildVersion
let projectSummary = "A self-hosted SignalR hub utility for pushing Vega specs to a browser window from F# Interactive."
let projectDescription = "A self-hosted SignalR hub utility for pushing Vega specs to a browser window from F# Interactive."
let authors = ["Ryan Riley"; "Mathias Brandewinder"]
let mail = "[email protected]"
let homepage = "https://github.com/panesofglass/VegaHub"
(* Directories *)
let buildDir = __SOURCE_DIRECTORY__ @@ "build"
let deployDir = __SOURCE_DIRECTORY__ @@ "deploy"
let packagesDir = __SOURCE_DIRECTORY__ @@ "packages"
let sources = __SOURCE_DIRECTORY__ @@ "src"
(* tools *)
let nugetPath = ".nuget/NuGet.exe"
let RestorePackageParamF =
fun (p: RestorePackageParams) ->
{ p with
ToolPath = nugetPath
Sources = []
TimeOut = System.TimeSpan.FromMinutes 5.
OutputPath = "./packages"
} :Fake.RestorePackageHelper.RestorePackageParams
let RestorePackages2() =
!! "./**/packages.config"
|> Seq.iter (RestorePackage RestorePackageParamF)
RestorePackages2()
(* files *)
let appReferences = !! "src/**/*.fsproj"
(* Targets *)
Target "Clean" (fun _ ->
CleanDirs [buildDir; deployDir]
)
Target "BuildApp" (fun _ ->
if not isLocalBuild then
[ Attribute.Version(version)
Attribute.Title(projectName)
Attribute.Description(projectDescription)
Attribute.Guid("50151d7a-5e87-4535-8150-2f63a68d0040")
]
|> CreateFSharpAssemblyInfo "src/AssemblyInfo.fs"
MSBuildRelease buildDir "Build" appReferences
|> Log "AppBuild-Output: "
)
Target "CopyLicense" (fun _ ->
[ "LICENSE.txt" ] |> CopyTo buildDir
)
Target "Deploy" DoNothing
Target "Default" DoNothing
(* Build Order *)
"Clean"
==> "BuildApp" <=> "CopyLicense"
==> "Deploy"
"Default" <== ["Deploy"]
// start build
RunTargetOrDefault "Default"