Skip to content

Commit

Permalink
build: add strong name signing to library and unit test projects
Browse files Browse the repository at this point in the history
- Add strong name key file src/dtm-labs-client-csharp.snk
- Update dependencies.props with strong name key
- Sign projects with snk file
  • Loading branch information
wooln committed Dec 12, 2024
1 parent 8a4bcb1 commit 3fa9b39
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 14 deletions.
9 changes: 4 additions & 5 deletions build/dependencies.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
<Project>
<PropertyGroup>
<!-- strong name -->
<StringNameKey>0024000004800000140100000602000000240000525341310008000001000100af985b61d0182de7678c452f994cd186320feeb7706d175663b9c8659e03ff14098841d1c633133fca59e1044f5f16edaf7ae9c47afa1076ff83a21d86b3f1202f532f404498079dca32c3d4fb35cda2603237291220fe61fe17865654c93d7dceffe0bbd47106a73b57319af4696e422cb5c6c57fcdf1ab491e9c81a5b28a2ef160f31fcada307a4388c2f25a66d441950f75df7edae2e750320d01ab2e446b2af095111e08d95665e9595c2070502ff055f1a6289c1f0bdb04983699403e1cfb060efc66e172501859fc2a7c42c7deede9ac35fbd7d62e4baaa293b1eaae3e1732e3037c4fb995bb9ad33afdc177a07ef5124c5370700e6b517315d5e0a798</StringNameKey>
<StringNamePublicKey>ad31ee3e27a4d060</StringNamePublicKey>
<!-- DtmCommon -->
<DapperPackageVersion>2.0.123</DapperPackageVersion>
<SystemTextJsonPackageVersion6>6.0.7</SystemTextJsonPackageVersion6>
Expand All @@ -14,17 +18,13 @@
<MicrosoftExtensionsConfigurationNSD21>6.0.0</MicrosoftExtensionsConfigurationNSD21>
<MicrosoftExtensionsHttpNSD21>6.0.0</MicrosoftExtensionsHttpNSD21>
<MicrosoftExtensionsOptionsConfigurationExtensionsNSD21>6.0.0</MicrosoftExtensionsOptionsConfigurationExtensionsNSD21>

<!-- Dtmgrpc -->
<GoogleProtobufPackageVersion>3.22.1</GoogleProtobufPackageVersion>
<GrpcNetClientFactoryPackageVersion>2.52.0</GrpcNetClientFactoryPackageVersion>
<GrpcToolsPackageVersion>2.52.0</GrpcToolsPackageVersion>

<!-- Barrier Extension -->
<MongoDBDriverPackageVersion>2.19.0</MongoDBDriverPackageVersion>
<StackExchangeRedisPackageVersion>2.6.96</StackExchangeRedisPackageVersion>


<!-- TEST And Samples -->
<GrpcAspNetCorePackageVersion>2.52.0</GrpcAspNetCorePackageVersion>
<MySqlConnectorPackageVersion>2.2.5</MySqlConnectorPackageVersion>
Expand All @@ -37,6 +37,5 @@
<DbMockerPackageVersion>1.22.0</DbMockerPackageVersion>
<MicrosoftDataSqlClientPackageVersion>5.1.0</MicrosoftDataSqlClientPackageVersion>
<SwashbuckleAspNetCorePackageVersion>6.5.0</SwashbuckleAspNetCorePackageVersion>

</PropertyGroup>
</Project>
18 changes: 13 additions & 5 deletions src/DtmCommon/DtmCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0</TargetFrameworks>
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
<PackageTags>dtm,csharp,distributed transaction,tcc,saga,msg</PackageTags>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="Dtmgrpc" />
<InternalsVisibleTo Include="Dtmgrpc.Tests" />
<InternalsVisibleTo Include="Dtmcli" />
<InternalsVisibleTo Include="Dtmcli.Tests" />
<InternalsVisibleTo Include="DtmMongoBarrier" />
<InternalsVisibleTo Include="Dtmgrpc" Key="$(StringNameKey)" />
<InternalsVisibleTo Include="Dtmgrpc.Tests" Key="$(StringNameKey)" />
<InternalsVisibleTo Include="Dtmcli" Key="$(StringNameKey)" />
<InternalsVisibleTo Include="Dtmcli.Tests" Key="$(StringNameKey)" />
<InternalsVisibleTo Include="DtmMongoBarrier" Key="$(StringNameKey)" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -40,4 +42,10 @@
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(MicrosoftExtensionsOptionsConfigurationExtensionsNSD21)" />
</ItemGroup>

<ItemGroup>
<None Include="..\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions src/DtmDapr/DtmDapr.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
<PackageTags>dtm,dapr,csharp,distributed transaction,tcc,saga,msg</PackageTags>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Dtmcli\Dtmcli.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions src/DtmMongoBarrier/DtmMongoBarrier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0</TargetFrameworks>
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
<PackageTags>dtm,csharp,distributed transaction,tcc,saga,msg</PackageTags>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,4 +16,10 @@
<ProjectReference Include="..\DtmCommon\DtmCommon.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions src/DtmSERedisBarrier/DtmSERedisBarrier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0</TargetFrameworks>
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
<PackageTags>dtm,csharp,distributed transaction,tcc,saga,msg</PackageTags>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,4 +16,10 @@
<ProjectReference Include="..\DtmCommon\DtmCommon.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>
12 changes: 10 additions & 2 deletions src/Dtmcli/Dtmcli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0</TargetFrameworks>
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
<PackageTags>dtm,csharp,distributed transaction,tcc,saga,msg</PackageTags>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="Dtmcli.Tests" />
<InternalsVisibleTo Include="Dtmworkflow" />
<InternalsVisibleTo Include="Dtmcli.Tests" Key="$(StringNameKey)" />
<InternalsVisibleTo Include="Dtmworkflow" Key="$(StringNameKey)" />
<!--<None Include="$(MSBuildThisFileDirectory)../../README.md" Pack="true" PackagePath="/" />-->
</ItemGroup>

Expand All @@ -20,5 +22,11 @@
<ProjectReference Include="..\DtmCommon\DtmCommon.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>


</Project>
10 changes: 9 additions & 1 deletion src/Dtmgrpc/Dtmgrpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0</TargetFrameworks>
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
<PackageTags>dtm,csharp,distributed transaction,tcc,saga,msg</PackageTags>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<Protobuf Include=".\dtmgpb\dtmgimp.proto" GrpcServices="Client" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Dtmgrpc.Tests" />
<InternalsVisibleTo Include="Dtmgrpc.Tests" Key="$(StringNameKey)" />
</ItemGroup>

<ItemGroup>
Expand All @@ -27,6 +29,12 @@
<ProjectReference Include="..\DtmCommon\DtmCommon.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>



</Project>
10 changes: 9 additions & 1 deletion src/Dtmworkflow/Dtmworkflow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net7.0</TargetFramework>
<Description>a c# client for distributed transaction framework dtm. 分布式事务管理器dtm的c#客户端</Description>
<PackageTags>dtm,csharp,distributed transaction,tcc,saga,msg</PackageTags>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -12,7 +14,13 @@
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Dtmworkflow.Tests" />
<InternalsVisibleTo Include="Dtmworkflow.Tests" Key="$(StringNameKey)" />
</ItemGroup>

<ItemGroup>
<None Include="..\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>
Binary file added src/dtm-labs-client-csharp.snk
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/BusiGrpcService/BusiGrpcService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@
<Protobuf Include="..\protos\busi.proto" GrpcServices="Server" Link="Protos\busi.proto" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\src\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions tests/Dtmcli.Tests/Dtmcli.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!--<Nullable>enable</Nullable>-->

<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\src\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -27,4 +29,10 @@
<ProjectReference Include="..\..\src\Dtmcli\Dtmcli.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\src\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!--<Nullable>enable</Nullable>-->

<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\src\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -39,4 +41,11 @@
<Protobuf Include="..\protos\busi.proto" GrpcServices="Client" Link="Protos\busi.proto" />
</ItemGroup>


<ItemGroup>
<None Include="..\..\src\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions tests/Dtmgrpc.Tests/Dtmgrpc.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFrameworks>net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\src\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -24,6 +26,12 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Dtmgrpc\Dtmgrpc.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\src\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>


</Project>
8 changes: 8 additions & 0 deletions tests/Dtmworkflow.Tests/Dtmworkflow.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\src\dtm-labs-client-csharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -26,4 +28,10 @@
<ProjectReference Include="..\..\src\Dtmworkflow\Dtmworkflow.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\src\dtm-labs-client-csharp.snk">
<Link>dtm-labs-client-csharp.snk</Link>
</None>
</ItemGroup>

</Project>

0 comments on commit 3fa9b39

Please sign in to comment.