-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.fsx
67 lines (44 loc) · 1.45 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
#load "./build/helpers.fsx"
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.Globbing.Operators
open Helpers
open Fake.Core.TargetOperators
initEnviroment ()
help "Run dotnet clean in everty project"
target "clean" (fun _ -> !! "**/bin" ++ "**/obj" |> Shell.cleanDirs)
help "Run dotnet build in every project"
target "build" (fun _ ->
solutionDir
|> DotNet.build (fun c ->
{ c with
Configuration = DotNet.BuildConfiguration.Release }))
help "Run dotnet restore in everty project"
target "restore" (fun _ ->
DotNet.restore id |> ignore
DotNet.exec id "tool restore" |> ignore)
help "Run all tests"
target "test" (fun ctx ->
!! "**/**.Tests*.*sproj"
|> printFiles ctx.TargetInfo.Name
|> Seq.iter dotnetTest)
help "Update all local tools"
target "update-tools" (run updateLocalTools)
help "Run all tests and generate coverage report"
target "report" (fun _ ->
generateCoverageReport ()
let explorer = if Environment.isWindows then "explorer" else "open"
Shell.Exec(explorer, Path.combine testReportFolder "index.htm") |> ignore)
help "just generate the coverage report"
target' "generate-report" generateCoverageReport
help "check code formatting with fantomas"
target "lint" (run fantomasCheck)
help "format code"
target "format" (run fantomasFormat)
"clean" ?=> "restore" ==> "build"
"build" ==> "test"
"test" ==> "report"
"restore" ==> "lint"
"restore" ==> "format"
runWithDefaultTarget "help"