forked from SDVentures/Contour
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
97 lines (78 loc) · 2.74 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#r "paket:
nuget Fake.IO.FileSystem
nuget Fake.DotNet.AssemblyInfoFile
nuget Fake.DotNet.Cli
nuget Fake.DotNet.Testing.NUnit
nuget Fake.DotNet.Paket
nuget Fake.Core.Target
nuget Fake.Core.ReleaseNotes //"
#load "./.fake/build.fsx/intellisense.fsx"
open Fake.DotNet
open Fake.DotNet.Testing
open Fake.Core
open Fake.Core.TargetOperators
open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.IO.FileSystemOperators
System.Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let project = "Contour"
let authors = [ "Mikhail Zabolotko" ]
let summary = "A library contains implementation of several EIP patterns to build the service bus."
let description = """
The package contains abstract interfaces of service bus and specific transport implementation for AMQP/RabbitMQ."""
let license = "MIT License"
let tags = "rabbitmq client servicebus"
let release = ReleaseNotes.parse (System.IO.File.ReadLines "RELEASE_NOTES.md")
let tempDir = "temp"
let solution = "Contour.sln"
let tests =
!! "Tests/**/*.csproj"
Target.create "CleanUp" (fun _ ->
Shell.cleanDirs [ tempDir ]
)
Target.create "AssemblyInfo" (fun _ ->
if not BuildServer.isLocalBuild then
let info =
[ AssemblyInfo.Title project
AssemblyInfo.Company (authors |> String.concat ",")
AssemblyInfo.Product project
AssemblyInfo.Description summary
AssemblyInfo.Version release.AssemblyVersion
AssemblyInfo.FileVersion release.AssemblyVersion
AssemblyInfo.InformationalVersion release.NugetVersion
AssemblyInfo.Copyright license ]
AssemblyInfoFile.createCSharp <| "./Sources/" @@ project @@ "/Properties/AssemblyInfo.cs" <| info
)
Target.create "Build" (fun _ ->
solution |> DotNet.build (fun p -> { p with Configuration = DotNet.BuildConfiguration.Release })
)
Target.create "RunUnitTests" (fun _ ->
!! "Tests/**/bin/Release/*Common.Tests.dll"
|> NUnit.Sequential.run (fun p ->
{ p with
DisableShadowCopy = false
OutputFile = "TestResults.xml"
TimeOut = System.TimeSpan.FromMinutes 20. })
)
Target.create "RunAllTests" (fun _ ->
!! "Tests/**/bin/Release/*.Tests.dll"
|> NUnit.Sequential.run (fun p ->
{ p with
DisableShadowCopy = false
OutputFile = "TestResults.xml"
TimeOut = System.TimeSpan.FromMinutes 20. })
)
Target.create "BuildPacket" (fun _ ->
Paket.pack (fun p ->
{ p with
Version = release.NugetVersion })
)
Target.create "Default" ignore
"CleanUp"
==> "AssemblyInfo"
==> "Build"
==> "RunUnitTests"
==> "RunAllTests"
==> "BuildPacket"
==> "Default"
Target.runOrDefault "Default"