-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.fsx
More file actions
59 lines (46 loc) · 1.61 KB
/
Copy pathbuild.fsx
File metadata and controls
59 lines (46 loc) · 1.61 KB
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
#load ".fake/build.fsx/intellisense.fsx"
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
let version = Fake.Core.Environment.environVarOrNone "BUILD_BUILDNUMBER" |> Option.defaultValue "0.0.0.1"
let buildOptions = fun (opts: DotNet.BuildOptions) ->
let props = ("AssemblyVersion", version)
:: ("AssemblyFileVersion", version)
:: opts.MSBuildParams.Properties
{ opts with
Configuration = DotNet.BuildConfiguration.Release
MSBuildParams = { opts.MSBuildParams with
DisableInternalBinLog = true
Properties = props }
}
let publishOptions = (fun (opts: DotNet.PublishOptions) ->
{
opts with
Configuration = DotNet.BuildConfiguration.Release
OutputPath = Some "./publish"
MSBuildParams = { opts.MSBuildParams with
DisableInternalBinLog = true }
}
)
Target.create "Clean" (fun _ ->
!! "src/**/bin"
++ "src/**/obj"
|> Shell.cleanDirs
)
Target.create "Build" (fun _ ->
!! "src/**/*.*proj"
|> Seq.iter (DotNet.build buildOptions)
)
Target.create "Publish" (fun _ ->
!! "src/**/*.*proj"
|> Seq.iter (DotNet.publish publishOptions)
)
Target.create "All" ignore
"Clean"
==> "Build"
==> "Publish"
==> "All"
Target.runOrDefault "All"