-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathbuild.fsx
69 lines (54 loc) · 1.94 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
#r "paket: groupref Build //"
#load "./.fake/build.fsx/intellisense.fsx"
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
Target.create "Clean" (fun _ ->
Shell.cleanDirs ["bin"; "temp"]
)
Target.create "CleanDocs" (fun _ ->
Shell.cleanDirs ["docs/output"]
)
// --------------------------------------------------------------------------------------
// Build library & test project
Target.create "BuildNetFramework" (fun _ ->
//Need to restore for .NET Standard
let workingDir = Path.getFullName "src/IfSharp.Kernel"
let result =
DotNet.exec (DotNet.Options.withWorkingDirectory workingDir) "restore" ""
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s messages: %A" "restore" __SOURCE_DIRECTORY__ result.Messages
let setParams (defaults:MSBuildParams) =
{ defaults with
DisableInternalBinLog = true
Verbosity = Some(MSBuildVerbosity.Detailed)
Targets = ["Build"]
Properties =
[
"Optimize", "True"
"DebugSymbols", "True"
"Configuration", "Release"
]
}
MSBuild.build setParams "IfSharp.sln"
)
Target.create "BuildNetCore" (fun _ ->
let workingDir = Path.getFullName "src/IfSharpNetCore"
let result =
DotNet.exec (DotNet.Options.withWorkingDirectory __SOURCE_DIRECTORY__) "build" "IfSharpNetCore.sln"
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s messages: %A" "build" workingDir result.Messages
)
// --------------------------------------------------------------------------------------
// Run all targets by default. Invoke 'build <Target>' to override
Target.create "All" ignore
"Clean"
==> "BuildNetCore"
"Clean"
==> "BuildNetFramework"
"BuildNetCore"
==> "All"
"BuildNetFramework"
==> "All"
Target.runOrDefault "All"