Skip to content

Commit 7b7acb4

Browse files
authored
Merge pull request #31 from RusticiSoftware/MultiTargetNuget
Multiple framework targets and signed version in nuget package
2 parents 6bccedc + ba86dbc commit 7b7acb4

5 files changed

Lines changed: 107 additions & 12 deletions

File tree

RELEASE.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@ Make sure that the `TinCan/Properties/AssemblyInfo.cs` has been updated with new
22

33
TinCan -> Properties -> Assembly Information
44

5-
Then set the Build Configuration to "Release" and build the solution. (Verify `bin/Release/TinCan.dll` has correct version.)
5+
Obtain the `TinCan.NET.pfx` file that is used for signing the relevant portions of the release.
6+
7+
Then right-click the solution in the "Solution Explorer" view and select "Batch Build...". Check the "Build" checkbox for the following `TinCan` configurations:
8+
Release-net35
9+
Release-net40
10+
Release-net45
11+
Release-net45-signed
12+
13+
Then click "Build" to build the selected configurations. (Verify `bin/Release/net<X>/TinCan.dll` has correct version.)
614

715
With `nuget.exe` installed and in your path do:
816

917
cd TinCan
10-
nuget pack TinCan.csproj -sym -Prop Configuration=Release
18+
nuget pack TinCan.csproj -sym -Prop Configuration=Release-net35
1119
nuget push TinCan.(version).nupkg
1220

21+
Note: Providing a `Configuration` property is mandatory, otherwise `nuget` will build the `Debug` configuration and include that in the package. The `<files>` portion of the `.nuspec` ensures all releases built previously are in the created `nuget` package.
22+
1323
Commit the updated assembly information file and push to master. Upload the generated `TinCan.(version).nupkg` as a GitHub tag release.

TinCan.sln

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,43 @@ Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1212
Debug|Any CPU = Debug|Any CPU
1313
Documentation|Any CPU = Documentation|Any CPU
14-
Release|Any CPU = Release|Any CPU
14+
Release-net35|Any CPU = Release-net35|Any CPU
15+
Release-net40|Any CPU = Release-net40|Any CPU
16+
Release-net45|Any CPU = Release-net45|Any CPU
17+
Release-net45-signed|Any CPU = Release-net45-signed|Any CPU
1518
EndGlobalSection
1619
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1720
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1821
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Debug|Any CPU.Build.0 = Debug|Any CPU
1922
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
2023
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
21-
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release|Any CPU.ActiveCfg = Release|Any CPU
22-
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU
25+
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net35|Any CPU.Build.0 = Release-net35|Any CPU
26+
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU
27+
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU
28+
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU
29+
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU
30+
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net45-signed|Any CPU.ActiveCfg = Release-net45-signed|Any CPU
31+
{27D0FCA1-E869-440C-9D16-F62D7A068C53}.Release-net45-signed|Any CPU.Build.0 = Release-net45-signed|Any CPU
2332
{854413C2-2F81-4A82-9949-DE2868A10078}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2433
{854413C2-2F81-4A82-9949-DE2868A10078}.Debug|Any CPU.Build.0 = Debug|Any CPU
2534
{854413C2-2F81-4A82-9949-DE2868A10078}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
26-
{854413C2-2F81-4A82-9949-DE2868A10078}.Release|Any CPU.ActiveCfg = Release|Any CPU
27-
{854413C2-2F81-4A82-9949-DE2868A10078}.Release|Any CPU.Build.0 = Release|Any CPU
35+
{854413C2-2F81-4A82-9949-DE2868A10078}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU
36+
{854413C2-2F81-4A82-9949-DE2868A10078}.Release-net35|Any CPU.Build.0 = Release-net35|Any CPU
37+
{854413C2-2F81-4A82-9949-DE2868A10078}.Release-net40|Any CPU.ActiveCfg = Release-net40|Any CPU
38+
{854413C2-2F81-4A82-9949-DE2868A10078}.Release-net40|Any CPU.Build.0 = Release-net40|Any CPU
39+
{854413C2-2F81-4A82-9949-DE2868A10078}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU
40+
{854413C2-2F81-4A82-9949-DE2868A10078}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU
41+
{854413C2-2F81-4A82-9949-DE2868A10078}.Release-net45-signed|Any CPU.ActiveCfg = Release-net45-signed|Any CPU
42+
{854413C2-2F81-4A82-9949-DE2868A10078}.Release-net45-signed|Any CPU.Build.0 = Release-net45-signed|Any CPU
2843
{F8D803AD-A192-4F8C-A582-674B75E42995}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2944
{F8D803AD-A192-4F8C-A582-674B75E42995}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
3045
{F8D803AD-A192-4F8C-A582-674B75E42995}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
31-
{F8D803AD-A192-4F8C-A582-674B75E42995}.Release|Any CPU.ActiveCfg = Release|Any CPU
32-
{F8D803AD-A192-4F8C-A582-674B75E42995}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net35|Any CPU.ActiveCfg = Release-net35|Any CPU
47+
{F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net35|Any CPU.Build.0 = Release-net35|Any CPU
48+
{F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net40|Any CPU.ActiveCfg = Release-net35|Any CPU
49+
{F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net45|Any CPU.ActiveCfg = Release-net35|Any CPU
50+
{F8D803AD-A192-4F8C-A582-674B75E42995}.Release-net45-signed|Any CPU.ActiveCfg = Release-net35|Any CPU
3351
EndGlobalSection
3452
GlobalSection(SolutionProperties) = preSolution
3553
HideSolutionNode = FALSE

TinCan/TinCan.csproj

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@
2222
<WarningLevel>4</WarningLevel>
2323
<DocumentationFile>bin\Debug\TinCan.XML</DocumentationFile>
2424
</PropertyGroup>
25-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net35|AnyCPU' ">
2626
<DebugType>pdbonly</DebugType>
2727
<Optimize>true</Optimize>
28-
<OutputPath>bin\Release\</OutputPath>
28+
<OutputPath>bin\Release\net35\</OutputPath>
2929
<DefineConstants>TRACE</DefineConstants>
3030
<ErrorReport>prompt</ErrorReport>
3131
<WarningLevel>4</WarningLevel>
32+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
3233
</PropertyGroup>
3334
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Documentation|AnyCPU'">
3435
<DebugSymbols>true</DebugSymbols>
@@ -40,6 +41,38 @@
4041
<ErrorReport>prompt</ErrorReport>
4142
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
4243
</PropertyGroup>
44+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-net40|AnyCPU'">
45+
<OutputPath>bin\Release\net40\</OutputPath>
46+
<DefineConstants>TRACE</DefineConstants>
47+
<Optimize>true</Optimize>
48+
<DebugType>pdbonly</DebugType>
49+
<PlatformTarget>AnyCPU</PlatformTarget>
50+
<ErrorReport>prompt</ErrorReport>
51+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
52+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
53+
</PropertyGroup>
54+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-net45|AnyCPU'">
55+
<OutputPath>bin\Release\net45\</OutputPath>
56+
<DefineConstants>TRACE</DefineConstants>
57+
<Optimize>true</Optimize>
58+
<DebugType>pdbonly</DebugType>
59+
<PlatformTarget>AnyCPU</PlatformTarget>
60+
<ErrorReport>prompt</ErrorReport>
61+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
62+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
63+
</PropertyGroup>
64+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-net45-signed|AnyCPU'">
65+
<OutputPath>bin\Release\net45-signed</OutputPath>
66+
<DefineConstants>TRACE</DefineConstants>
67+
<Optimize>true</Optimize>
68+
<DebugType>pdbonly</DebugType>
69+
<PlatformTarget>AnyCPU</PlatformTarget>
70+
<ErrorReport>prompt</ErrorReport>
71+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
72+
<SignAssembly>true</SignAssembly>
73+
<AssemblyOriginatorKeyFile>TinCan.NET.pfx</AssemblyOriginatorKeyFile>
74+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
75+
</PropertyGroup>
4376
<ItemGroup>
4477
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4578
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
@@ -97,6 +130,7 @@
97130
</ItemGroup>
98131
<ItemGroup>
99132
<None Include="packages.config" />
133+
<None Include="TinCan.NET.pfx" />
100134
</ItemGroup>
101135
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
102136
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

TinCan/TinCan.nuspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
<dependency id="Newtonsoft.Json" version="8.0" />
1919
</dependencies>
2020
</metadata>
21+
<files>
22+
<file src="bin\Release\**\TinCan*" target="lib" />
23+
</files>
2124
</package>

TinCanTests/TinCanTests.csproj

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
2424
</PropertyGroup>
25-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-net35|AnyCPU' ">
2626
<PlatformTarget>AnyCPU</PlatformTarget>
2727
<DebugType>pdbonly</DebugType>
2828
<Optimize>true</Optimize>
@@ -43,6 +43,36 @@
4343
<ErrorReport>prompt</ErrorReport>
4444
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
4545
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-net40|AnyCPU'">
47+
<OutputPath>bin\Release-net40\</OutputPath>
48+
<DefineConstants>TRACE</DefineConstants>
49+
<Optimize>true</Optimize>
50+
<DebugType>pdbonly</DebugType>
51+
<PlatformTarget>AnyCPU</PlatformTarget>
52+
<ErrorReport>prompt</ErrorReport>
53+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
54+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
55+
</PropertyGroup>
56+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-net45|AnyCPU'">
57+
<OutputPath>bin\Release-net45\</OutputPath>
58+
<DefineConstants>TRACE</DefineConstants>
59+
<Optimize>true</Optimize>
60+
<DebugType>pdbonly</DebugType>
61+
<PlatformTarget>AnyCPU</PlatformTarget>
62+
<ErrorReport>prompt</ErrorReport>
63+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
64+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
65+
</PropertyGroup>
66+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-net45-signed|AnyCPU'">
67+
<OutputPath>bin\Release-net45-signed\</OutputPath>
68+
<DefineConstants>TRACE</DefineConstants>
69+
<Optimize>true</Optimize>
70+
<DebugType>pdbonly</DebugType>
71+
<PlatformTarget>AnyCPU</PlatformTarget>
72+
<ErrorReport>prompt</ErrorReport>
73+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
74+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
75+
</PropertyGroup>
4676
<ItemGroup>
4777
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4878
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>

0 commit comments

Comments
 (0)