Skip to content

Commit 37fa602

Browse files
committed
Ensure that Pack behaves correctly when a RID is set by the user.
Closes #55.
1 parent 3832bef commit 37fa602

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/sdk/build/Vezel.Zig.Sdk.Overrides.targets

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
<!--
2020
If a RuntimeIdentifier value has not been set, it means the Build, Clean,
2121
and Publish targets should run inner builds for every RID supported by the
22-
project. That said, for running and testing, we still need to run natively
23-
by default, so we still have to set a default RID. We use IsOuterBuild to
24-
indicate whether inner builds are required.
22+
project, and Pack should include artifacts from every RID. That said, for
23+
running and testing, we still need to run natively by default, so we still
24+
have to actually set a default RID.
25+
26+
We use IsOuterBuild to disambiguate between us setting a default RID and the
27+
user setting a RID on their own.
2528
-->
2629
<PropertyGroup Condition="'$(RuntimeIdentifier)' == ''">
2730
<RuntimeIdentifier>$(NETCoreSdkPortableRuntimeIdentifier)</RuntimeIdentifier>

src/sdk/build/Vezel.Zig.Sdk.Pack.targets

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

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

4343
<ItemGroup>
44-
<_RuntimeIdentifiers Include="$(RuntimeIdentifiers)" />
44+
<_RuntimeIdentifiers Include="$(RuntimeIdentifier)"
45+
Condition="'$(IsOuterBuild)' != 'true'" />
46+
<_RuntimeIdentifiers Include="$(RuntimeIdentifiers)"
47+
Condition="'$(IsOuterBuild)' == 'true'" />
4548
</ItemGroup>
4649

4750
<MSBuild Projects="$(MSBuildProjectFullPath)"

0 commit comments

Comments
 (0)