Skip to content
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

Merged
merged 4 commits into from
May 22, 2018

Conversation

rohit21agrawal
Copy link
Contributor

@rohit21agrawal rohit21agrawal commented May 14, 2018

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

@rohit21agrawal rohit21agrawal force-pushed the dev-ragrawal-suppressdependency branch 2 times, most recently from d088ce1 to 7967171 Compare May 15, 2018 08:59
@rohit21agrawal
Copy link
Contributor Author

🔔

@@ -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>

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())

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

@wli3
Copy link

wli3 commented May 17, 2018

@wli3
Copy link

wli3 commented Jun 18, 2018

@rohit21agrawal do you know which version has this change? I still cannot find it in 4.8.0-preview3.5244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants