-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.fsx
77 lines (63 loc) · 1.95 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
69
70
71
72
73
74
75
76
77
// include Fake lib
#r @"packages\FAKE\tools\FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
open Fake.Git
open Fake.ReleaseNotesHelper
let buildDir = "./build/"
let appReferences = !! "src/**/*.fsproj"
let release = LoadReleaseNotes "RELEASE_NOTES.md"
let project = "Sast"
let summary = "F# generative type provider providing an implementation of session types"
// Clean Target
Target "Clean" (fun _ ->
CleanDirs [buildDir]
)
// Build in Debug
Target "Build" (fun _ ->
MSBuildDebug buildDir "Build" appReferences
|> Log "AppBuild-Output: "
)
// Generate assembly info files with the right version & up-to-date information
Target "AssemblyInfo" (fun _ ->
let getAssemblyInfoAttributes projectName =
[ Attribute.Title (projectName)
Attribute.Product project
Attribute.Description summary
Attribute.Version release.AssemblyVersion
Attribute.FileVersion release.AssemblyVersion ]
let getProjectDetails projectPath =
let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
( projectPath,
projectName,
System.IO.Path.GetDirectoryName(projectPath),
(getAssemblyInfoAttributes projectName)
)
!! "src/*/*.??proj"
|> Seq.map getProjectDetails
|> Seq.iter (fun (projFileName, projectName, folderName, attributes) ->
match projFileName with
| Fsproj -> CreateFSharpAssemblyInfo (folderName @@ "AssemblyInfo.fs") attributes
| _ -> ()
)
)
//// Build a NuGet package
//Target "NuGet" (fun _ ->
// Paket.Pack(fun p ->
// { p with
// OutputPath = buildDir
// Version = release.NugetVersion
// ReleaseNotes = toLines release.Notes})
//)
//
//Target "PublishNuget" (fun _ ->
// Paket.Push(fun p ->
// { p with
// WorkingDir = buildDir })
//)
"Clean"
==> "AssemblyInfo"
==> "Build"
// ==> "NuGet"
// ==> "PublishNuget"
RunTargetOrDefault "Build"