Skip to content

Commit

Permalink
Add correct flags for decoupling assembly and package version to the …
Browse files Browse the repository at this point in the history
…build pipeline.
  • Loading branch information
kMutagene committed May 31, 2022
1 parent 1d30cf0 commit 92609c4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
20 changes: 16 additions & 4 deletions build/BasicTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ open BlackFox.Fake
open Fake.IO
open Fake.DotNet
open Fake.IO.Globbing.Operators

open ProjectInfo

let setPrereleaseTag = BuildTask.create "SetPrereleaseTag" [] {
Expand All @@ -25,6 +24,19 @@ let clean = BuildTask.create "Clean" [] {
}

let build = BuildTask.create "Build" [clean] {
solutionFile
|> DotNet.build id
}
!! "src/**/*.*proj"
-- "src/bin/*"
|> Seq.iter (DotNet.build (fun p ->
let msBuildParams =
{p.MSBuildParams with
Properties = ([
"AssemblyVersion", assemblyVersion
"AssemblyInformationalVersion", stableVersionTag
] @ p.MSBuildParams.Properties)
}
{
p with
MSBuildParams = msBuildParams
}
))
}
4 changes: 4 additions & 0 deletions build/PackageTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ let pack = BuildTask.create "Pack" [clean; build; runTests] {
{p.MSBuildParams with
Properties = ([
"Version",stableVersionTag
"AssemblyVersion", assemblyVersion
"AssemblyInformationalVersion", stableVersionTag
"PackageReleaseNotes", (release.Notes |> String.concat "\r\n")
] @ p.MSBuildParams.Properties)
}
Expand All @@ -42,6 +44,8 @@ let packPrerelease = BuildTask.create "PackPrerelease" [setPrereleaseTag; clean;
{p.MSBuildParams with
Properties = ([
"Version", prereleaseTag
"AssemblyVersion", assemblyVersion
"AssemblyInformationalVersion", stableVersionTag
"PackageReleaseNotes", (release.Notes |> String.toLines )
] @ p.MSBuildParams.Properties)
}
Expand Down
6 changes: 6 additions & 0 deletions build/ProjectInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ open Fake.Core

let project = "DynamicObj"

let summary = "F# library supporting Dynamic Objects including inheritance in functional style."

let testProjects =
[
"tests/UnitTests/UnitTests.fsproj"
Expand All @@ -28,6 +30,10 @@ let stableVersion = SemVer.parse release.NugetVersion

let stableVersionTag = (sprintf "%i.%i.%i" stableVersion.Major stableVersion.Minor stableVersion.Patch )

let assemblyVersion = $"{stableVersion.Major}.0.0"

let assemblyInformationalVersion = $"{stableVersion.Major}.{stableVersion.Minor}.{stableVersion.Patch}"

let mutable prereleaseSuffix = ""

let mutable prereleaseTag = ""
Expand Down
2 changes: 1 addition & 1 deletion src/DynamicObj/DynamicObj.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<PropertyGroup>
<Authors>Timo Mühlhaus, F# open source contributors</Authors>
<Authors>Timo Mühlhaus, Kevin Schneider, F# open source contributors</Authors>
<Description>F# library supporting Dynamic Objects including inheritance in functional style.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://csbiology.github.io/DynamicObj/</PackageProjectUrl>
Expand Down

0 comments on commit 92609c4

Please sign in to comment.