-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
98 lines (81 loc) · 2.88 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
#r @"FsPrettyTable/packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Git
RestorePackages()
let authors = ["Torbjørn Marø"]
let projectName = "FsPrettyTable"
let projectDescription = "Represent tabular data in visually appealing ASCII tables using F#"
let projectSummary = projectDescription // TODO: write a summary
let buildDir = "./build/"
let testDir = "./test/"
let packagingRoot = "./packaging/"
let packagingDir = packagingRoot @@ "FsPrettyTable"
let releaseNotes =
ReadFile "ReleaseNotes.md"
|> ReleaseNotesHelper.parseReleaseNotes
let commitHash = Information.getCurrentSHA1 "."
// Targets
Target "Clean" (fun _ ->
CleanDirs [buildDir; testDir; packagingRoot; packagingDir]
)
open Fake.AssemblyInfoFile
Target "AssemblyInfo" (fun _ ->
CreateFSharpAssemblyInfo "FsPrettyTable/AssemblyInfo.fs"
[ Attribute.Product projectName
Attribute.Description projectDescription
Attribute.Version releaseNotes.AssemblyVersion
Attribute.FileVersion releaseNotes.AssemblyVersion
Attribute.Metadata("githash", commitHash)
Attribute.ComVisible false ]
)
Target "BuildLib" (fun _ ->
!! "FsPrettyTable/**/*.fsproj"
|> MSBuildRelease buildDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTests" (fun _ ->
!! "FsPrettyTable.Tests/**/*.fsproj"
|> MSBuildDebug testDir "Build"
|> Log "TestBuild-Output: "
)
Target "Test" (fun _ ->
!! (testDir + "/*.Tests.dll")
|> NUnit (fun p ->
{p with
DisableShadowCopy = true
ToolPath = @"C:\Program Files (x86)\NUnit 2.6.4\bin\"
OutputFile = testDir + "TestResults.xml" })
)
Target "CreatePackage" (fun _ ->
CopyFile packagingDir (buildDir @@ "FsPrettyTable.dll")
CopyFile packagingDir (buildDir @@ "FsPrettyTable.pdb")
CopyFile packagingDir (buildDir @@ "FsPrettyTable.XML")
CopyFiles packagingDir ["LICENSE"; "README.md"; "ReleaseNotes.md"]
NuGet (fun p ->
{p with
Authors = authors
Project = projectName
Description = projectDescription
OutputPath = packagingRoot
Summary = projectSummary
WorkingDir = packagingDir
Version = releaseNotes.AssemblyVersion
ReleaseNotes = toLines releaseNotes.Notes
Files = [("FsPrettyTable.dll", Some @"lib\net45\", None)
("FsPrettyTable.pdb", Some @"lib\net45\", None)
("FsPrettyTable.XML", Some @"lib\net45\", None)
("LICENSE", None, None)
("README.md", None, None)
("ReleaseNotes.md", None, None)]
Publish = false })
"FsPrettyTable.nuspec"
)
Target "Default" DoNothing
"Clean"
==> "AssemblyInfo"
==> "BuildLib"
==> "BuildTests"
==> "Test"
==> "CreatePackage"
==> "Default"
RunTargetOrDefault "Default"