-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmyscript.fsx
57 lines (47 loc) · 1.2 KB
/
myscript.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
#r "paket: groupref Build //"
#load "./.fake/myscript.fsx/intellisense.fsx"
open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.DotNet
open Fake.Core
// Properties
let buildDir = "./build/"
let testDir = "./test/"
// Targets
Target.create "Clean" (fun _ ->
Shell.cleanDirs [buildDir; testDir]
)
Target.create "RestoreApp" (fun _ ->
!! "src/**/*.csproj"
|> MSBuild.runRelease id buildDir "Restore"
|> ignore
)
Target.create "BuildApp" (fun _ ->
let setParams (defaults:MSBuildParams) =
{ defaults with
Verbosity = Some(Quiet)
Targets = ["Publish"]
Properties =
[
"Optimize", "True"
"TargetFramework", "net6.0"
"Configuration", "Release"
]
}
MSBuild.build setParams "src/app/app.csproj"
)
Target.create "BuildTest" (fun _ ->
!! "src/test/**/*.csproj"
|> MSBuild.runDebug id testDir "Build"
|> Trace.logItems "TestBuild-Output: "
)
Target.create "Default" (fun _ ->
Trace.trace "Hello World from FAKE"
)
open Fake.Core.TargetOperators
"Clean"
==> "RestoreApp"
==> "BuildApp"
==> "Default"
// start build
Target.runOrDefault "BuildApp"