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 more common GetTargetPath to multi-targeting #43

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/NuGetizer.Tasks/NuGetizer.MultiTargeting.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ Copyright (c) .NET Foundation. All rights reserved.
<Target Name="GetNativeManifest" />
<Target Name="GetCopyToOutputDirectoryItems" />


<!--
============================================================
GetTargetPath
When cross-targeting and the authoring project references a
nugetized library, return all the determined target paths.
============================================================
-->
<Target Name="GetTargetPath" Returns="@(TargetPathWithTargetPlatformMoniker)" />

<!--
============================================================
GetTargetPathWithTargetPlatformMoniker
Expand All @@ -27,6 +38,7 @@ Copyright (c) .NET Foundation. All rights reserved.
-->
<Target Name="GetTargetPathWithTargetPlatformMoniker"
DependsOnTargets="_ComputeTargetFrameworkItems"
BeforeTargets="GetTargetPath"
Returns="@(TargetPathWithTargetPlatformMoniker)">

<MSBuild Projects="@(_InnerBuildProjects)"
Expand Down
10 changes: 10 additions & 0 deletions src/NuGetizer.Tests/given_a_multitargeting_library.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,15 @@ public void when_customizing_item_then_adds_package_metadata()
}));
}

[Fact]
public void when_getting_target_path_then_includes_all_frameworks()
{
var result = Builder.BuildScenario(
nameof(given_a_multitargeting_library), target: "GetTargetPath", output: output);

result.AssertSuccess(output);

Assert.Equal(2, result.Items.Length);
}
}
}