-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathBasicTasks.fs
81 lines (74 loc) · 2.55 KB
/
BasicTasks.fs
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
module BasicTasks
open BlackFox.Fake
open Fake.IO
open Fake.DotNet
open Fake.IO.Globbing.Operators
open ProjectInfo
/// Buildtask for setting a prerelease tag (also sets the mutable isPrerelease to true, and the PackagePrereleaseTag of all project infos accordingly.)
let setPrereleaseTag =
BuildTask.create "SetPrereleaseTag" [] {
printfn "Please enter pre-release package suffix"
let suffix = System.Console.ReadLine()
prereleaseSuffix <- suffix
isPrerelease <- true
projects
|> List.iter (fun p ->
p.PackagePrereleaseTag <- (sprintf "%s-%s" p.PackageVersionTag suffix)
)
//
prereleaseTag <- (sprintf "%s-%s" CoreProject.PackageVersionTag suffix)
}
/// cleans the bin, obj/obj dir of all projects and test projects, as well as the pkg dir.
let clean =
BuildTask.create "Clean" [] {
!! "src/**/bin" ++ "src/**/obj" ++ "tests/**/bin" ++ "tests/**/obj" ++ "pkg" |> Shell.cleanDirs
}
/// builds the solution file (dotnet build solution.sln)
let buildSolution =
BuildTask.create "BuildSolution" [ clean ] {
solutionFile
|> DotNet.build (fun p ->
let msBuildParams =
{p.MSBuildParams with
Properties = ([
"warnon", "3390"
])
DisableInternalBinLog = true
}
{
p with
MSBuildParams = msBuildParams
}
|> DotNet.Options.withCustomParams (Some "-tl")
)
}
/// builds the individual project files (dotnet build project.*proj)
///
/// The following MSBuild params are set for each project accordingly to the respective ProjectInfo:
///
/// - AssemblyVersion
///
/// - AssemblyInformationalVersion
let build = BuildTask.create "Build" [clean] {
projects
|> List.iter (fun pInfo ->
let proj = pInfo.ProjFile
proj
|> DotNet.build (fun p ->
let msBuildParams =
{p.MSBuildParams with
Properties = ([
"AssemblyVersion", pInfo.AssemblyVersion
"InformationalVersion", pInfo.AssemblyInformationalVersion
"warnon", "3390"
])
DisableInternalBinLog = true
}
{
p with
MSBuildParams = msBuildParams
}
|> DotNet.Options.withCustomParams (Some "--no-dependencies -tl")
)
)
}