Skip to content

Commit ba7abe1

Browse files
committed
Create assemblyInfo with FAKE
1 parent c078d02 commit ba7abe1

File tree

3 files changed

+27
-35
lines changed

3 files changed

+27
-35
lines changed

HttpClient/AssemblyInfo.fs

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
1-
namespace http
2-
1+
namespace System
32
open System.Reflection
4-
open System.Runtime.CompilerServices
53
open System.Runtime.InteropServices
64

7-
// General Information about an assembly is controlled through the following
8-
// set of attributes. Change these attribute values to modify the information
9-
// associated with an assembly.
10-
[<assembly: AssemblyTitle("HttpClient")>]
11-
[<assembly: AssemblyDescription("")>]
12-
[<assembly: AssemblyConfiguration("")>]
13-
[<assembly: AssemblyCompany("")>]
14-
[<assembly: AssemblyProduct("Http.fs")>]
15-
[<assembly: AssemblyCopyright("Copyright © G Crofton 2015")>]
16-
[<assembly: AssemblyTrademark("")>]
17-
[<assembly: AssemblyCulture("")>]
18-
19-
// Setting ComVisible to false makes the types in this assembly not visible
20-
// to COM components. If you need to access a type in this assembly from
21-
// COM, set the ComVisible attribute to true on that type.
22-
[<assembly: ComVisible(false)>]
23-
24-
// The following GUID is for the ID of the typelib if this project is exposed to COM
25-
[<assembly: Guid("4ead3524-8220-4f0b-b77d-edd088597fcf")>]
5+
[<assembly: AssemblyTitleAttribute("HttpClient")>]
6+
[<assembly: AssemblyDescriptionAttribute("An HTTP client for F#")>]
7+
[<assembly: GuidAttribute("4ead3524-8220-4f0b-b77d-edd088597fcf")>]
8+
[<assembly: AssemblyProductAttribute("Http.fs")>]
9+
[<assembly: AssemblyVersionAttribute("1.5.1")>]
10+
[<assembly: AssemblyFileVersionAttribute("1.5.1")>]
11+
do ()
2612

27-
[<assembly: AssemblyVersion("1.5.1.0")>]
28-
[<assembly: AssemblyFileVersion("1.5.1.0")>]
29-
()
13+
module internal AssemblyVersionInformation =
14+
let [<Literal>] Version = "1.5.1"

Release/HttpClient.dll

512 Bytes
Binary file not shown.

build.fsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// include Fake lib
21
#r @"packages\FAKE.3.14.0\tools\FakeLib.dll"
32
open Fake
3+
open Fake.AssemblyInfoFile
44

55
// Paths
66
let httpClientDir = "./HttpClient/"
@@ -15,14 +15,10 @@ let nuGetProjectDll = nuGetDir + "lib/net40/HttpClient.dll"
1515
let nUnitToolPath = "Tools/NUnit-2.6.3/bin"
1616

1717
// 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"
2622

2723
let BuildTarget targetName baseDirectory =
2824
Target targetName (fun _ ->
@@ -41,6 +37,17 @@ Target "Clean" (fun _ ->
4137
]
4238
)
4339

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+
4451
BuildTarget "BuildClient" httpClientDir
4552

4653
BuildTarget "BuildUnitTests" unitTestsDir
@@ -84,7 +91,6 @@ Target "Copy Release Files" (fun _ ->
8491
]
8592
)
8693

87-
// BEFORE doing this, set the correct version in AssemblyInfo!
8894
// note to self - call like this:
8995
// 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"
9096
Target "Upload to NuGet" (fun _ ->
@@ -117,6 +123,7 @@ Target "All" (fun _ ->
117123

118124
// Dependencies
119125
"Clean"
126+
=?> ("Update Assembly Version", hasBuildParam "nuget-version")
120127
==> "BuildClient"
121128
==> "BuildUnitTests" <=> "BuildIntegrationTests" <=> "BuildSampleApplication"
122129
==> "Run Unit Tests" <=> "Run Integration Tests"

0 commit comments

Comments
 (0)