summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-11-02 17:34:30 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-11-02 17:34:30 +0700
commit9be7f0f0271ad221b4035b8c87f37f1d0a3a7538 (patch)
tree45f4336204e3dcf7d91c26f741d1f12263349f39
parentAssemblyVersion uses only major version (diff)
downloadBouncyCastle.NET-ed25519-9be7f0f0271ad221b4035b8c87f37f1d0a3a7538.tar.xz
AssemblyTitle and PackageIcon
-rw-r--r--crypto/src/BouncyCastle.Crypto.csproj24
-rw-r--r--crypto/src/bcpg/ArmoredOutputStream.cs11
-rw-r--r--packageIcon.pngbin0 -> 58001 bytes
3 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;
 
diff --git a/packageIcon.png b/packageIcon.png
new file mode 100644
index 000000000..ecd478c9a
--- /dev/null
+++ b/packageIcon.png
Binary files differ