-
Notifications
You must be signed in to change notification settings - Fork 698
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
add options to suppress dependencies in package #2237
Conversation
d088ce1
to
7967171
Compare
🔔 |
@@ -45,6 +45,7 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
<ImportNuGetBuildTasksPackTargetsFromSdk Condition="'$(ImportNuGetBuildTasksPackTargetsFromSdk)' == ''">false</ImportNuGetBuildTasksPackTargetsFromSdk> | |||
<AllowedOutputExtensionsInPackageBuildOutputFolder>.dll; .exe; .winmd; .json; .pri; .xml; $(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInPackageBuildOutputFolder> | |||
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>.pdb; .mdb; $(AllowedOutputExtensionsInPackageBuildOutputFolder); $(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder> | |||
<SuppressDependenciesOnPacking Condition="'$(SuppressDependenciesOnPacking)' == ''">false</SuppressDependenciesOnPacking> |
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.
nit: how about SuppressDependenciesOnPack
instead of SuppressDependenciesOnPacking
@@ -205,11 +205,22 @@ public PackageBuilder GetPackageBuilder(IPackTaskRequest<IMSBuildItem> request) | |||
.ToDictionary(msbuildItem => msbuildItem.Identity, | |||
msbuildItem => msbuildItem.GetProperty("ProjectVersion"), PathUtility.GetStringComparerBasedOnOS()); | |||
} | |||
var nuGetFrameworkComparer = new NuGetFrameworkFullComparer(); | |||
var frameworksWithSuppressedDependencies = new HashSet<NuGetFramework>(nuGetFrameworkComparer); | |||
if (request.FrameworksWithSuppressedDependencies != null && request.FrameworksWithSuppressedDependencies.Any()) |
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.
FrameworksWithSuppressedDependencies is an array so you can use Length
field instead of Any()
which works on Enumerable
interface even for a list or array
FYI I tested private build on SDK, works well https://github.com/dotnet/sdk/compare/release/2.1.4xx...wli3:try-private-build-supress-all-dependency?expand=1 |
7967171
to
7b0bc87
Compare
@rohit21agrawal do you know which version has this change? I still cannot find it in |
Fixes: NuGet/Home#6354
Introduces a new property called
SuppressDependenciesOnPacking
that allows you to suppress dependency for a particular framework, or all of them.You can condition this property for a target framework like you can any other property:
<SuppressDependenciesOnPacking Condition="'$(TargetFramework)'=='net46'>true</SuppressDependenciesOnPacking>
CC: @wli3