Skip to content

Commit c112757

Browse files
craiggwilsonrstam
authored andcommitted
changed the build script to put the semver into AssemblyInformationVersion and the githash into the AssemblyMetadata attribute.
1 parent 0c4b5e2 commit c112757

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

build/build.fsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,17 @@ Target "OutputVersion" (fun _ ->
8282
)
8383

8484
Target "AssemblyInfo" (fun _ ->
85-
let commitish = Git.Information.getCurrentSHA1 baseDir
86-
let commitDate =
87-
let dt = Git.CommandHelper.runSimpleGitCommand baseDir "log -1 --date=iso --pretty=format:%ad"
88-
System.DateTime.Parse(dt).ToString("yyyy-MM-dd HH:mm:ss")
89-
90-
let info = "{ version: '" + version + "', semver: '" + semVersion.ToString() + "', commit: '" + commitish + "', commitDate: '" + commitDate + "' }"
85+
let githash = Git.Information.getCurrentSHA1 baseDir
9186

9287
ActivateFinalTarget "Teardown"
9388
ReplaceAssemblyInfoVersions (fun p ->
9489
{ p with
9590
OutputFileName = asmFile
9691
AssemblyVersion = version
97-
AssemblyInformationalVersion = info
92+
AssemblyInformationalVersion = semVersion
9893
AssemblyFileVersion = version
99-
AssemblyConfiguration = config })
94+
AssemblyConfiguration = config
95+
AssemblyMetadata = ["githash", githash]})
10096
)
10197

10298
Target "Build" (fun _ ->

src/MongoDB.Shared/GlobalAssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
[assembly: AssemblyVersion("0.0.*")]
2222
[assembly: AssemblyInformationalVersion("unofficial")]
2323
[assembly: AssemblyFileVersion("0.0.0.0")]
24+
[assembly: AssemblyMetadata("githash", "none")]
2425
[assembly: AssemblyConfiguration("Debug")]

0 commit comments

Comments
 (0)