AssemblyTitle and PackageIcon
2 files changed, 22 insertions, 13 deletions
diff --git a/crypto/src/BouncyCastle.Crypto.csproj b/crypto/src/BouncyCastle.Crypto.csproj
index 05abc2efe..5b304b763 100644
--- a/crypto/src/BouncyCastle.Crypto.csproj
+++ b/crypto/src/BouncyCastle.Crypto.csproj
@@ -8,12 +8,14 @@
<NoWarn>1591</NoWarn>
<AssemblyName>BouncyCastle.Cryptography</AssemblyName>
+ <AssemblyTitle>BouncyCastle.NET Cryptography ($(TargetFramework))</AssemblyTitle>
<Authors />
<Company>Legion of the Bouncy Castle Inc.</Company>
<Copyright>Copyright © Legion of the Bouncy Castle Inc. 2000-2022</Copyright>
<DebugType>embedded</DebugType>
<Description>BouncyCastle.NET is a popular cryptography library for .NET</Description>
- <EmbedUntrackedSources>true</EmbedUntrackedSources>
+ <EmbedUntrackedSources>true</EmbedUntrackedSources>
+ <PackageIcon>packageIcon.png</PackageIcon>
<PackageIconUrl>https://www.bouncycastle.org/images/csharp_logo.gif</PackageIconUrl>
<PackageId>BouncyCastle.Cryptography</PackageId>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
@@ -24,7 +26,7 @@
<Product>BouncyCastle.NET</Product>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/bcgit/bc-csharp</RepositoryUrl>
- <Title>BouncyCastle.NET Cryptography ($(TargetFramework))</Title>
+ <Title>BouncyCastle.NET Cryptography</Title>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
@@ -39,19 +41,12 @@
<ItemGroup>
<None Remove="**\*.properties" />
<EmbeddedResource Include="**\*.properties" />
+ <None Include="..\..\LICENSE.md" Pack="true" PackagePath="\" />
+ <None Include="..\..\packageIcon.png" Pack="true" PackagePath="\" />
+ <None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
- <None Include="..\..\LICENSE.md">
- <Pack>True</Pack>
- <PackagePath>\</PackagePath>
- </None>
- <None Include="..\..\README.md">
- <Pack>True</Pack>
- <PackagePath>\</PackagePath>
- </None>
- </ItemGroup>
- <ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -66,4 +61,9 @@
</PackageReference>
</ItemGroup>
+ <Target Name="FixAssemblyAttributes" AfterTargets="GetBuildVersion">
+ <PropertyGroup>
+ <!-- Here we can override/use any MSBuild properties set by Nerdbank.GitVersioning -->
+ </PropertyGroup>
+ </Target>
</Project>
diff --git a/crypto/src/bcpg/ArmoredOutputStream.cs b/crypto/src/bcpg/ArmoredOutputStream.cs
index 7f3bcc2ef..bfed1972a 100644
--- a/crypto/src/bcpg/ArmoredOutputStream.cs
+++ b/crypto/src/bcpg/ArmoredOutputStream.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+using System.Reflection;
using Org.BouncyCastle.Utilities;
using Org.BouncyCastle.Utilities.Collections;
@@ -98,7 +99,15 @@ namespace Org.BouncyCastle.Bcpg
private static readonly string footerStart = "-----END PGP ";
private static readonly string footerTail = "-----";
- private static readonly string Version = "BCPG C# v" + typeof(ArmoredOutputStream).Assembly.GetName().Version;
+ private static string CreateVersion()
+ {
+ var assembly = Assembly.GetExecutingAssembly();
+ var title = assembly.GetCustomAttribute<AssemblyTitleAttribute>().Title;
+ var version = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
+ return title + " v" + version;
+ }
+
+ private static readonly string Version = CreateVersion();
private readonly IDictionary<string, IList<string>> m_headers;
|