diff --git a/BuildTools/update-assemblyinfo.ps1 b/BuildTools/update-assemblyinfo.ps1 index b07199c826..f4096cb746 100644 --- a/BuildTools/update-assemblyinfo.ps1 +++ b/BuildTools/update-assemblyinfo.ps1 @@ -69,6 +69,17 @@ function gitCommitHash() { } } +function gitShortCommitHash() { + if (No-Git) { + return "00000000"; + } + try { + return (git rev-parse --short=8 (git rev-list --max-count 1 HEAD)); + } catch { + return "00000000"; + } +} + function gitBranch() { if (No-Git) { return "no-branch"; @@ -117,6 +128,7 @@ try { $revision = gitVersion; $branchName = gitBranch; $gitCommitHash = gitCommitHash; + $gitShortCommitHash = gitShortCommitHash; if ($branchName -match $masterBranches) { $postfixBranchName = ""; @@ -150,7 +162,7 @@ try { $out = $out.Replace('$INSERTMAJORVERSION$', $major); $out = $out.Replace('$INSERTREVISION$', $revision); $out = $out.Replace('$INSERTCOMMITHASH$', $gitCommitHash); - $out = $out.Replace('$INSERTSHORTCOMMITHASH$', $gitCommitHash.Substring(0, 8)); + $out = $out.Replace('$INSERTSHORTCOMMITHASH$', $gitShortCommitHash); $out = $out.Replace('$INSERTDATE$', [System.DateTime]::Now.ToString("MM/dd/yyyy")); $out = $out.Replace('$INSERTYEAR$', [System.DateTime]::Now.Year.ToString()); $out = $out.Replace('$INSERTBRANCHNAME$', $branchName); diff --git a/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs b/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs index 3f6d671f7c..aeac8ac43e 100644 --- a/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs +++ b/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs @@ -15,7 +15,7 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)] -[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithShortCommitHash)] +[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)] [assembly: InternalsVisibleTo("ICSharpCode.Decompiler.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf")] diff --git a/ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs b/ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs index ee12ad9b8e..8f8e0ccfcd 100644 --- a/ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs +++ b/ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs @@ -6,6 +6,7 @@ public const string Revision = "$INSERTREVISION$"; public const string VersionName = "preview2"; - public const string FullVersion = Major + "." + Minor + "." + Build + ".$INSERTREVISION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX$"; - public const string FullVersionWithShortCommitHash = FullVersion + "-$INSERTSHORTCOMMITHASH$"; + public const string FullVersion = Major + "." + Minor + "." + Build + ".$INSERTREVISION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX + public const string FullVersionWithShortCommitHash = FullVersion + "+$INSERTSHORTCOMMITHASH$"; + public const string FullVersionWithCommitHash = FullVersion + "+$INSERTCOMMITHASH$"; } diff --git a/ICSharpCode.ILSpyCmd/Properties/AssemblyInfo.cs b/ICSharpCode.ILSpyCmd/Properties/AssemblyInfo.cs index f89527a81e..0a60d6bf63 100644 --- a/ICSharpCode.ILSpyCmd/Properties/AssemblyInfo.cs +++ b/ICSharpCode.ILSpyCmd/Properties/AssemblyInfo.cs @@ -1,12 +1,8 @@ #region Using directives -using System; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Runtime.Versioning; #endregion @@ -15,7 +11,7 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)] -[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithShortCommitHash)] +[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)] [assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly", Justification = "AssemblyInformationalVersion does not need to be a parsable version")] diff --git a/ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs b/ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs index 34d6f6fa16..f4c52a6e3d 100644 --- a/ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs +++ b/ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs @@ -1,12 +1,8 @@ #region Using directives -using System; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Runtime.Versioning; #endregion @@ -15,7 +11,7 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)] -[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithShortCommitHash)] +[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)] [assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly", Justification = "AssemblyInformationalVersion does not need to be a parsable version")] diff --git a/ILSpy/AboutPage.cs b/ILSpy/AboutPage.cs index 43303bf889..54577b47f6 100644 --- a/ILSpy/AboutPage.cs +++ b/ILSpy/AboutPage.cs @@ -54,7 +54,7 @@ public static void Display(DecompilerTextView textView) Title = Resources.About, EnableHyperlinks = true }; - output.WriteLine(Resources.ILSpyVersion + DecompilerVersionInfo.FullVersion); + output.WriteLine(Resources.ILSpyVersion + DecompilerVersionInfo.FullVersionWithCommitHash); string prodVersion = GetDotnetProductVersion(); output.WriteLine(Resources.NETFrameworkVersion + prodVersion); diff --git a/ILSpy/Properties/AssemblyInfo.cs b/ILSpy/Properties/AssemblyInfo.cs index 8e5ce25307..cf41117daa 100644 --- a/ILSpy/Properties/AssemblyInfo.cs +++ b/ILSpy/Properties/AssemblyInfo.cs @@ -1,6 +1,5 @@ #region Using directives -using System; using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Resources; @@ -26,7 +25,7 @@ [assembly: ComVisible(false)] [assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)] -[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithShortCommitHash)] +[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SupportedOSPlatform("Windows7.0")]