Skip to content

Commit 6965945

Browse files
Replace FileVersionInfo.GetVersionInfo with DecompilerVersionInfo.Version constant (#3667)
1 parent a1e2a4a commit 6965945

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace ICSharpCode.Decompiler.DebugInfo
4343
{
4444
public class PortablePdbWriter
4545
{
46-
static readonly FileVersionInfo decompilerVersion = FileVersionInfo.GetVersionInfo(typeof(CSharpDecompiler).Assembly.Location);
46+
const string decompilerVersion = DecompilerVersionInfo.Version;
4747

4848
public static bool HasCodeViewDebugDirectoryEntry(PEFile file)
4949
{
@@ -119,7 +119,7 @@ string BuildFileNameFromTypeName(TypeDefinitionHandle handle)
119119

120120
// Generate source and checksum
121121
if (!noLogo)
122-
syntaxTree.InsertChildAfter(null, new Comment(" PDB and source generated by ICSharpCode.Decompiler " + decompilerVersion.FileVersion), Roles.Comment);
122+
syntaxTree.InsertChildAfter(null, new Comment(" PDB and source generated by ICSharpCode.Decompiler " + decompilerVersion), Roles.Comment);
123123
var sourceText = SyntaxTreeToString(syntaxTree, settings);
124124

125125
// Generate sequence points for the syntax tree

ICSharpCode.Decompiler/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
1515
[assembly: ComVisible(false)]
1616

17-
[assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)]
17+
[assembly: AssemblyVersion(DecompilerVersionInfo.Version)]
1818
[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)]
1919

2020
[assembly: InternalsVisibleTo("ICSharpCode.Decompiler.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf")]

ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public static class DecompilerVersionInfo
66
public const string Revision = "$INSERTREVISION$";
77
public const string VersionName = "preview3";
88

9+
public const string Version = Major + "." + Minor + "." + Build + "." + Revision;
910
public const string FullVersion = Major + "." + Minor + "." + Build + ".$INSERTREVISION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX$";
1011
public const string FullVersionWithShortCommitHash = FullVersion + "+$INSERTSHORTCOMMITHASH$";
1112
public const string FullVersionWithCommitHash = FullVersion + "+$INSERTCOMMITHASH$";

0 commit comments

Comments
 (0)