1
- // include Fake lib
2
1
#r @" packages\FAKE.3.14.0\tools\FakeLib.dll"
3
2
open Fake
3
+ open Fake.AssemblyInfoFile
4
4
5
5
// Paths
6
6
let httpClientDir = " ./HttpClient/"
@@ -15,14 +15,10 @@ let nuGetProjectDll = nuGetDir + "lib/net40/HttpClient.dll"
15
15
let nUnitToolPath = " Tools/NUnit-2.6.3/bin"
16
16
17
17
// Helper Functions
18
- let outputFolder baseDir =
19
- baseDir + " bin/Debug/"
20
-
21
- let binFolder baseDir =
22
- baseDir + " bin/"
23
-
24
- let projectFolder baseDir =
25
- baseDir + " *.fsproj"
18
+ let outputFolder baseDir = baseDir + " bin/Debug/"
19
+ let binFolder baseDir = baseDir + " bin/"
20
+ let projectFolder baseDir = baseDir + " *.fsproj"
21
+ let assemblyInfo baseDir = baseDir + " AssemblyInfo.fs"
26
22
27
23
let BuildTarget targetName baseDirectory =
28
24
Target targetName ( fun _ ->
@@ -41,6 +37,17 @@ Target "Clean" (fun _ ->
41
37
]
42
38
)
43
39
40
+ Target " Update Assembly Version" ( fun _ ->
41
+ CreateFSharpAssemblyInfo ( httpClientDir |> assemblyInfo) [
42
+ Attribute.Title " HttpClient"
43
+ Attribute.Description " An HTTP client for F#"
44
+ Attribute.Guid " 4ead3524-8220-4f0b-b77d-edd088597fcf"
45
+ Attribute.Product " Http.fs"
46
+ Attribute.Version ( getBuildParam " nuget-version" )
47
+ Attribute.FileVersion ( getBuildParam " nuget-version" )
48
+ ]
49
+ )
50
+
44
51
BuildTarget " BuildClient" httpClientDir
45
52
46
53
BuildTarget " BuildUnitTests" unitTestsDir
@@ -84,7 +91,6 @@ Target "Copy Release Files" (fun _ ->
84
91
]
85
92
)
86
93
87
- // BEFORE doing this, set the correct version in AssemblyInfo!
88
94
// note to self - call like this:
89
95
// packages\FAKE.3.14.0\tools\fake.exe build.fsx nuget-version=1.1.0 nuget-api-key=(my api key) nuget-release-notes="latest release"
90
96
Target " Upload to NuGet" ( fun _ ->
@@ -117,6 +123,7 @@ Target "All" (fun _ ->
117
123
118
124
// Dependencies
119
125
" Clean"
126
+ =?> ( " Update Assembly Version" , hasBuildParam " nuget-version" )
120
127
==> " BuildClient"
121
128
==> " BuildUnitTests" <=> " BuildIntegrationTests" <=> " BuildSampleApplication"
122
129
==> " Run Unit Tests" <=> " Run Integration Tests"
0 commit comments