Skip to content

Commit

Permalink
Ensure that Pack behaves correctly when a RID is set by the user.
Browse files Browse the repository at this point in the history
Closes #55.
  • Loading branch information
alexrp committed Jan 5, 2024
1 parent fb09251 commit 6a48e6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/sdk/build/Vezel.Zig.Sdk.Overrides.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
<!--
If a RuntimeIdentifier value has not been set, it means the Build, Clean,
and Publish targets should run inner builds for every RID supported by the
project. That said, for running and testing, we still need to run natively
by default, so we still have to set a default RID. We use IsOuterBuild to
indicate whether inner builds are required.
project, and Pack should include artifacts from every RID. That said, for
running and testing, we still need to run natively by default, so we still
have to actually set a default RID.
We use IsOuterBuild to disambiguate between us setting a default RID and the
user setting a RID on their own.
-->
<PropertyGroup Condition="'$(RuntimeIdentifier)' == ''">
<RuntimeIdentifier>$(NETCoreSdkPortableRuntimeIdentifier)</RuntimeIdentifier>
Expand Down
9 changes: 6 additions & 3 deletions src/sdk/build/Vezel.Zig.Sdk.Pack.targets
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

<!--
Zig projects need to package all source code. C and C++ projects only
need to package public header files. We allow packaging headers with
Zig projects, but not Zig sources with C/C++ projects.
need to package public header files. We allow packaging headers with Zig
projects, but not Zig sources with C/C++ projects.
-->
<ItemGroup>
<None Include="$(PublicHeadersPath)**/*.h; $(PublicHeadersPath)**/*.hxx"
Expand All @@ -41,7 +41,10 @@
</ItemGroup>

<ItemGroup>
<_RuntimeIdentifiers Include="$(RuntimeIdentifiers)" />
<_RuntimeIdentifiers Include="$(RuntimeIdentifier)"
Condition="'$(IsOuterBuild)' != 'true'" />
<_RuntimeIdentifiers Include="$(RuntimeIdentifiers)"
Condition="'$(IsOuterBuild)' == 'true'" />
</ItemGroup>

<MSBuild Projects="$(MSBuildProjectFullPath)"
Expand Down

0 comments on commit 6a48e6c

Please sign in to comment.