-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.fsx
51 lines (39 loc) · 1.34 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
#r "paket: groupref FakeBuild //"
#load ".fake/build.fsx/intellisense.fsx"
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.Core.TargetOperators
let [<Literal>] ProjectFilePath = "src/aver/aver.fsproj"
let [<Literal>] TestProjectFilePath = "test/aver.test/aver.test.fsproj"
let [<Literal>] ProjectDirPath = "src/aver/"
let [<Literal>] TestProjectDirPath = "test/aver.test/"
let [<Literal>] SolutonFile = "aver.sln"
let [<Literal>] OutputDir = "bin/Release"
Target.create "Clean" <| fun _ ->
[ ProjectDirPath + "/bin"
ProjectDirPath + "/obj"
TestProjectDirPath + "/bin"
TestProjectDirPath + "/obj" ]
|> Shell.deleteDirs
Target.create "Restore" <| fun _ ->
let setParams (defaults: DotNet.RestoreOptions) =
{ defaults with
NoCache = true }
DotNet.restore setParams SolutonFile
Target.create "Build" <| fun _ ->
let setParams (defaults: DotNet.BuildOptions) =
{ defaults with
Configuration = DotNet.BuildConfiguration.Release
OutputPath = Some OutputDir }
DotNet.build setParams ProjectFilePath
Target.create "Test" <| fun _ ->
let setParams (defaults: DotNet.TestOptions) =
{ defaults with
NoRestore = true }
DotNet.test setParams TestProjectFilePath
"Clean"
==> "Restore"
==> "Build"
==> "Test"
Target.runOrDefault "Test"