-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Port Microsoft.Extensions.* from pkgproj to dotnet pack #48385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
ViktorHofer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please also inline the PackageDescription from the leaf's Directory.Build.props file into the csproj files that are now packable?
What's a pkgpath file?
Can you please share a diff of the nuspecs before and after? |
| <PropertyGroup> | ||
| <TargetFrameworks>netstandard2.0;net461</TargetFrameworks> | ||
| <EnableDefaultItems>true</EnableDefaultItems> | ||
| <IsPackable>true</IsPackable> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead default this in a common props/targets file?
<IsPackable Condition="ProjectName.StartsWith('Microsoft.Extensions.') AND $(IsSourceProject)">true</IsPackable>There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO I would prefer this property to be explicit
|
Sample diff, we will have a different nuspec file for symbols packages. <EF><BB><BF><?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
- <metadata minClientVersion="2.12">
+<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
+ <metadata>
<id>Microsoft.Extensions.Configuration.Binder</id>
<version>6.0.0-dev</version>
<title>Microsoft.Extensions.Configuration.Binder</title>
<authors>Microsoft</authors>
- <owners>microsoft,dotnetframework</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
<icon>Icon.png</icon>
<projectUrl>https://github.com/dotnet/runtime</projectUrl>
- <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
<description>Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.</description>
<releaseNotes>https://go.microsoft.com/fwlink/?LinkID=799421</releaseNotes>
<copyright><C2><A9> Microsoft Corporation. All rights reserved.</copyright>
- <serviceable>true</serviceable>
<repository type="git" url="git://github.com/dotnet/runtime" commit="0000000000000000000000000000000000000000" />
<dependencies>
<group targetFramework=".NETFramework4.6.1">
- <dependency id="Microsoft.Extensions.Configuration.Abstractions" version="6.0.0-dev" />
+ <dependency id="Microsoft.Extensions.Configuration.Abstractions" version="6.0.0-dev" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
- <dependency id="Microsoft.Extensions.Configuration.Abstractions" version="6.0.0-dev" />
+ <dependency id="Microsoft.Extensions.Configuration.Abstractions" version="6.0.0-dev" exclude="Build,Analyzers" />
</group>
</dependencies>
- <frameworkAssemblies>
- <frameworkAssembly assemblyName="mscorlib" targetFramework=".NETFramework4.6.1" />
- <frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.6.1" />
- <frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.6.1" />
- </frameworkAssemblies>
</metadata>
<files>
- <file src="C:\Users\anagniho\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21105.12\tools\Assets\DotNetPackageIcon.png" target="Icon.png" exclude="" />
- <file src="C:\git\runtime5\artifacts\bin\Microsoft.Extensions.Configuration.Binder\net461-Debug\Microsoft.Extensions.Configuration.Binder.dll" target="lib\net461" exclude="" />
- <file src="C:\git\runtime5\artifacts\bin\Microsoft.Extensions.Configuration.Binder\net461-Debug\Microsoft.Extensions.Configuration.Binder.pdb" target="lib\net461" exclude="" />
- <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\Microsoft.Extensions.Configuration.Binder.xml" target="lib\net461" exclude="" />
- <file src="C:\git\runtime5\artifacts\bin\Microsoft.Extensions.Configuration.Binder\netstandard2.0-Debug\Microsoft.Extensions.Configuration.Binder.dll" target="lib\netstandard2.0" exclude="" />
- <file src="C:\git\runtime5\artifacts\bin\Microsoft.Extensions.Configuration.Binder\netstandard2.0-Debug\Microsoft.Extensions.Configuration.Binder.pdb" target="lib\netstandard2.0" exclude="" />
- <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\Microsoft.Extensions.Configuration.Binder.xml" target="lib\netstandard2.0" exclude="" />
- <file src="C:\git\runtime5\LICENSE.TXT" target="LICENSE.TXT" exclude="" />
- <file src="C:\git\runtime5\THIRD-PARTY-NOTICES.TXT" target="THIRD-PARTY-NOTICES.TXT" exclude="" />
+ <file src="C:\git\runtime4\artifacts\bin\Microsoft.Extensions.Configuration.Binder\net461-Debug\Microsoft.Extensions.Configuration.Binder.dll" target="lib\net461\Microsoft.Extensions.Configuration.Binder.dll" />
+ <file src="C:\git\runtime4\artifacts\bin\Microsoft.Extensions.Configuration.Binder\net461-Debug\Microsoft.Extensions.Configuration.Binder.xml" target="lib\net461\Microsoft.Extensions.Configuration.Binder.xml" />
+ <file src="C:\git\runtime4\artifacts\bin\Microsoft.Extensions.Configuration.Binder\netstandard2.0-Debug\Microsoft.Extensions.Configuration.Binder.dll" target="lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll" />
+ <file src="C:\git\runtime4\artifacts\bin\Microsoft.Extensions.Configuration.Binder\netstandard2.0-Debug\Microsoft.Extensions.Configuration.Binder.xml" target="lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.xml" />
+ <file src="C:\Users\anagniho\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21105.12\tools\Assets\DotNetPackageIcon.png" target="Icon.png" />
+ <file src="C:\git\runtime4\LICENSE.TXT" target="LICENSE.TXT" />
+ <file src="C:\git\runtime4\THIRD-PARTY-NOTICES.TXT" target="THIRD-PARTY-NOTICES.TXT" />
</files>
</package>
\ No newline at end of file |
| <ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Configuration.FileExtensions\src\Microsoft.Extensions.Configuration.FileExtensions.csproj" /> | ||
| <ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.FileProviders.Abstractions\src\Microsoft.Extensions.FileProviders.Abstractions.csproj" /> | ||
| <ProjectReference Include="$(LibrariesProjectRoot)System.Security.Cryptography.Xml\src\System.Security.Cryptography.Xml.csproj" /> | ||
| <ProjectReference Include="$(LibrariesProjectRoot)System.Security.Cryptography.Xml\src\System.Security.Cryptography.Xml.csproj" Condition="!$(TargetFramework.StartsWith('net4'))" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <ProjectReference Include="$(LibrariesProjectRoot)System.Security.Cryptography.Xml\src\System.Security.Cryptography.Xml.csproj" Condition="!$(TargetFramework.StartsWith('net4'))" /> | |
| <ProjectReference Include="$(LibrariesProjectRoot)System.Security.Cryptography.Xml\src\System.Security.Cryptography.Xml.csproj" Condition="'$(TargetFramework)' == 'netstandard2.0'" /> |
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="..\..\System.Diagnostics.EventLog\ref\System.Diagnostics.EventLog.csproj" /> | ||
| <ProjectReference Include="..\..\System.Diagnostics.EventLog\ref\System.Diagnostics.EventLog.csproj" Condition="!$(TargetFramework.StartsWith('net4'))" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <ProjectReference Include="..\..\System.Diagnostics.EventLog\ref\System.Diagnostics.EventLog.csproj" Condition="!$(TargetFramework.StartsWith('net4'))" /> | |
| <ProjectReference Include="..\..\System.Diagnostics.EventLog\ref\System.Diagnostics.EventLog.csproj" Condition="'$(TargetFramework)' == 'netstandard2.0'" /> |
|
|
||
| <PropertyGroup> | ||
| <TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties> | ||
| <TraversalGlobalProperties>BuildAllProjects=true;BuildTargetFramework=</TraversalGlobalProperties> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change necessary?
|
Curious, why is |
|
Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer Issue DetailsDesign Changes
Validation changes
|
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <NuSpecOutputPath Condition="'$(NuSpecOutputPath)' == ''">$([MSBuild]::NormalizeDirectory('$(ArtifactsPackagesDir)', 'specs'))</NuSpecOutputPath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are nuspecs generated by default by NuGet when invoking their Pack task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, by default its in the obj directory.
|
What's the status of this PR? It would have been nice to have as it would save some complexity in #51064. |
|
Its currently blocked on this NuGet/NuGet.Client#3980 i need to fix the tests in the nuget pr |
Do we have an issue on our side somewhere describing why we need that or how we intend to use it? Trying to connect the dots here. |
|
@Anipik can't you just in the meantime override the property via a target? There are places where we already do stuff in a target fo packaging related settings/validations. |
|
closing this in favor of #51765 |
Design Changes
Validation changes