Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Commit 5b2dd24

Browse files
committed
Add a .nuspec file to ensure framework assemblies are correctly added to the OWIN introspection package
1 parent 4d96f55 commit 5b2dd24

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

src/Owin.Security.OAuth.Introspection/Owin.Security.OAuth.Introspection.csproj

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,40 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25+
<Reference Include="System.IdentityModel" />
2526
<Reference Include="System.Net.Http" />
2627
</ItemGroup>
2728

29+
<!--
30+
Warning: due to a design change in NuGet, framework assemblies (represented as 'References' nodes in this file)
31+
are no longer automatically added to the .nuspec file published with this package. To avoid a breaking change that
32+
would force final users to reference the framework assemblies in their own project, automatic .nuspec generation
33+
is disabled and replaced by a custom Owin.Security.OAuth.Introspection.nuspec file that explicitly references
34+
them under the 'frameworkAssemblies' node. See https://github.com/NuGet/Home/issues/4853 for more information.
35+
-->
36+
37+
<PropertyGroup>
38+
<NuSpecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuSpecFile>
39+
</PropertyGroup>
40+
41+
<Target Name="SetPackageProperties" BeforeTargets="GenerateNuspec">
42+
<PropertyGroup>
43+
<NuspecProperties>$(NuspecProperties);id=$(PackageId)</NuspecProperties>
44+
<NuspecProperties>$(NuspecProperties);version=$(PackageVersion)</NuspecProperties>
45+
<NuspecProperties>$(NuspecProperties);authors=$(Authors)</NuspecProperties>
46+
<NuspecProperties>$(NuspecProperties);requireLicenseAcceptance=$(PackageRequireLicenseAcceptance)</NuspecProperties>
47+
<NuspecProperties>$(NuspecProperties);licenseUrl=$(PackageLicenseUrl)</NuspecProperties>
48+
<NuspecProperties>$(NuspecProperties);projectUrl=$(PackageProjectUrl)</NuspecProperties>
49+
<NuspecProperties>$(NuspecProperties);iconUrl=$(PackageIconUrl)</NuspecProperties>
50+
<NuspecProperties>$(NuspecProperties);description=$(Description)</NuspecProperties>
51+
<NuspecProperties>$(NuspecProperties);tags=$(PackageTags.Replace(";"," "))</NuspecProperties>
52+
<NuspecProperties>$(NuspecProperties);repositoryType=$(RepositoryType)</NuspecProperties>
53+
<NuspecProperties>$(NuspecProperties);repositoryUrl=$(RepositoryUrl)</NuspecProperties>
54+
<NuspecProperties>$(NuspecProperties);configuration=$(Configuration)</NuspecProperties>
55+
<NuspecProperties>$(NuspecProperties);aspNetCoreVersion=$(AspNetCoreVersion)</NuspecProperties>
56+
<NuspecProperties>$(NuspecProperties);jsonNetVersion=$(JsonNetVersion)</NuspecProperties>
57+
<NuspecProperties>$(NuspecProperties);identityModelVersion=$(IdentityModelVersion)</NuspecProperties>
58+
</PropertyGroup>
59+
</Target>
60+
2861
</Project>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
3+
<metadata>
4+
<id>$id$</id>
5+
<version>$version$</version>
6+
<authors>$authors$</authors>
7+
<owners>$authors$</owners>
8+
<requireLicenseAcceptance>$requireLicenseAcceptance$</requireLicenseAcceptance>
9+
<licenseUrl>$licenseUrl$</licenseUrl>
10+
<projectUrl>$projectUrl$</projectUrl>
11+
<iconUrl>$iconUrl$</iconUrl>
12+
<description>$description$</description>
13+
<tags>$tags$</tags>
14+
<repository type="$repositoryType$" url="$repositoryUrl$" />
15+
<dependencies>
16+
<group targetFramework=".NETFramework4.5.1">
17+
<dependency id="Microsoft.Owin.Security.Interop" version="$aspNetCoreVersion$" exclude="Build,Analyzers" />
18+
<dependency id="Microsoft.Extensions.Caching.Memory" version="$aspNetCoreVersion$" exclude="Build,Analyzers" />
19+
<dependency id="Microsoft.Extensions.Logging" version="$aspNetCoreVersion$" exclude="Build,Analyzers" />
20+
<dependency id="Newtonsoft.Json" version="$jsonNetVersion$" exclude="Build,Analyzers" />
21+
<dependency id="Microsoft.IdentityModel.Protocol.Extensions" version="$identityModelVersion$" exclude="Build,Analyzers" />
22+
</group>
23+
</dependencies>
24+
<frameworkAssemblies>
25+
<frameworkAssembly assemblyName="System.IdentityModel" targetFramework=".NETFramework4.5.1" />
26+
<frameworkAssembly assemblyName="System.Net.Http" targetFramework=".NETFramework4.5.1" />
27+
</frameworkAssemblies>
28+
</metadata>
29+
<files>
30+
<file src="bin\$configuration$\net451\$id$.dll" target="lib\net451" />
31+
<file src="bin\$configuration$\net451\$id$.xml" target="lib\net451" />
32+
</files>
33+
</package>

0 commit comments

Comments
 (0)