Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding git commit to the generated output

  • Loading branch information...
commit b2e2fb511b7a39e6795471921bd31e13d654a0e7 1 parent f4d383f
@ayende authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 psake_ext.ps1
View
10 psake_ext.ps1
@@ -1,3 +1,9 @@
+function Get-Git-Commit
+{
+ $gitLog = git log --oneline -1
+ return $gitLog.Split(' ')[0]
+}
+
function Generate-Assembly-Info
{
param(
@@ -10,7 +16,7 @@ param(
[string]$version,
[string]$file = $(throw "file is a required parameter.")
)
-
+ $commit = Get-Git-Commit
$asmInfo = "using System;
using System.Reflection;
using System.Runtime.CompilerServices;
@@ -24,7 +30,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyProductAttribute(""$product"")]
[assembly: AssemblyCopyrightAttribute(""$copyright"")]
[assembly: AssemblyVersionAttribute(""$version"")]
-[assembly: AssemblyInformationalVersionAttribute(""$version"")]
+[assembly: AssemblyInformationalVersionAttribute(""$version / $commit"")]
[assembly: AssemblyFileVersionAttribute(""$version"")]
[assembly: AssemblyDelaySignAttribute(false)]
"
Please sign in to comment.
Something went wrong with that request. Please try again.