-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.fsx
66 lines (55 loc) · 1.84 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
// include Fake lib
#r @"Tools/FAKE/FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
open System
// build properties
let buildTarget = getBuildParamOrDefault "buildTarget" "Publish"
let buildConfiguration = getBuildParamOrDefault "buildConfiguration" "Debug"
// common path properties
let sourceDir = currentDirectory @@ "src"
let publishDir = currentDirectory @@ "Publish"
let solutionFile = sourceDir @@ "License.Manager.sln"
// tools path properties
let toolsDir = currentDirectory @@ "Tools"
// common assembly info properties
let assemblyVersion = getBuildParamOrDefault "assemblyVersion" "0.0.0.0"
//let assemblyFileVersion = getBuildParamOrDefault "assemblyFileVersion" "0.0.0.0"
//let assemblyInformationalVersion = getBuildParamOrDefault "assemblyInformationalVersion" "0.0.0-devel"
// Targets
Target "All" DoNothing
Target "Clean" (fun _ ->
let directoriesToClean =
!+ publishDir |> Scan
CleanDirs directoriesToClean
)
Target "CreateAssemblyInfo" (fun _ ->
CreateCSharpAssemblyInfo (sourceDir @@ "CommonAssemblyInfo.cs")
[
Attribute.Company "Nauck IT KG"
Attribute.Product "License Manager Light"
Attribute.Copyright (sprintf "Copyright © 2012 - %A Nauck IT KG" DateTime.Now.Year)
// Attribute.Version assemblyVersion
// Attribute.FileVersion assemblyFileVersion
// Attribute.InformationalVersion assemblyInformationalVersion
]
)
Target "Build" (fun _ ->
build (fun msbuild ->
{msbuild with
Targets = [buildTarget]
Properties =
[
"Configuration", buildConfiguration
"AssemblyVersion", assemblyVersion
]
}
) solutionFile
)
// Dependencies
"Clean"
==> "CreateAssemblyInfo"
==> "Build"
==> "All"
// start build
Run <| getBuildParamOrDefault "target" "All"