Skip to content
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
4 changes: 3 additions & 1 deletion src/NuGetizer.Tasks/NuGetizer.Inference.targets
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Copyright (c) .NET Foundation. All rights reserved.
</ItemGroup>
</Target>

<Target Name="_CollectInferenceCandidates" Inputs="@(PackInference)" Outputs="%(PackInference.Identity)-BATCH">
<Target Name="_CollectInferenceCandidates" Inputs="@(PackInference)" Outputs="|%(PackInference.Identity)|">
<PropertyGroup>
<PackExclude>%(PackInference.PackExclude)</PackExclude>
<PackInferenceIdentity>%(PackInference.Identity)</PackInferenceIdentity>
Expand Down Expand Up @@ -303,12 +303,14 @@ Copyright (c) .NET Foundation. All rights reserved.
@(_SatelliteDllsProjectOutputGroupOutput -> '%(FinalOutputPath)')">
<PackFolder>$(PackFolder)</PackFolder>
<FrameworkSpecific>$(BuildOutputFrameworkSpecific)</FrameworkSpecific>
<TargetFramework Condition="'$(IsPackagingProject)' != 'true' or '$(BuildOutputFrameworkSpecific)' == 'true'">$(TargetFramework)</TargetFramework>
</_InferredProjectOutput>

<_InferredProjectOutput Include="@(DebugSymbolsProjectOutputGroupOutput -> '%(FinalOutputPath)')"
Condition="'$(PackSymbols)' != 'false'">
<PackFolder>$(PackFolder)</PackFolder>
<FrameworkSpecific>$(BuildOutputFrameworkSpecific)</FrameworkSpecific>
<TargetFramework Condition="'$(IsPackagingProject)' != 'true' or '$(BuildOutputFrameworkSpecific)' == 'true'">$(TargetFramework)</TargetFramework>
</_InferredProjectOutput>

<_InferredPackageFile Include="@(_InferredProjectOutput -> Distinct())" />
Expand Down
2 changes: 2 additions & 0 deletions src/NuGetizer.Tasks/NuGetizer.props
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<OriginalItemSpec />
<!-- Don't show package files in project explorer by default -->
<Visible>false</Visible>
<TargetFramework />
<TargetFrameworkMoniker />
</PackageFile>
<PackageReference>
<!-- See https://github.com/NuGet/Home/wiki/PackageReference-Specification -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(Scenario.props, $(MSBuildThisFileDirectory)))" />

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
<UseWPF>true</UseWPF>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<TargetFrameworks>net7.0;net7.0-windows;net7.0-maccatalyst</TargetFrameworks>
<PackOnBuild>true</PackOnBuild>
<IsPackable>true</IsPackable>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
</PropertyGroup>

<ItemGroup>
Expand Down
29 changes: 29 additions & 0 deletions src/NuGetizer.Tests/given_multitargeting_libraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,34 @@ public void when_packing_on_build_then_succeeds(string projectName)

Assert.True(File.Exists(result.Items[0].GetMetadata("FullPath")));
}

[Fact]
public void when_getting_content_then_multitargets()
{
Builder.BuildScenario(
nameof(given_multitargeting_libraries),
projectName: "uilibrary.csproj", target: "Restore", output: output)
.AssertSuccess(output);

var result = Builder.BuildScenario(
nameof(given_multitargeting_libraries),
projectName: "uilibrary.csproj",
target: "GetPackageContents", output: output);

result.AssertSuccess(output);

Assert.Contains(result.Items, item => item.Matches(new
{
PackagePath = "lib/net7.0/uilibrary.dll"
}));
Assert.Contains(result.Items, item => item.Matches(new
{
PackagePath = "lib/net7.0-windows/uilibrary.dll"
}));
Assert.Contains(result.Items, item => item.Matches(new
{
PackagePath = "lib/net7.0-maccatalyst/uilibrary.dll"
}));
}
}
}