Skip to content

Commit 1fd3847

Browse files
committed
Strong named deploy (parallel and separate)
1 parent 3d70d03 commit 1fd3847

File tree

10 files changed

+128
-1
lines changed

10 files changed

+128
-1
lines changed

.nuget/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Nivot.StrongNaming" version="1.0.4.2" />
34
<package id="NuGet.CommandLine" version="2.8.0" />
45
<package id="Redis-64" version="2.8.4" />
56
</packages>

StackExchange.Redis.StrongName.nuspec

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package>
3+
<metadata>
4+
<id>StackExchange.Redis.StrongName</id>
5+
<version>1.0.312</version>
6+
<authors>Stack Exchange inc., marc.gravell</authors>
7+
<owners>Stack Exchange inc., marc.gravell</owners>
8+
<summary>Redis client library</summary>
9+
<description>High performance Redis client, incorporating both synchronous and asynchronous usage; the notional successor to BookSleeve</description>
10+
<tags>Async Redis NoSQL Client Distributed Cache PubSub Messaging</tags>
11+
<language>en-US</language>
12+
<projectUrl>https://github.com/StackExchange/StackExchange.Redis</projectUrl>
13+
<licenseUrl>https://raw.github.com/StackExchange/StackExchange.Redis/master/LICENSE</licenseUrl>
14+
<copyright>Stack Exchange inc. 2014</copyright>
15+
16+
<dependencies>
17+
<group targetFramework="net40">
18+
<dependency id="Microsoft.Bcl" version="1.1.8"/>
19+
<dependency id="Microsoft.Bcl.Async" version="1.0.168"/>
20+
<dependency id="Microsoft.Bcl.Build" version="1.0.14"/>
21+
</group>
22+
<group targetFramework="net45">
23+
</group>
24+
</dependencies>
25+
</metadata>
26+
<files>
27+
<file src="StackExchange.Redis\bin\Release\StackExchange.Redis*.*" target="lib\net45" />
28+
<file src="StackExchange.Redis_Net40\bin\Release\StackExchange.Redis*.*" target="lib\net40" />
29+
</files>
30+
</package>

StackExchange.Redis.sln

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.30324.0
4+
VisualStudioVersion = 12.0.30501.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis", "StackExchange.Redis\StackExchange.Redis.csproj", "{7CEC07F2-8C03-4C42-B048-738B215824C1}"
77
EndProject
@@ -39,6 +39,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3939
monobuild.cmd = monobuild.cmd
4040
netbuild.cmd = netbuild.cmd
4141
StackExchange.Redis.nuspec = StackExchange.Redis.nuspec
42+
StackExchange.Redis.snk = StackExchange.Redis.snk
43+
StackExchange.Redis.StrongName.nuspec = StackExchange.Redis.StrongName.nuspec
44+
StrongName.ps1 = StrongName.ps1
4245
EndProjectSection
4346
EndProject
4447
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionWatcher", "ConnectionWatcher\ConnectionWatcher.csproj", "{6756F911-BD09-4226-B597-67871DEB8ED5}"

StackExchange.Redis.snk

596 Bytes
Binary file not shown.

StrongName.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$key = Import-StrongNameKeyPair -KeyFile StackExchange.Redis.snk
2+
dir StackExchange.Redis*/bin/Release/StackExchange.Redis.dll | Set-StrongName -KeyPair $key -Verbose -NoBackup -Force
3+
nuget pack StackExchange.Redis.StrongName.nuspec
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Nivot.StrongNaming
2+
==================
3+
4+
* v1.0.4.1 (something fishy is going on with my package build process?)
5+
* v1.0.4 (fix missing mono.cecil)
6+
* v1.0.3.2 (fix package: second attempt; readme.txt auto-open)
7+
* v1.0.3.1 (fix package)
8+
* v1.0.3 [2014/01/26]
9+
* Assembly references without a strongname will be given a strong name using the same
10+
public key token as the primary target assembly.
11+
* v1.0.2 [2013/04/30]
12+
* Added license and project URL.
13+
* Added readme.MD
14+
* v1.0.1 [2013/04/29]
15+
* Updated metadata.
16+
* v1.0.0 [2013/04/29]
17+
* Initial release.
18+
19+
Details
20+
=======
21+
22+
All cmdlets accept pipeline input. The AssemblyFile parameter is aliased to PSPath, so it will
23+
bind to piped files.
24+
25+
* Test-StrongName [-AssemblyFile] <string[]> [<CommonParameters>]
26+
27+
Returns true if an assembly has a strong name.
28+
29+
* Import-StrongNameKeyPair [-KeyFile] <string> [<CommonParameters>]
30+
* Import-StrongNameKeyPair [-KeyFile] <string> -Password <securestring> [<CommonParameters>]
31+
32+
Imports a simple unprotected SNK or a password-protected PFX, returning a StrongNameKeyPair
33+
instance for consumption by Set-StrongName. If your PFX file has a blank password, you must
34+
provide a SecureString of the empty string "". SecureString instances are returned from
35+
the Read-Host cmdlet with the -AsSecureString parameter.
36+
37+
* Set-StrongName [-AssemblyFile] <string[]> -KeyPair <StrongNameKeyPair> [-NoBackup] [-Passthru]
38+
[-Force] [-DelaySign] [-WhatIf] [-Confirm] [<CommonParameters>]
39+
40+
Assigns a strong name identity to an assembly.
41+
42+
The -KeyPair parameter accepts a System.Reflection.StrongNameKeyPair output from the
43+
Import-StrongNameKeyPair cmdlet., which accepts either simple unprotected SNK files or
44+
password-protected PFX files.
45+
46+
The -NoBackup switch directs the cmdlet to skip creating a .bak file alongside the newly
47+
signed assembly.
48+
49+
The -Passthru switch will output a FileInfo representing the newly signed assembly to
50+
the pipeline.
51+
52+
The -DelaySign switch will create a delay-signed assembly from a public key only SNK
53+
(it can also create one if the SNK contains both private and public keys.) This is useful
54+
if you can't get access to the full private key at your company. This will allow you to
55+
compile against previously unsigned nuget packages at least.
56+
57+
The -Force switch will allow you to overwrite an existing strong name on an assembly.
58+
59+
NOTE: You may supply -WhatIf to see what _would_ be done, without actually doing it.
60+
61+
* Get-AssemblyName [-AssemblyFile] <string[]> [<CommonParameters>]
62+
63+
Returns a System.Reflection.AssemblyName instance from any assembly file.
64+
65+
FAQ: How Do I?
66+
==============
67+
68+
# get the default package root folder
69+
PM> $root = join-path (split-path $dte.solution.filename) packages
70+
71+
# load an unprotected snk
72+
PM> $key = Import-StrongNameKeyPair -KeyFile .\folder\key.snk
73+
PM> dir *.dll | Set-StrongName -KeyPair $key -Verbose
74+
75+
# load a password-protected PFX
76+
PM> $key = Import-StrongNameKeyPair -KeyFile .\folder\key.pfx -Password (Read-Host -AsSecureString)
77+
******
78+
79+
# sign some unsigned assemblies
80+
PM> cd (join-path $root unsignedPackage)
81+
PM> dir -rec *.dll | set-strongname -keypair $key -verbose
82+
83+
# (re)sign some assemblies forcefully
84+
PM> dir -rec *.dll | set-strongname -keypair $key -force
85+
86+
# sign only unsigned assemblies
87+
PM> dir -rec *.dll | where { -not (test-strongname $_) } | set-strongname -keypair $key -verbose
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
param($installPath, $toolsPath, $package)
2+
3+
import-module (join-path $toolsPath StrongNaming.psd1)

0 commit comments

Comments
 (0)