Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Including git commit in the generated files

  • Loading branch information...
commit e9c29b0e76a566dd40f285b947745cc56faeac05 1 parent 5acf3a9
@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.