forked from phatboyg/Fooidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
86 lines (73 loc) · 2.11 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
#r @"src/packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
open Fake.FileSystem
let buildMode = "Release";
let VERSION = "0.1.0.0"
type BuildInfo = {
product: string;
description: string;
mode: string;
testDlls: FileIncludes;
integrationDlls: FileIncludes;
solutions: FileIncludes;
output: string;
artifacts: string;
}
let props = {
product="Fooidity";
description="An implementation switching library"
mode=buildMode;
output="build_output";
artifacts="build_artifacts";
testDlls= !! (sprintf "./**/bin/%s/*.Tests.dll" buildMode);
integrationDlls= !! (sprintf "./**/bin/%s/*.IntegrationTests.dll" buildMode);
solutions= !! ("./src/*.sln");
}
let nunit = findToolFolderInSubPath "nunit-console.exe" "src/packages/nunit.runners"
Target "Build" (fun _ ->
CreateCSharpAssemblyInfo "./src/SolutionVersion.cs"
[Attribute.Title props.product
Attribute.Description props.description
Attribute.Guid "A539B42C-CB9F-4a23-8E57-AF4E7CEE5BAD"
Attribute.Product props.product
Attribute.Version VERSION
Attribute.FileVersion VERSION]
MSBuild null "Build" ["Configuration", props.mode] props.solutions
|> Log "AppBuild-Output"
)
Target "Test-Unit" (fun _ ->
props.testDlls
|> NUnit (fun p ->
{p with
DisableShadowCopy = true;
ToolPath = nunit;
Framework = "net-4.5";
OutputFile = "TestResults.xml"})
)
Target "Go" (fun _ ->
trace "go"
)
Target "Clean" (fun _ ->
[props.output; props.artifacts]
|> List.iter FileHelper.CleanDir
)
Target "NuGet" (fun _ ->
NuGet (fun p ->
{p with
Authors = ["Chris Patterson"]
Project = props.product
Description = props.description
OutputPath = props.output
Summary = props.description
WorkingDir = ""
Version = VERSION
AccessKey = ""
Publish = false })
"Fooidity.nuspec"
)
"Build"
==> "Test-Unit"
==> "Go"
// start build
RunTargetOrDefault "Go"