-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
101 lines (85 loc) · 2.93 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
#I "tools/FAKE"
#r "FakeLib.dll"
open Fake
open Fake.Git
open System.Linq
open System.Text.RegularExpressions
open System.IO
(* properties *)
let authors = ["Steffen Forkmann"; "Katarina Forkmann"]
let projectName = "AskMeItems"
let copyright = "Copyright - AskMeItems 2011"
(* Directories *)
let buildDir = @".\Build\"
let packagesDir = @".\packages\"
let docsDir = buildDir + @"Documentation\"
let testOutputDir = buildDir + @"Specs\"
let testDir = buildDir
let deployDir = @".\Release\"
(* files *)
let appReferences = !! @".\src\**\*.csproj"
(* flavours *)
let MSpecVersion = GetPackageVersion packagesDir "Machine.Specifications"
(* Targets *)
Target "Clean" (fun _ -> CleanDirs [buildDir; testDir; deployDir; docsDir; testOutputDir] )
Target "BuildApp" (fun _ ->
if not isLocalBuild then
AssemblyInfo
(fun p ->
{p with
CodeLanguage = CSharp;
AssemblyVersion = buildVersion;
AssemblyTitle = "AskMeItems.Model";
AssemblyDescription = "AskMeItems is a little questionnaire presenter and can be used for scientific studies.";
AssemblyCopyright = copyright;
Guid = "8cb588ea-29dd-4f12-9c1c-eb30ad1f7293";
OutputFileName = @".\src\app\AskMeItems.Model\Properties\AssemblyInfo.cs"})
AssemblyInfo
(fun p ->
{p with
CodeLanguage = CSharp;
AssemblyVersion = buildVersion;
AssemblyTitle = "AskMeItems.WPF";
AssemblyDescription = "AskMeItems is a little questionnaire presenter and can be used for scientific studies.";
AssemblyCopyright = copyright;
Guid = "03d98032-b4d0-463e-b87d-c9b82997c62b";
OutputFileName = @".\src\app\AskMeItems.WPF\Properties\AssemblyInfo.cs"})
appReferences
|> MSBuildRelease buildDir "Build"
|> Log "AppBuild-Output: "
)
Target "Test" (fun _ ->
ActivateFinalTarget "DeployTestResults"
!+ (testDir + "/*.Specs.dll")
++ (testDir + "/*.Examples.dll")
|> Scan
|> MSpec (fun p ->
{p with
ToolPath = sprintf @".\packages\Machine.Specifications.%s\tools\mspec-clr4.exe" MSpecVersion
HtmlOutputDir = testOutputDir})
)
FinalTarget "DeployTestResults" (fun () ->
!+ (testOutputDir + "\**\*.*")
|> Scan
|> Zip testOutputDir (sprintf "%sMSpecResults.zip" deployDir)
)
Target "BuildZip" (fun _ ->
!+ (buildDir + "/**/*.*")
-- "**/*.zip"
-- "**/*.pdb"
-- "**/*Spec*"
-- "**/Specs/**"
|> Scan
|> Zip buildDir (deployDir + sprintf "%s-%s.zip" projectName buildVersion)
)
Target "Default" DoNothing
Target "Deploy" DoNothing
// Build order
"Clean"
==> "BuildApp"
==> "Test"
==> "BuildZip"
==> "Deploy"
==> "Default"
// start build
RunParameterTargetOrDefault "target" "Default"