Skip to content

Commit 64c7c7c

Browse files
Another fix for the Converters ProjectReference logic
We need to add the Converters when running in Single Component mode, as it's only included in the all-up sample app locally (when source defined). We also need to exclude if we're building the Converters project itself. However, if a component itself relies on the converters and we try and to build on Linux we'll hit the original issue. Workaround for now there is to build all-up sample app instead... Tested locally that the Converters and another component both could be built now.
1 parent 14fbcce commit 64c7c7c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ProjectHeads/App.Head.props

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@
2929
<PackageReference Include="CommunityToolkit.$(DependencyVariant).Converters" Version="8.0.230801-preview"/>
3030
</ItemGroup>
3131
</When>
32-
<Otherwise>
32+
<!-- This is tripping up the linux build using dotnet build as we have a duplicate reference
33+
auto-generated in tooling/MultiTarget/Generated when building the all-up sample app -->
34+
<!-- See: https://github.com/dotnet/msbuild/issues/2688 -->
35+
<!-- TODO: We need to handle a case where a component itself references the converter package... -->
36+
<!-- Only add Converters reference if we're in a single experiment that's not the Converters project itself -->
37+
<When Condition="'$(IsSingleExperimentHead)' == 'true' and $(MSBuildProjectName.StartsWith('Converters')) == 'false'">
3338
<ItemGroup>
34-
<!-- This is tripping up the linux build using dotnet build as we have a duplicate reference auto-generated in tooling/MultiTarget/Generated -->
35-
<!-- See: https://github.com/dotnet/msbuild/issues/2688 -->
36-
<!--<ProjectReference Include="$(ToolkitConvertersSourceProject)"/>-->
39+
<ProjectReference Include="$(ToolkitConvertersSourceProject)"/>
3740
</ItemGroup>
38-
</Otherwise>
41+
</When>
3942
</Choose>
4043

4144
<!-- See https://github.com/CommunityToolkit/Labs-Windows/issues/142 -->

0 commit comments

Comments
 (0)