forked from forki/NaturalSpec
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.fsx
102 lines (86 loc) · 2.94 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
#I "tools\FAKE"
#r "FakeLib.dll"
open Fake
// properties
let projectName = "NaturalSpec"
let buildDir = @".\build\"
let docDir = @".\Doc\"
let deployDir = @".\deploy\"
let testDir = @".\test\"
let nunitPath = @".\Tools\NUnit"
// files
let AppReferences = !+ @"src\app\**\*.*proj" |> Scan
let TestReferences = !+ @"src\test\**\*.*proj" |> Scan
let outputAssemblies =
!+ (buildDir + @"\**\*.dll")
++ (buildDir + @"\**\*.exe")
-- @"\**\*SharpZipLib*"
-- @"\**\*SharpSvn*"
-- "**/nunit.framework.dll"
|> Scan
|> Seq.map FullName
let testAssemblies =
!+ (testDir + @"\Spec.*.dll")
++ (testDir + @"\KnightMoves.dll")
|> Scan
// Targets
Target? Clean <-
fun _ -> CleanDirs [buildDir; deployDir; testDir; docDir]
Target? BuildApp <-
fun _ ->
if not isLocalBuild then
AssemblyInfo
(fun p ->
{p with
CodeLanguage = FSharp;
AssemblyVersion = buildVersion;
AssemblyTitle = "NaturalSpec";
AssemblyDescription = "NaturalSpec is a .NET UnitTest framework which provides automatically testable specs in natural language.";
Guid = "62F3EDB4-1ED9-415c-A349-510DF60380B5";
OutputFileName = @".\src\app\NaturalSpec\AssemblyInfo.fs"})
MSBuildRelease buildDir "Build" AppReferences
|> Log "AppBuild-Output: "
Target? BuildTest <-
fun _ ->
MSBuildDebug testDir "Build" TestReferences
|> Log "TestBuild-Output: "
Target? Test <-
fun _ ->
NUnit (fun p ->
{p with
ToolPath = nunitPath;
DisableShadowCopy = true;
OutputFile = testDir + @"TestResults.xml"})
testAssemblies
Target? GenerateDocumentation <-
fun _ ->
Docu (fun p ->
{p with
ToolPath = @".\tools\FAKE\docu.exe"
TemplatesPath = @".\tools\FAKE\templates"
OutputPath = docDir })
(buildDir + "NaturalSpec.dll")
Target? BuildZip <-
fun _ ->
let artifacts = !+ (buildDir + "\**\*.*") -- "*.zip" |> Scan
let zipFileName = deployDir + sprintf "%s-%s.zip" projectName buildVersion
Zip buildDir zipFileName artifacts
Target? ZipDocumentation <-
fun _ ->
let docFiles =
!+ (docDir + @"\**\*.*")
|> Scan
let zipFileName = deployDir + sprintf "Documentation-%s.zip" buildVersion
Zip @".\Doc\" zipFileName docFiles
Target? Default <- DoNothing
Target? Deploy <- DoNothing
// Dependencies
For? BuildApp <- Dependency? Clean
For? Test <- Dependency? BuildApp |> And? BuildTest
For? GenerateDocumentation <- Dependency? BuildApp
For? ZipDocumentation <- Dependency? GenerateDocumentation
For? BuildZip <- Dependency? Test
For? Deploy <- Dependency? BuildZip |> And? ZipDocumentation
For? Default <- Dependency? Deploy
// start build
Run? Default