Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,30 @@
<PackageReadmeFilePath>$(MSBuildThisFileDirectory)../src/PACKAGE.md</PackageReadmeFilePath>
</PropertyGroup>

<ItemGroup>
<!-- Extract supported RIDs from the .proj file names -->
<RIDSpecificProject Include="$(MSBuildThisFileDirectory)runtime.*.runtime.native.System.IO.Ports.proj" />
<PackageSupportedRID Include="@(RIDSpecificProject->'%(Filename)'->Replace('.runtime.native.System.IO.Ports', '')->Replace('runtime.', ''))" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever way of finding the full set of RIDs. I was going to suggest regex property function - but this is fine and concise.


<!-- We need to add a placeholder file for all RIDs except the one that is actually included in the RID-specific package.
This prevents an issue where during publish the SDK would select e.g. both linux-x64 and linux-musl-x64 assets because of the fallback path in the RID graph. -->
<PackagePlaceholderRID Include="@(PackageSupportedRID)" Exclude="$(OutputRID)" />
</ItemGroup>

<ItemGroup>
<None Include="$(NativeBinDir)$(LibPrefix)System.IO.Ports.Native$(LibSuffix)"
PackagePath="runtimes/$(OutputRID)/native"
Pack="true" />
<None Include="$(PlaceholderFile)"
PackagePath="@(PackagePlaceholderRID->'runtimes/%(Identity)/native')"
Pack="true" />
</ItemGroup>

<Target Name="ValidatePackageSupportedRID" BeforeTargets="Build">
<Error Text="$(OutputRID) is missing from PackageSupportedRID."
Condition="!@(PackageSupportedRID->AnyHaveMetadataValue('Identity', '$(OutputRID)'))" />
</Target>

<Target Name="AddRuntimeSpecificNativeSymbolToPackage">
<ItemGroup>
<TfmSpecificDebugSymbolsFile Include="$(NativeBinDir)$(LibPrefix)System.IO.Ports.Native$(LibSuffix)$(SymbolsSuffix)"
Expand Down