forked from linn/Kinsky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
releaseMac.fsx
96 lines (74 loc) · 2.37 KB
/
releaseMac.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
// include Fake
#r @"fake/FAKE/tools/FakeLib.dll"
#load @"./Utils.fsx"
open Fake
open Fake.AssemblyInfoFile
open Linn.FakeTools
// get command line args
let nugetPath = getBuildParam "nugetpath"
let version = getBuildParam "version"
let quality = getBuildParam "quality"
let buildTag = getBuildParam "tag"
let isReleaseTag =
match buildTag with
| "" -> false
| _ -> Utils.ShouldPublishReleaseFromTag "Kinsky" buildTag || Utils.ShouldPublishReleaseFromTag "KinskyMac" buildTag
let buildVersion =
match isReleaseTag with
| false -> version
| _ -> Utils.ParseReleaseVersionFromTag buildTag
let buildQuality =
match isReleaseTag with
| false -> quality
| _ -> Utils.ParseBuildQualityFromTag buildTag
// Default target
Target "Default" (fun _ ->
trace "Default build"
)
// Clean
Target "Clean" (fun _ ->
CleanDirs [ "./packages"; "./build" ]
)
// Restore packages
Target "RestorePackages" (fun _ ->
"./KinskyMac.sln"
|> RestoreMSSolutionPackages(fun p ->
{
p with
ToolPath = nugetPath
OutputPath = "packages"
})
)
// Build solution
Target "Build" (fun _ ->
UpdateAttributes "./Kinsky/Properties/AssemblyInfo.cs"
[Attribute.Title (Utils.FormatTitle "Linn Kinsky" buildQuality)
Attribute.Version buildVersion]
Utils.UpdatePlist "./Kinsky/Mac/Info.plist" buildVersion buildVersion
let setParams defaults =
{ defaults with
Verbosity = Some(Quiet)
Targets = ["Build"]
Properties =
[
"Optimize", "True"
"DebugSymbols", "True"
"Configuration", "Release"
"Platform", "Any CPU"
"BuildVersion", buildVersion
]
}
build setParams "KinskyMac.sln"
|> DoNothing
Utils.Exec "python" (sprintf "%s %s %s" "./Kinsky/Mac/Installer/buildinstaller.py" "Release" buildVersion)
CreateDir "./build/artifacts"
CopyFile ("./build/artifacts/Kinsky_" + buildVersion + "_osx.pkg") "./build/Kinsky/bin/Mac/Installer/Release/InstallerKinsky.pkg"
CopyFile ("./build/artifacts/Kinsky_" + buildVersion + "_osx.dll") "./build/Kinsky/bin/Mac/Installer/Release/UpdaterKinsky.dll"
)
// Dependencies
"Clean"
==> "RestorePackages"
==> "Build"
==> "Default"
// Start build
RunTargetOrDefault "Default"