Skip to content

Commit 9995251

Browse files
Setup Converters Package properly for Sample App Usage
Before it meant that we couldn't work on the Converters component and see results in Sample App as it was pulling in the pre-built NuGet package With this change, we can define the property in the root props for the Windows repo (like we do with Extensions) so that it'll use the source project when running from there. Like Extensions does for the Tests.
1 parent 57bce71 commit 9995251

9 files changed

+53
-32
lines changed

MultiTarget/UseUnoWinUI.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ function ApplyWinUISwap([string] $filePath) {
2727
if ($winUIMajorVersion -eq "3") {
2828
$fileContents = $fileContents -replace '<WinUIMajorVersion>2</WinUIMajorVersion>', '<WinUIMajorVersion>3</WinUIMajorVersion>';
2929
$fileContents = $fileContents -replace '<PackageIdVariant>Uwp</PackageIdVariant>', '<PackageIdVariant>WinUI</PackageIdVariant>';
30+
$fileContents = $fileContents -replace '<DependencyVariant>Uwp</DependencyVariant>', '<DependencyVariant>WinUI</DependencyVariant>';
3031
$fileContents = $fileContents -replace 'Uno.UI', 'Uno.WinUI';
3132
}
3233

3334
if ($winUIMajorVersion -eq "2") {
3435
$fileContents = $fileContents -replace '<WinUIMajorVersion>3</WinUIMajorVersion>', '<WinUIMajorVersion>2</WinUIMajorVersion>';
3536
$fileContents = $fileContents -replace '<PackageIdVariant>WinUI</PackageIdVariant>', '<PackageIdVariant>Uwp</PackageIdVariant>';
37+
$fileContents = $fileContents -replace '<DependencyVariant>WinUI</DependencyVariant>', '<DependencyVariant>Uwp</DependencyVariant>';
3638
$fileContents = $fileContents -replace 'Uno.WinUI', 'Uno.UI';
3739
}
3840

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<!-- Nuget package dependencies for all deployable Uno project heads that use WinUI 2 -->
22
<!-- Due to the quirks of non-sdk style projects, we cannot create a unified Dependencies.props for deployable head. -->
33
<Project>
4-
<ItemGroup>
5-
<!--<PackageReference Include="Uno.Microsoft.Toolkit.Uwp.UI.Controls.Markdown" Version="7.1.11" />-->
6-
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.3.1-uno.2" />
7-
<PackageReference Include="CommunityToolkit.Uwp.Converters" Version="8.0.0-beta.1" />
8-
</ItemGroup>
4+
<ItemGroup>
5+
<!--<PackageReference Include="Uno.Microsoft.Toolkit.Uwp.UI.Controls.Markdown" Version="7.1.11" />-->
6+
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.3.1-uno.2" />
7+
</ItemGroup>
98
</Project>
109

1110

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<!-- Nuget package dependencies for all deployable Uno project heads that use WinUI 3 -->
22
<!-- Due to the quirks of non-sdk style projects, we cannot create a unified Dependencies.props for deployable head. -->
33
<Project>
4-
<ItemGroup>
5-
<!--<PackageReference Include="Uno.CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.100-dev.15.g12261e2626" />-->
6-
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.3.1-uno.2" />
7-
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.0.0-beta.1" />
8-
</ItemGroup>
4+
<ItemGroup>
5+
<!--<PackageReference Include="Uno.CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.100-dev.15.g12261e2626" />-->
6+
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.3.1-uno.2" />
7+
</ItemGroup>
98
</Project>

ProjectHeads/App.Head.Uno.props

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<Project>
2-
<Import Project="$(MSBuildThisFileDirectory)\App.Head.props" />
3-
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\PackageReferences\Uno.props" />
4-
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\WinUI.Extra.props" />
2+
<PropertyGroup>
3+
<DependencyVariant>Uwp</DependencyVariant>
4+
</PropertyGroup>
55

6-
<!--
7-
Import Uno dependencies for all deployable Uno-based Labs project heads.
8-
This import must be inside THIS file to allow swapping between Uno.​UI and Uno.​WinUI via pwsh.
9-
Changes to this file are suppressed by git when switching to avoid changing the default for all users.
10-
-->
11-
<Import Project="$(MSBuildThisFileDirectory)\App.Head.Uno.UI.Dependencies.props" />
6+
<Import Project="$(MSBuildThisFileDirectory)\App.Head.props" />
7+
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\PackageReferences\Uno.props" />
8+
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\WinUI.Extra.props" />
9+
10+
<!--
11+
Import Uno dependencies for all deployable Uno-based Labs project heads.
12+
This import must be inside THIS file to allow swapping between Uno.​UI and Uno.​WinUI via pwsh.
13+
Changes to this file are suppressed by git when switching to avoid changing the default for all users.
14+
-->
15+
<Import Project="$(MSBuildThisFileDirectory)\App.Head.Uno.UI.Dependencies.props" />
1216
</Project>
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<!-- Nuget package dependencies for all deployable UWP project heads -->
22
<!-- Due to the quirks of non-sdk style projects, we cannot create a unified Dependencies.props for deployable head. -->
33
<Project>
4-
<ItemGroup>
5-
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.Markdown" Version="7.1.2" />
6-
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
7-
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
8-
<PackageReference Include="CommunityToolkit.Uwp.Converters" Version="8.0.0-beta.1" />
9-
</ItemGroup>
4+
<ItemGroup>
5+
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.Markdown" Version="7.1.2" />
6+
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
7+
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
8+
</ItemGroup>
109
</Project>

ProjectHeads/App.Head.Uwp.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
<PropertyGroup>
55
<TargetFramework>$(UwpTargetFramework)</TargetFramework>
6+
<DependencyVariant>Uwp</DependencyVariant>
67
</PropertyGroup>
78

8-
<Import Project="$(MSBuildThisFileDirectory)\App.Head.Uwp.Dependencies.props" />
99
<Import Project="$(MSBuildThisFileDirectory)\App.Head.props" />
1010
<Import Project="$(MSBuildThisFileDirectory)\Head.Uwp.props" />
11+
<Import Project="$(MSBuildThisFileDirectory)\App.Head.Uwp.Dependencies.props" />
1112
</Project>
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<!-- Nuget package dependencies for all deployable UWP project heads -->
22
<!-- Due to the quirks of non-sdk style projects, we cannot create a unified Dependencies.props for deployable head. -->
33
<Project>
4-
<ItemGroup>
5-
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
6-
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
7-
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.0.0-beta.1" />
8-
</ItemGroup>
4+
<ItemGroup>
5+
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
6+
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
7+
</ItemGroup>
98
</Project>

ProjectHeads/App.Head.WinAppSdk.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<Project>
2+
<PropertyGroup>
3+
<DependencyVariant>WinUI</DependencyVariant>
4+
</PropertyGroup>
5+
26
<Import Project="$(MSBuildThisFileDirectory)\App.Head.props" />
37
<Import Project="$(MSBuildThisFileDirectory)\Head.WinAppSdk.props" />
48
<Import Project="$(MSBuildThisFileDirectory)\App.Head.WinAppSdk.Dependencies.props" />

ProjectHeads/App.Head.props

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@
2222
<SlnGenIsDeployable>true</SlnGenIsDeployable>
2323
</PropertyGroup>
2424

25+
<!-- Sample App Toolkit Dependencies -->
26+
<Choose>
27+
<When Condition="'$(ToolkitConvertersSourceProject)' == ''">
28+
<ItemGroup>
29+
<PackageReference Include="CommunityToolkit.$(DependencyVariant).Converters" Version="8.0.0-beta.1"/>
30+
</ItemGroup>
31+
</When>
32+
<Otherwise>
33+
<ItemGroup>
34+
<ProjectReference Include="$(ToolkitConvertersSourceProject)"/>
35+
</ItemGroup>
36+
</Otherwise>
37+
</Choose>
38+
2539
<!-- See https://github.com/CommunityToolkit/Labs-Windows/issues/142 -->
2640
<ItemGroup Condition="'$(IsAllExperimentHead)' == 'true'">
2741
<!-- These are also included in the Samples props file, but added here to workaround https://github.com/unoplatform/uno/issues/2502 -->
@@ -50,7 +64,7 @@
5064
<ItemGroup Condition="'$(IsSingleExperimentHead)' == 'true' or '$(IsProjectTemplateHead)' == 'true'">
5165
<!-- These are also included in the Samples props file, but added here to workaround https://github.com/unoplatform/uno/issues/2502 -->
5266
<Content Include="$(MSBuildProjectDirectory)\..\..\samples\**\*.md" Exclude="$(MSBuildProjectDirectory)\..\..\samples\obj\**\*.md;$(MSBuildProjectDirectory)\..\..\samples\bin\**\*.md;$(MSBuildProjectDirectory)\..\..\**\SourceAssets\**\*.md" Link="SourceAssets/%(RecursiveDir)%(FileName)%(Extension)"/>
53-
<Content Include="$(MSBuildProjectDirectory)\..\..\samples\**\*.png" Exclude="$(MSBuildProjectDirectory)\..\..\samples\obj\**\*.png;$(MSBuildProjectDirectory)\..\..\samples\bin\**\*.png;$(MSBuildProjectDirectory)\..\..\**\SourceAssets\**\*.png" Link="SourceAssets/%(RecursiveDir)%(FileName)%(Extension)"/>
67+
<Content Include="$(MSBuildProjectDirectory)\..\..\samples\**\*.png" Exclude="$(MSBuildProjectDirectory)\..\..\samples\obj\**\*.png;$(MSBuildProjectDirectory)\..\..\samples\bin\**\*.png;$(MSBuildProjectDirectory)\..\..\**\SourceAssets\**\*.png" Link="SourceAssets/%(RecursiveDir)%(FileName)%(Extension)"/>
5468
<Content Include="$(MSBuildProjectDirectory)\..\..\samples\**\*.xaml" Exclude="$(MSBuildProjectDirectory)\..\..\samples\obj\**\*.xaml;$(MSBuildProjectDirectory)\..\..\samples\bin\**\*.xaml;$(MSBuildProjectDirectory)\..\..\**\SourceAssets\**\*.xaml" Link="SourceAssets/%(RecursiveDir)%(FileName)%(Extension)"/>
5569

5670
<!-- Link/.dat is a workaround for https://github.com/unoplatform/uno/issues/8649 -->

0 commit comments

Comments
 (0)