Browse Source

Simplify update-assemblyinfo.ps1 and introduce public DecompilerVersionInfo class.

pull/2656/head
Siegfried Pammer 3 years ago
parent
commit
b3f8e4fe3c
  1. 3
      .gitignore
  2. 7
      BuildTools/update-assemblyinfo.ps1
  3. 5
      ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
  4. 4
      ICSharpCode.Decompiler/Properties/AssemblyInfo.cs
  5. 11
      ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs
  6. 4
      ILSpy/AboutPage.cs
  7. 1
      ILSpy/ILSpy.csproj
  8. 2
      ILSpy/ILSpySettings.cs
  9. 4
      ILSpy/MainWindow.xaml.cs
  10. 17
      ILSpy/Properties/AssemblyInfo.cs

3
.gitignore vendored

@ -2,8 +2,6 @@ bin/ @@ -2,8 +2,6 @@ bin/
obj/
AppPackages/
BundleArtifacts/
/ICSharpCode.Decompiler/Properties/AssemblyInfo.cs
/ILSpy/Properties/AssemblyInfo.cs
/ILSpy/app.config
*.user
/Resharper-ILSpy-Style.xml
@ -22,3 +20,4 @@ multitargeting.props @@ -22,3 +20,4 @@ multitargeting.props
ILSpy.Installer/wix/
ILSpy.Installer/AppPackage.cs
/VERSION
/ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.cs

7
BuildTools/update-assemblyinfo.ps1

@ -6,7 +6,7 @@ $baseCommitRev = 1; @@ -6,7 +6,7 @@ $baseCommitRev = 1;
# make sure this matches artifacts-only branches list in appveyor.yml!
$masterBranches = '^(master|release/.+)$';
$globalAssemblyInfoTemplateFile = "ILSpy/Properties/AssemblyInfo.template.cs";
$decompilerVersionInfoTemplateFile = "ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs";
function Test-File([string]$filename) {
return [System.IO.File]::Exists((Join-Path (Get-Location) $filename));
@ -79,8 +79,7 @@ function gitBranch() { @@ -79,8 +79,7 @@ function gitBranch() {
}
$templateFiles = (
@{Input=$globalAssemblyInfoTemplateFile; Output="ILSpy/Properties/AssemblyInfo.cs"},
@{Input="ICSharpCode.Decompiler/Properties/AssemblyInfo.template.cs"; Output="ICSharpCode.Decompiler/Properties/AssemblyInfo.cs"},
@{Input=$decompilerVersionInfoTemplateFile; Output="ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.cs"},
@{Input="ILSpy/Properties/app.config.template"; Output = "ILSpy/app.config"},
@{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"},
@{Input="ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS2022/source.extension.vsixmanifest"},
@ -106,7 +105,7 @@ try { @@ -106,7 +105,7 @@ try {
}
$versionParts = @{};
Get-Content $globalAssemblyInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) }
Get-Content $decompilerVersionInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) }
$major = $versionParts.Major;
$minor = $versionParts.Minor;

5
ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj

@ -114,6 +114,8 @@ @@ -114,6 +114,8 @@
<Compile Include="Instrumentation\DecompilerEventSource.cs" />
<Compile Include="Metadata\FindTypeDecoder.cs" />
<Compile Include="Metadata\ReferenceLoadInfo.cs" />
<Compile Include="Properties\DecompilerVersionInfo.cs" />
<None Include="Properties\DecompilerVersionInfo.template.cs" />
<Compile Include="Semantics\OutVarResolveResult.cs" />
<Compile Include="SingleFileBundle.cs" />
<Compile Include="Solution\ProjectId.cs" />
@ -651,7 +653,6 @@ @@ -651,7 +653,6 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Instructions.cs</LastGenOutput>
</None>
<None Include="Properties\AssemblyInfo.template.cs" />
</ItemGroup>
<ItemGroup>
@ -692,7 +693,7 @@ @@ -692,7 +693,7 @@
</Target>
<Target Name="CleanUpdateAssemblyInfo" BeforeTargets="BeforeClean">
<Delete Files="@(UpdateAssemblyInfoStamp)" />
<Delete Files="@(UpdateAssemblyInfoStamp);..\VERSION" />
</Target>
</Project>

4
ICSharpCode.Decompiler/Properties/AssemblyInfo.template.cs → ICSharpCode.Decompiler/Properties/AssemblyInfo.cs

@ -14,8 +14,8 @@ using System.Runtime.InteropServices; @@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("$INSERTVERSION$")]
[assembly: AssemblyInformationalVersion("$INSERTVERSION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX$-$INSERTSHORTCOMMITHASH$")]
[assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)]
[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithShortCommitHash)]
[assembly: InternalsVisibleTo("ICSharpCode.Decompiler.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf")]

11
ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
public static class DecompilerVersionInfo
{
public const string Major = "8";
public const string Minor = "0";
public const string Build = "0";
public const string Revision = "$INSERTREVISION$";
public const string VersionName = "alpha1";
public const string FullVersion = Major + "." + Minor + "." + Build + ".$INSERTREVISION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX$";
public const string FullVersionWithShortCommitHash = FullVersion + "-$INSERTSHORTCOMMITHASH$";
}

4
ILSpy/AboutPage.cs

@ -60,7 +60,7 @@ namespace ICSharpCode.ILSpy @@ -60,7 +60,7 @@ namespace ICSharpCode.ILSpy
Title = Resources.About,
EnableHyperlinks = true
};
output.WriteLine(Resources.ILSpyVersion + RevisionClass.FullVersion);
output.WriteLine(Resources.ILSpyVersion + DecompilerVersionInfo.FullVersion);
string prodVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(Uri).Assembly.Location).ProductVersion;
output.WriteLine(Resources.NETFrameworkVersion + prodVersion);
@ -154,7 +154,7 @@ namespace ICSharpCode.ILSpy @@ -154,7 +154,7 @@ namespace ICSharpCode.ILSpy
};
}
static readonly Version currentVersion = new Version(RevisionClass.Major + "." + RevisionClass.Minor + "." + RevisionClass.Build + "." + RevisionClass.Revision);
static readonly Version currentVersion = new Version(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision);
static void ShowAvailableVersion(AvailableVersionInfo availableVersion, StackPanel stackPanel)
{

1
ILSpy/ILSpy.csproj

@ -74,7 +74,6 @@ @@ -74,7 +74,6 @@
<EmbeddedResource Include="TextView\ILAsm-Mode-Dark.xshd" />
<EmbeddedResource Include="TextView\Asm-Mode-Dark.xshd" />
<EmbeddedResource Include="TextView\XML-Mode-Dark.xshd" />
<Compile Remove="Properties\AssemblyInfo.template.cs" />
<None Remove="Properties\launchSettings.json" />
<None Remove="Properties\app.config.template" />
</ItemGroup>

2
ILSpy/ILSpySettings.cs

@ -118,7 +118,7 @@ namespace ICSharpCode.ILSpy @@ -118,7 +118,7 @@ namespace ICSharpCode.ILSpy
{
doc = new XDocument(new XElement("ILSpy"));
}
doc.Root.SetAttributeValue("version", RevisionClass.Major + "." + RevisionClass.Minor + "." + RevisionClass.Build + "." + RevisionClass.Revision);
doc.Root.SetAttributeValue("version", DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision);
action(doc.Root);
doc.Save(config, SaveOptions.None);
}

4
ILSpy/MainWindow.xaml.cs

@ -1010,13 +1010,13 @@ namespace ICSharpCode.ILSpy @@ -1010,13 +1010,13 @@ namespace ICSharpCode.ILSpy
if (assemblyList.ListName == AssemblyListManager.DefaultListName)
#if DEBUG
this.Title = $"ILSpy {RevisionClass.FullVersion}";
this.Title = $"ILSpy {DecompilerVersionInfo.FullVersion}";
#else
this.Title = "ILSpy";
#endif
else
#if DEBUG
this.Title = $"ILSpy {RevisionClass.FullVersion} - " + assemblyList.ListName;
this.Title = $"ILSpy {DecompilerVersionInfo.FullVersion} - " + assemblyList.ListName;
#else
this.Title = "ILSpy - " + assemblyList.ListName;
#endif

17
ILSpy/Properties/AssemblyInfo.template.cs → ILSpy/Properties/AssemblyInfo.cs

@ -17,7 +17,7 @@ using System.Runtime.Versioning; @@ -17,7 +17,7 @@ using System.Runtime.Versioning;
[assembly: AssemblyDescription(".NET assembly inspector and decompiler")]
[assembly: AssemblyCompany("ic#code")]
[assembly: AssemblyProduct("ILSpy")]
[assembly: AssemblyCopyright("Copyright 2011-$INSERTYEAR$ AlphaSierraPapa for the SharpDevelop Team")]
[assembly: AssemblyCopyright("Copyright 2011-2022 AlphaSierraPapa for the SharpDevelop Team")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -25,8 +25,8 @@ using System.Runtime.Versioning; @@ -25,8 +25,8 @@ using System.Runtime.Versioning;
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
[assembly: AssemblyVersion(RevisionClass.Major + "." + RevisionClass.Minor + "." + RevisionClass.Build + "." + RevisionClass.Revision)]
[assembly: AssemblyInformationalVersion(RevisionClass.FullVersion + "-$INSERTSHORTCOMMITHASH$")]
[assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)]
[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithShortCommitHash)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SupportedOSPlatform("Windows7.0")]
@ -37,14 +37,3 @@ using System.Runtime.Versioning; @@ -37,14 +37,3 @@ using System.Runtime.Versioning;
[assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
Justification = "AssemblyInformationalVersion does not need to be a parsable version")]
internal static class RevisionClass
{
public const string Major = "8";
public const string Minor = "0";
public const string Build = "0";
public const string Revision = "$INSERTREVISION$";
public const string VersionName = "alpha1";
public const string FullVersion = Major + "." + Minor + "." + Build + ".$INSERTREVISION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX$";
}
Loading…
Cancel
Save