forked from x97mdr/pickles
-
Notifications
You must be signed in to change notification settings - Fork 164
/
build.fsx
103 lines (84 loc) · 2.64 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
// 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: "
)
Target "BuildMsBuild" (fun _ ->
!! "src/Pickles/Pickles.MsBuild/Pickles.MsBuild.csproj"
|> MSBuildRelease msBuildDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildPowerShell" (fun _ ->
!! "src/Pickles/Pickles.PowerShell/Pickles.PowerShell.csproj"
|> MSBuildRelease powerShellDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildGui" (fun _ ->
!! "src/Pickles/Pickles.UserInterface/Pickles.UserInterface.csproj"
|> MSBuildRelease guiDir "Build"
|> Log "AppBuild-Output: "
)
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: "
)
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"
==> "Zip"
==> "Default"
// start build
RunTargetOrDefault "Default"