diff --git a/src/NuGetizer.Tasks/NuGetizer.Compatibility.props b/src/NuGetizer.Tasks/NuGetizer.Compatibility.props index 4a5822fa..5b087f30 100644 --- a/src/NuGetizer.Tasks/NuGetizer.Compatibility.props +++ b/src/NuGetizer.Tasks/NuGetizer.Compatibility.props @@ -9,6 +9,9 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and This file brings SDK Pack compatibility conversions so that NuGetizer works with SDK Pack properties and items as much as possible, to ease migration. +NOTE: this file is imported from NuGetizer.Shared.targets, so it comes *after* project +properties. + Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> @@ -23,12 +26,20 @@ Copyright (c) .NET Foundation. All rights reserved. $(IncludeSource) $(IncludeBuildOutput) $(PackageDescription) + + false + + + false + + + $(BuildOutputKind) $(PrimaryOutputKind) - + $(IncludeContentInPackage) $(IncludeNoneInPackage) $(IncludeOutputsInPackage) diff --git a/src/NuGetizer.Tasks/NuGetizer.Inference.targets b/src/NuGetizer.Tasks/NuGetizer.Inference.targets index b9f23c03..a3777095 100644 --- a/src/NuGetizer.Tasks/NuGetizer.Inference.targets +++ b/src/NuGetizer.Tasks/NuGetizer.Inference.targets @@ -123,6 +123,7 @@ Copyright (c) .NET Foundation. All rights reserved. + false diff --git a/src/NuGetizer.Tests/given_packagereferences.cs b/src/NuGetizer.Tests/given_packagereferences.cs index d32ff802..99bc984c 100644 --- a/src/NuGetizer.Tests/given_packagereferences.cs +++ b/src/NuGetizer.Tests/given_packagereferences.cs @@ -130,6 +130,62 @@ public void when_privateassets_pack_false_then_does_not_pack() })); } + [Fact] + public void when_SuppressDependenciesWhenPacking_then_does_not_pack() + { + var result = Builder.BuildProject(@" + + + Library + net472 + true + + + + + +", + "GetPackageContents", output); + + result.AssertSuccess(output); + Assert.DoesNotContain(result.Items, item => item.Matches(new + { + Identity = "Newtonsoft.Json" + })); + Assert.DoesNotContain(result.Items, item => item.Matches(new + { + Identity = "WindowsBase" + })); + } + + [Fact] + public void when_SuppressDependenciesWhenPackingFalse_then_packs() + { + var result = Builder.BuildProject(@" + + + Library + net472 + false + + + + + +", + "GetPackageContents", output); + + result.AssertSuccess(output); + Assert.Contains(result.Items, item => item.Matches(new + { + Identity = "Newtonsoft.Json" + })); + Assert.Contains(result.Items, item => item.Matches(new + { + Identity = "WindowsBase" + })); + } + [Fact] public void when_build_kind_then_does_not_pack_msbuild() {