Skip to content

Commit

Permalink
generate AssemblyVersionInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudRoutine committed Feb 27, 2017
1 parent 3432af9 commit 18a35a3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ install:
- dotnet --info

build_script:
- bundle exec rake
# - cmd: build.cmd
- cmd: build.cmd "All"

# artifacts:
# - path: 'bin'
Expand Down
44 changes: 42 additions & 2 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#I @"packages/build/FAKE/tools/"
#I @"packages/build/FAKE/tools/"
#r @"FakeLib.dll"
System.IO.Directory.SetCurrentDirectory __SOURCE_DIRECTORY__
open System
Expand All @@ -18,6 +18,45 @@ let run cmd args dir =
) System.TimeSpan.MaxValue = false then
failwithf "Error while running '%s' with args: %s" cmd args


let project = "Expecto"
let summary = "A smooth unit test framework for F#"
let description = summary

// List of author names (for NuGet package)
let authors = [ "Logibit AB" ]
let copyright = "(c) 2016 by Henrik Feldt, formerly Fuchu by @mausch"
// Tags for your project (for NuGet package)

let version = { Major = 5; Minor = 0; Patch = 0 }

open Fake.AssemblyInfoFile

let genFSAssemblyInfo (projectPath) =
let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
let folderName = System.IO.Path.GetFileName(System.IO.Path.GetDirectoryName(projectPath))
let basePath = folderName
let fileName = basePath @@ "AssemblyVersionInfo.fs"
CreateFSharpAssemblyInfo fileName [
Attribute.Title (projectName)
Attribute.Product project
Attribute.Copyright copyright
Attribute.Company (authors |> String.concat ", ")
Attribute.Description summary
Attribute.Version <| string version
// Attribute.Version release.AssemblyVersion
// Attribute.FileVersion release.AssemblyVersion
// Attribute.InformationalVersion release.NugetVersion
]


// Generate assembly info files with the right version & up-to-date information
Target "AssemblyInfo" (fun _ ->
let fsProjs = !! "./**/*.fsproj" |> Seq.filter (fun s -> not <| s.Contains "preview")
fsProjs |> Seq.iter genFSAssemblyInfo
)


// --------------------------------------------------------------------------------------
// Rename Logary Facades for Expecto
// (why this is necessary - https://github.com/logary/logary/#using-logary-in-a-library)
Expand Down Expand Up @@ -88,7 +127,8 @@ Target "CreateNuGets" (fun _ ->

Target "All" DoNothing

"ExpectoChangeo"
"AssemblyInfo"
==> "ExpectoChangeo"
==> "Clean"
==> "Build"
==> "RunTests"
Expand Down

0 comments on commit 18a35a3

Please sign in to comment.