Skip to content

Update Target Frameworks #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 106 additions & 105 deletions crypto/src/BouncyCastle.Crypto.csproj
Original file line number Diff line number Diff line change
@@ -1,114 +1,115 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0;net461</TargetFrameworks>
<RootNamespace>Org.BouncyCastle</RootNamespace>
<AssemblyOriginatorKeyFile>..\..\BouncyCastle.NET.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<NoWarn>1591</NoWarn>

<AssemblyName>BouncyCastle.Cryptography</AssemblyName>
<AssemblyTitle>BouncyCastle.NET Cryptography ($(TargetFramework))</AssemblyTitle>
<Authors>Legion of the Bouncy Castle Inc.</Authors>
<Company>Legion of the Bouncy Castle Inc.</Company>
<Copyright>Copyright © Legion of the Bouncy Castle Inc. 2000-2025</Copyright>
<Description>BouncyCastle.NET is a popular cryptography library for .NET</Description>
<PackageIcon>packageIcon.png</PackageIcon>
<PackageIconUrl>https://www.bouncycastle.org/stable/nuget/csharp/packageIcon.png</PackageIconUrl>
<PackageId>BouncyCastle.Cryptography</PackageId>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://www.bouncycastle.org/stable/nuget/csharp/website</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>https://www.bouncycastle.org/stable/nuget/csharp/release_notes</PackageReleaseNotes>
<PackageTags>bouncycastle cryptography dtls encryption open-source openpgp post-quantum security tls</PackageTags>
<Product>BouncyCastle.NET</Product>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Title>BouncyCastle.NET Cryptography</Title>
<Configurations>Debug;Release;Publish</Configurations>
</PropertyGroup>

<!-- CI systems other than GitLab might need different conditions -->
<PropertyGroup Condition="'$(CI)' != ''">
<!-- Deterministic build. -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<!--Source-Level Debugging-->
<PropertyGroup>
<!-- Any custom target adding things to the Compile item group needs BeforeTargets="BeforeCompile". -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>

<!-- Tell SourceLink to use this remote to derive the published git repository URL and source links. -->
<GitRepositoryRemoteName>public</GitRepositoryRemoteName>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<!--Package Validation-->
<PropertyGroup>
<EnablePackageValidation>false</EnablePackageValidation>
<PackageValidationBaselineVersion>2.0.0</PackageValidationBaselineVersion>

<!-- In case we disable signing for local builds, ignore identity mismatch with baseline version. -->
<NoWarn Condition="'$(SignAssembly)' != 'true'">$(NoWarn);CP0003</NoWarn>

<!--
<PropertyGroup>
<TargetFrameworks>net461;net462;net47;net471;net472;net48;net481;netstandard2.0;net6.0;net7.0;net8.0;net9.0;</TargetFrameworks>

<RootNamespace>Org.BouncyCastle</RootNamespace>
<AssemblyOriginatorKeyFile>..\..\BouncyCastle.NET.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<NoWarn>1591</NoWarn>

<AssemblyName>BouncyCastle.Cryptography</AssemblyName>
<AssemblyTitle>BouncyCastle.NET Cryptography ($(TargetFramework))</AssemblyTitle>
<Authors>Legion of the Bouncy Castle Inc.</Authors>
<Company>Legion of the Bouncy Castle Inc.</Company>
<Copyright>Copyright © Legion of the Bouncy Castle Inc. 2000-2025</Copyright>
<Description>BouncyCastle.NET is a popular cryptography library for .NET</Description>
<PackageIcon>packageIcon.png</PackageIcon>
<PackageIconUrl>https://www.bouncycastle.org/stable/nuget/csharp/packageIcon.png</PackageIconUrl>
<PackageId>BouncyCastle.Cryptography</PackageId>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://www.bouncycastle.org/stable/nuget/csharp/website</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>https://www.bouncycastle.org/stable/nuget/csharp/release_notes</PackageReleaseNotes>
<PackageTags>bouncycastle cryptography dtls encryption open-source openpgp post-quantum security tls</PackageTags>
<Product>BouncyCastle.NET</Product>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Title>BouncyCastle.NET Cryptography</Title>
<Configurations>Debug;Release;Publish</Configurations>
</PropertyGroup>

<!-- CI systems other than GitLab might need different conditions -->
<PropertyGroup Condition="'$(CI)' != ''">
<!-- Deterministic build. -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<!--Source-Level Debugging-->
<PropertyGroup>
<!-- Any custom target adding things to the Compile item group needs BeforeTargets="BeforeCompile". -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>

<!-- Tell SourceLink to use this remote to derive the published git repository URL and source links. -->
<GitRepositoryRemoteName>public</GitRepositoryRemoteName>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<!--Package Validation-->
<PropertyGroup>
<EnablePackageValidation>false</EnablePackageValidation>
<PackageValidationBaselineVersion>2.0.0</PackageValidationBaselineVersion>

<!-- In case we disable signing for local builds, ignore identity mismatch with baseline version. -->
<NoWarn Condition="'$(SignAssembly)' != 'true'">$(NoWarn);CP0003</NoWarn>

<!--
We added Span-based variant methods to several APIs. Code that uses those methods or implements the
affected interfaces (or abstract classes) will not be backward compatible. There are also several
methods in DotNetUtilities dealing with ECDsa which is only available from net47.

TODO: Use suppressions for each individual case of version-dependent methods.
-->
<NoWarn>$(NoWarn);CP0002;CP0005;CP0006</NoWarn>
<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DefineConstants />
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Optimize>True</Optimize>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Publish'">
<DefineConstants />
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Deterministic build. -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Optimize>True</Optimize>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="\" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target Name="FixAssemblyAttributes" AfterTargets="GetBuildVersion">
<PropertyGroup>
<!-- Here we can override/use any MSBuild properties set by Nerdbank.GitVersioning -->
</PropertyGroup>
</Target>
<Target Name="SignAssemblies" AfterTargets="PostBuildEvent" Condition="'$(Configuration)'=='Publish'">
<Exec Command="call &quot;$(ProjectDir)..\..\signfile.bat&quot; &quot;$(TargetPath)&quot;" IgnoreStandardErrorWarningFormat="true" />
</Target>
<NoWarn>$(NoWarn);CP0002;CP0005;CP0006</NoWarn>
<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DefineConstants />
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Optimize>True</Optimize>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Publish'">
<DefineConstants />
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Deterministic build. -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Optimize>True</Optimize>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="\" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="\" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target Name="FixAssemblyAttributes" AfterTargets="GetBuildVersion">
<PropertyGroup>
<!-- Here we can override/use any MSBuild properties set by Nerdbank.GitVersioning -->
</PropertyGroup>
</Target>
<Target Name="SignAssemblies" AfterTargets="PostBuildEvent" Condition="'$(Configuration)'=='Publish'">
<Exec Command="call &quot;$(ProjectDir)..\..\signfile.bat&quot; &quot;$(TargetPath)&quot;" IgnoreStandardErrorWarningFormat="true" />
</Target>
</Project>
79 changes: 40 additions & 39 deletions crypto/test/BouncyCastle.Crypto.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1;net472;net461</TargetFrameworks>
<IsPackable>false</IsPackable>
<SignAssembly>false</SignAssembly>
<EnableDefaultItems>false</EnableDefaultItems>
<NoWarn>618;1591</NoWarn>
<RootNamespace>Org.BouncyCastle</RootNamespace>
<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
<Configurations>Debug;Release;Publish</Configurations>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net461;net462;net47;net471;net472;net48;net481;netstandard2.0;net6.0;net7.0;net8.0;net9.0;</TargetFrameworks>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<IsPackable>false</IsPackable>
<SignAssembly>false</SignAssembly>
<EnableDefaultItems>false</EnableDefaultItems>
<NoWarn>618;1591</NoWarn>
<RootNamespace>Org.BouncyCastle</RootNamespace>
<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
<Configurations>Debug;Release;Publish</Configurations>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>True</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Publish'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>True</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>True</Optimize>
</PropertyGroup>

<ItemGroup>
<Compile Include="src\**\*.cs" Exclude="**\examples\**\*.cs" />
<EmbeddedResource Include="data\**\*.*" Exclude="**\README.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\BouncyCastle.Crypto.csproj">
<SetTargetFramework Condition="'$(TargetFramework)' == 'net472'">TargetFramework=netstandard2.0</SetTargetFramework>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)'=='Publish'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>True</Optimize>
</PropertyGroup>

<ItemGroup>
<Compile Include="src\**\*.cs" Exclude="**\examples\**\*.cs" />
<EmbeddedResource Include="data\**\*.*" Exclude="**\README.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\BouncyCastle.Crypto.csproj">
<SetTargetFramework Condition="'$(TargetFramework)' == 'net472'">TargetFramework=netstandard2.0</SetTargetFramework>
</ProjectReference>
</ItemGroup>
</Project>