-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.fsx
68 lines (48 loc) · 1.71 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
#I @"packages/FAKE/tools"
#I @"packages/FAKE.BuildLib/lib/net451"
#r "FakeLib.dll"
#r "BuildLib.dll"
open Fake
open BuildLib
let solution =
initSolution
"./UniGet.sln" "Release"
[ { emptyProject with Name = "UniGet"
Folder = "./src/UniGet"
Executable = true } ]
Target "Clean" <| fun _ -> cleanBin
Target "AssemblyInfo" <| fun _ -> generateAssemblyInfoWithVersion solution (fun p -> "3.4.3")
Target "Restore" <| fun _ -> restoreNugetPackages solution
Target "Build" <| fun _ ->
buildSolution solution
// pack UniGet.exe with dependent modules to packed one
let ilrepackExe = (getNugetPackage "ILRepack" "2.0.9") @@ "tools" @@ "ILRepack.exe"
Shell.Exec(ilrepackExe,
"/wildcards /out:UniGet.packed.exe UniGet.exe *.dll pdb2mdb.exe nuget.exe",
"./src/UniGet/bin" @@ solution.Configuration) |> ignore
Target "Test" <| fun _ -> testSolution solution
Target "Cover" <| fun _ ->
coverSolutionWithParams
(fun p -> { p with Filter = "+[UniGet*]* -[*.Tests]*" })
solution
Target "PackNuget" <| fun _ -> createNugetPackages solution
Target "Pack" <| fun _ -> ()
Target "PublishNuget" <| fun _ -> publishNugetPackages solution
Target "Publish" <| fun _ -> ()
Target "CI" <| fun _ -> ()
Target "Help" <| fun _ ->
showUsage solution (fun _ -> None)
"Clean"
==> "AssemblyInfo"
==> "Restore"
==> "Build"
==> "Test"
"Build" ==> "Cover"
let isPublishOnly = getBuildParam "publishonly"
"Build" ==> "PackNuget" =?> ("PublishNuget", isPublishOnly = "")
"PackNuget" ==> "Pack"
"PublishNuget" ==> "Publish"
"Test" ==> "CI"
"Cover" ==> "CI"
"Publish" ==> "CI"
RunTargetOrDefault "Help"