Skip to content

Commit 2119080

Browse files
SNOW-991583: Assembly delay sign (#956)
### Description Add delay sign for Snowflake Data assemblies. ### Checklist - [x] Code compiles correctly - [x] Code is formatted according to [Coding Conventions](../blob/master/CodingConventions.md) - [x] Created tests which fail without the change (if possible) - [x] All tests passing (`dotnet test`) - [x] Extended the README / documentation, if necessary - [x] Provide JIRA issue id (if possible) or GitHub issue id in PR name
1 parent abb5c4a commit 2119080

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

Snowflake.Data.Tests/Snowflake.Data.Tests.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1212
<LangVersion>9</LangVersion>
1313
<DefineConstants>$(SEQUENTIAL_ENV)</DefineConstants>
14+
<AssemblyOriginatorKeyFile>..\sign\publicKey.snk</AssemblyOriginatorKeyFile>
15+
<SignAssembly>true</SignAssembly>
16+
<DelaySign>true</DelaySign>
1417
</PropertyGroup>
1518
<ItemGroup>
1619
<PackageReference Include="JunitXml.TestLogger" Version="3.1.12" />
@@ -37,6 +40,12 @@
3740
<Reference Include="System.Net.Http.WebRequest" />
3841
</ItemGroup>
3942

43+
<ItemGroup>
44+
<None Include="..\sign\publicKey.snk">
45+
<Link>publicKey.snk</Link>
46+
</None>
47+
</ItemGroup>
48+
4049
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
4150
<DebugType>full</DebugType>
4251
<DebugSymbols>True</DebugSymbols>

Snowflake.Data/Snowflake.Data.csproj

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<Version>3.1.0</Version>
1616
<DebugType>Full</DebugType>
1717
<LangVersion>7.3</LangVersion>
18+
<AssemblyOriginatorKeyFile>..\sign\publicKey.snk</AssemblyOriginatorKeyFile>
19+
<DelaySign>true</DelaySign>
20+
<SignAssembly>true</SignAssembly>
1821
</PropertyGroup>
1922

2023
<ItemGroup>
@@ -40,9 +43,9 @@
4043
</ItemGroup>
4144

4245
<ItemGroup Condition="'$(Configuration)' != 'Release'">
43-
<InternalsVisibleTo Include="Snowflake.Data.Tests" />
46+
<InternalsVisibleTo Include="Snowflake.Data.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c159643cbf31e9bbbe7920091c39ecbd988b3e102df664830b33f12c9d838b07463682948cb56bbc414311fa019d6bca1dc08bc9d54684667fdd94ddf140f499ccb66795322128ba1804d8342fec912cea2704fe09c82dbf03bf10817330537d57e8177d92c205e93278245d18a84f185c53d1c5d917171c9807ac769ae9dfcb" />
4447
<!--needed by Moq to be able to mock internal interfaces-->
45-
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
48+
<InternalsVisibleTo Include="DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7" />
4649
</ItemGroup>
4750

4851
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -64,4 +67,10 @@
6467
<ItemGroup>
6568
<Folder Include="Properties\" />
6669
</ItemGroup>
70+
71+
<ItemGroup>
72+
<None Include="..\sign\publicKey.snk">
73+
<Link>publicKey.snk</Link>
74+
</None>
75+
</ItemGroup>
6776
</Project>

deploy.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ SET API_KEY=%2
55
SET ROOT_DIR=%~dp0
66
cd %ROOT_DIR%
77

8-
dotnet pack Snowflake.Data\Snowflake.Data.csproj -c Release --force -v n --output %ROOT_DIR%
8+
dotnet build Snowflake.Data\Snowflake.Data.csproj -c Release --force -v n
9+
10+
REM command to sign with strong name Snowflake.Data.dll should be here
11+
12+
dotnet pack Snowflake.Data\Snowflake.Data.csproj -c Release --force -v n --no-build --output %ROOT_DIR%
913

1014
dotnet nuget push Snowflake.Data.%VERSION%.nupkg -k %API_KEY% -s https://api.nuget.org/v3/index.json

sign/publicKey.snk

160 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)