forked from picklesdoc/pickles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
167 lines (136 loc) · 5.06 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// include Fake lib
#r @"packages\FAKE\tools\FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
// Properties
let buildDir = "./build/"
let cmdDir = "./build/exe/"
let msBuildDir = "./build/msbuild/"
let powerShellDir = "./build/powershell/"
let guiDir = "./build/gui/"
let testDir = "./test/"
let deployDir = "./deploy/"
// version info
let version = environVar "version" // or retrieve from CI server
// Targets
Target "Clean" (fun _ ->
CleanDirs [cmdDir; msBuildDir; powerShellDir; guiDir; buildDir; testDir; deployDir]
)
Target "AssemblyInfo" (fun _ ->
CreateCSharpAssemblyInfo "./src/Pickles/VersionInfo.cs"
[Attribute.Product "Pickles"
Attribute.Company "Pickles"
Attribute.Copyright "Copyright (c) Jeffrey Cameron 2010-2012, PicklesDoc 2012-present"
Attribute.Trademark ""
Attribute.Culture ""
Attribute.ComVisible false
Attribute.Version version
Attribute.FileVersion version]
)
Target "BuildCmd" (fun _ ->
!! "src/Pickles/Pickles.CommandLine/Pickles.CommandLine.csproj"
|> MSBuildRelease cmdDir "Build"
|> Log "AppBuild-Output: ";
CopyFiles cmdDir [ "./LICENSE.txt"; ];
)
Target "BuildMsBuild" (fun _ ->
!! "src/Pickles/Pickles.MsBuild/Pickles.MsBuild.csproj"
|> MSBuildRelease msBuildDir "Build"
|> Log "AppBuild-Output: ";
CopyFiles msBuildDir [ "./LICENSE.txt"; ];
)
Target "BuildPowerShell" (fun _ ->
!! "src/Pickles/Pickles.PowerShell/Pickles.PowerShell.csproj"
|> MSBuildRelease powerShellDir "Build"
|> Log "AppBuild-Output: ";
CopyFiles powerShellDir [ "./LICENSE.txt"; ];
)
Target "BuildGui" (fun _ ->
!! "src/Pickles/Pickles.UserInterface/Pickles.UserInterface.csproj"
|> MSBuildRelease guiDir "Build"
|> Log "AppBuild-Output: ";
CopyFiles guiDir [ "./LICENSE.txt"; ];
)
Target "BuildTest" (fun _ ->
!! "src/Pickles/Pickles.Test/Pickles.Test.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.TestFrameworks" (fun _ ->
!! "src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.DocumentationBuilders.Cucumber" (fun _ ->
!! "src/Pickles/Pickles.DocumentationBuilders.Cucumber.UnitTests/Pickles.DocumentationBuilders.Cucumber.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.DocumentationBuilders.Dhtml" (fun _ ->
!! "src/Pickles/Pickles.DocumentationBuilders.Dhtml.UnitTests/Pickles.DocumentationBuilders.Dhtml.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.DocumentationBuilders.Excel" (fun _ ->
!! "src/Pickles/Pickles.DocumentationBuilders.Excel.UnitTests/Pickles.DocumentationBuilders.Excel.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.DocumentationBuilders.Html" (fun _ ->
!! "src/Pickles/Pickles.DocumentationBuilders.Html.UnitTests/Pickles.DocumentationBuilders.Html.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.DocumentationBuilders.Json" (fun _ ->
!! "src/Pickles/Pickles.DocumentationBuilders.Json.UnitTests/Pickles.DocumentationBuilders.Json.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.DocumentationBuilders.Word" (fun _ ->
!! "src/Pickles/Pickles.DocumentationBuilders.Word.UnitTests/Pickles.DocumentationBuilders.Word.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.Runners.CommandLine" (fun _ ->
!! "src/Pickles/Pickles.CommandLine.UnitTests/Pickles.CommandLine.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest.Runners.UI" (fun _ ->
!! "src/Pickles/Pickles.UserInterface.UnitTests/Pickles.UserInterface.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)
let createZip (packageType : string) =
!! (buildDir + "/" + packageType + "/*.*") -- "*.zip"
|> Zip (buildDir + packageType) (deployDir + "Pickles-" + packageType + "-" + version + ".zip")
Target "Zip" (fun _ ->
createZip "exe"
createZip "gui"
createZip "msbuild"
createZip "powershell"
)
Target "Default" (fun _ ->
trace ("Starting build of Pickles version " + version)
)
// Dependencies
"Clean"
==> "AssemblyInfo"
==> "BuildCmd"
==> "BuildMsBuild"
==> "BuildPowerShell"
==> "BuildGui"
==> "BuildTest"
==> "BuildTest.TestFrameworks"
==> "BuildTest.DocumentationBuilders.Cucumber"
==> "BuildTest.DocumentationBuilders.Dhtml"
==> "BuildTest.DocumentationBuilders.Excel"
==> "BuildTest.DocumentationBuilders.Html"
==> "BuildTest.DocumentationBuilders.Json"
==> "BuildTest.DocumentationBuilders.Word"
==> "BuildTest.Runners.CommandLine"
==> "BuildTest.Runners.UI"
==> "Zip"
==> "Default"
// start build
RunTargetOrDefault "Default"