-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.fsx
105 lines (85 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
98
99
100
101
102
103
104
105
#r @"packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
open Fake.Git
open Fake.Testing.XUnit2
let binariesDir = "out/bin"
let nugetDir = "out/nuget"
let applicationProjects = !! "src/**/*.fsproj" ++ "src/**/*.csproj"
let testProjects = !! "test/**/*.fsproj" ++ "test/**/*.csproj"
let release = ReadFile "RELEASE_NOTES.md" |> ReleaseNotesHelper.parseReleaseNotes
MSBuildDefaults <- { MSBuildDefaults with Verbosity = Some MSBuildVerbosity.Minimal }
Target "Clean" (fun _ ->
CleanDirs <| !! "src/**/bin/Release"
CleanDirs <| !! "test/**/bin/Release"
CleanDirs [ binariesDir; nugetDir ]
)
Target "GenerateAssemblyInfo" (fun _ ->
CreateCSharpAssemblyInfo "src/SolutionInfo.cs" [
Attribute.Product "Journalist";
Attribute.Version release.AssemblyVersion;
Attribute.InformationalVersion release.AssemblyVersion;
Attribute.FileVersion release.AssemblyVersion;
Attribute.Company "Anton Mednonogov" ]
)
Target "BuildApp" (fun _ ->
MSBuildRelease null "Build" [ "./Journalist.sln" ] |> ignore
)
Target "CopyBuildResults" (fun _ ->
Copy binariesDir !! ("./src/**/bin/Release/*.dll")
Copy binariesDir !! ("./src/**/bin/Release/*.xml")
Copy binariesDir !! ("./src/**/bin/Release/*.pdb")
)
Target "RunUnitTests" (fun _ ->
!! ("./test/**/bin/Release/*.UnitTests.dll")
|> xUnit2 (fun p ->
{ p with ToolPath = "packages/xunit.runner.console/tools/xunit.console.exe" })
)
Target "RunIntegrationTests" (fun _ ->
!! ("./test/**/bin/Release/*.IntegrationTests.dll")
|> xUnit2 (fun p ->
{ p with ToolPath = "packages/xunit.runner.console/tools/xunit.console.exe" })
)
Target "CreatePackages" (fun _ ->
Paket.Pack (fun p ->
{ p with
OutputPath = nugetDir
Version = release.NugetVersion
IncludeReferencedProjects = true
ReleaseNotes = release.Notes |> toLines })
)
Target "PublishPackages" (fun _ ->
Paket.Push (fun p ->
{ p with
WorkingDir = nugetDir })
)
Target "Release" (fun _ ->
StageAll ""
Commit "" (sprintf "Bump version to %s" release.NugetVersion)
Branches.push ""
Branches.tag "" release.NugetVersion
Branches.pushTag "" "origin" release.NugetVersion
)
Target "Test" DoNothing
"Clean"
==> "BuildApp"
==> "RunUnitTests"
==> "RunIntegrationTests"
==> "Test"
Target "UnitTest" DoNothing
"Clean"
==> "BuildApp"
==> "RunUnitTests"
==> "UnitTest"
Target "Default" DoNothing
"Clean"
==> "GenerateAssemblyInfo"
==> "BuildApp"
==> "RunUnitTests"
==> "RunIntegrationTests"
==> "CopyBuildResults"
==> "CreatePackages"
==> "Default"
==> "PublishPackages"
==> "Release"
RunTargetOrDefault "Default"