-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.fsx
62 lines (47 loc) · 1.41 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
#r "./packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Testing
open Fake.AssemblyInfoFile
open FSharp.Data
let buildDir = "." @@ "build"
let testDir = buildDir @@ "test"
let releaseNotes = ReadFile "release-notes.md" |> ReleaseNotesHelper.parseReleaseNotes
Target "SetVersion" (fun _ ->
trace <| sprintf "Setting version %s" releaseNotes.AssemblyVersion
CreateFSharpAssemblyInfo ("." @@ "Cursed.Base" @@ "AssemblyInfo.fs") [Attribute.Version releaseNotes.AssemblyVersion]
CreateFSharpAssemblyInfo ("." @@ "Cursed" @@ "AssemblyInfo.fs") [Attribute.Version releaseNotes.AssemblyVersion]
)
Target "Clean" (fun _ ->
CleanDirs [ testDir; buildDir ]
)
Target "Build" (fun _ ->
ensureDirectory buildDir
["./Cursed/Cursed.fsproj"]
|> MSBuildRelease buildDir "Build"
|> ignore
["./Cursed.sln"]
|> MSBuildDebug testDir "Build"
|> ignore
)
Target "UnitTests" (fun _ ->
!! (testDir + "/*.Tests.dll")
|> NUnit3 id
)
Target "Pack" (fun _ ->
let files =
!! ("*.exe") ++ ("*.dll") ++ ("*.config")
|> SetBaseDir buildDir
CreateZipOfIncludes (sprintf "Cursed_%s.zip" releaseNotes.AssemblyVersion) "" 0 [ "", files ]
)
Target "Debug" (fun _ ->
ensureDirectory buildDir
["./Cursed/Cursed.fsproj"]
|> MSBuildDebug buildDir "Build"
|> ignore
)
"Clean"
==> "SetVersion"
==> "Build"
==> "UnitTests"
==> "Pack"
RunTargetOrDefault "Pack"