Skip to content

Commit

Permalink
Create assemblyInfo with FAKE
Browse files Browse the repository at this point in the history
  • Loading branch information
relentless committed Jan 15, 2015
1 parent c078d02 commit ba7abe1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 35 deletions.
35 changes: 10 additions & 25 deletions HttpClient/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
namespace http

namespace System
open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("HttpClient")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("Http.fs")>]
[<assembly: AssemblyCopyright("Copyright © G Crofton 2015")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[<assembly: Guid("4ead3524-8220-4f0b-b77d-edd088597fcf")>]
[<assembly: AssemblyTitleAttribute("HttpClient")>]
[<assembly: AssemblyDescriptionAttribute("An HTTP client for F#")>]
[<assembly: GuidAttribute("4ead3524-8220-4f0b-b77d-edd088597fcf")>]
[<assembly: AssemblyProductAttribute("Http.fs")>]
[<assembly: AssemblyVersionAttribute("1.5.1")>]
[<assembly: AssemblyFileVersionAttribute("1.5.1")>]
do ()

[<assembly: AssemblyVersion("1.5.1.0")>]
[<assembly: AssemblyFileVersion("1.5.1.0")>]
()
module internal AssemblyVersionInformation =
let [<Literal>] Version = "1.5.1"
Binary file modified Release/HttpClient.dll
Binary file not shown.
27 changes: 17 additions & 10 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// include Fake lib
#r @"packages\FAKE.3.14.0\tools\FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile

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

// Helper Functions
let outputFolder baseDir =
baseDir + "bin/Debug/"

let binFolder baseDir =
baseDir + "bin/"

let projectFolder baseDir =
baseDir + "*.fsproj"
let outputFolder baseDir = baseDir + "bin/Debug/"
let binFolder baseDir = baseDir + "bin/"
let projectFolder baseDir = baseDir + "*.fsproj"
let assemblyInfo baseDir = baseDir + "AssemblyInfo.fs"

let BuildTarget targetName baseDirectory =
Target targetName (fun _ ->
Expand All @@ -41,6 +37,17 @@ Target "Clean" (fun _ ->
]
)

Target "Update Assembly Version" (fun _ ->
CreateFSharpAssemblyInfo (httpClientDir |> assemblyInfo) [
Attribute.Title "HttpClient"
Attribute.Description "An HTTP client for F#"
Attribute.Guid "4ead3524-8220-4f0b-b77d-edd088597fcf"
Attribute.Product "Http.fs"
Attribute.Version (getBuildParam "nuget-version")
Attribute.FileVersion (getBuildParam "nuget-version")
]
)

BuildTarget "BuildClient" httpClientDir

BuildTarget "BuildUnitTests" unitTestsDir
Expand Down Expand Up @@ -84,7 +91,6 @@ Target "Copy Release Files" (fun _ ->
]
)

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

// Dependencies
"Clean"
=?> ("Update Assembly Version", hasBuildParam "nuget-version")
==> "BuildClient"
==> "BuildUnitTests" <=> "BuildIntegrationTests" <=> "BuildSampleApplication"
==> "Run Unit Tests" <=> "Run Integration Tests"
Expand Down

0 comments on commit ba7abe1

Please sign in to comment.