From c726b3914c99a03d9cef22c33704046e2fe50f80 Mon Sep 17 00:00:00 2001
From: michael-hawker <24302614+michael-hawker@users.noreply.github.com>
Date: Fri, 14 Jul 2023 15:57:12 -0700
Subject: [PATCH 1/2] 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.
---
MultiTarget/UseUnoWinUI.ps1 | 2 ++
.../App.Head.Uno.UI.Dependencies.props | 9 ++++----
.../App.Head.Uno.WinUI.Dependencies.props | 9 ++++----
ProjectHeads/App.Head.Uno.props | 22 +++++++++++--------
ProjectHeads/App.Head.Uwp.Dependencies.props | 11 +++++-----
ProjectHeads/App.Head.Uwp.props | 3 ++-
.../App.Head.WinAppSdk.Dependencies.props | 9 ++++----
ProjectHeads/App.Head.WinAppSdk.props | 4 ++++
ProjectHeads/App.Head.props | 16 +++++++++++++-
9 files changed, 53 insertions(+), 32 deletions(-)
diff --git a/MultiTarget/UseUnoWinUI.ps1 b/MultiTarget/UseUnoWinUI.ps1
index 0174224a..c876178f 100644
--- a/MultiTarget/UseUnoWinUI.ps1
+++ b/MultiTarget/UseUnoWinUI.ps1
@@ -27,12 +27,14 @@ function ApplyWinUISwap([string] $filePath) {
if ($winUIMajorVersion -eq "3") {
$fileContents = $fileContents -replace '2', '3';
$fileContents = $fileContents -replace 'Uwp', 'WinUI';
+ $fileContents = $fileContents -replace 'Uwp', 'WinUI';
$fileContents = $fileContents -replace 'Uno.UI', 'Uno.WinUI';
}
if ($winUIMajorVersion -eq "2") {
$fileContents = $fileContents -replace '3', '2';
$fileContents = $fileContents -replace 'WinUI', 'Uwp';
+ $fileContents = $fileContents -replace 'WinUI', 'Uwp';
$fileContents = $fileContents -replace 'Uno.WinUI', 'Uno.UI';
}
diff --git a/ProjectHeads/App.Head.Uno.UI.Dependencies.props b/ProjectHeads/App.Head.Uno.UI.Dependencies.props
index addd0543..960a1391 100644
--- a/ProjectHeads/App.Head.Uno.UI.Dependencies.props
+++ b/ProjectHeads/App.Head.Uno.UI.Dependencies.props
@@ -1,11 +1,10 @@
-
-
-
-
-
+
+
+
+
diff --git a/ProjectHeads/App.Head.Uno.WinUI.Dependencies.props b/ProjectHeads/App.Head.Uno.WinUI.Dependencies.props
index b7adf481..0d911d78 100644
--- a/ProjectHeads/App.Head.Uno.WinUI.Dependencies.props
+++ b/ProjectHeads/App.Head.Uno.WinUI.Dependencies.props
@@ -1,9 +1,8 @@
-
-
-
-
-
+
+
+
+
diff --git a/ProjectHeads/App.Head.Uno.props b/ProjectHeads/App.Head.Uno.props
index c24bdac6..dd40b927 100644
--- a/ProjectHeads/App.Head.Uno.props
+++ b/ProjectHeads/App.Head.Uno.props
@@ -1,12 +1,16 @@
-
-
-
+
+ Uwp
+
-
-
+
+
+
+
+
+
diff --git a/ProjectHeads/App.Head.Uwp.Dependencies.props b/ProjectHeads/App.Head.Uwp.Dependencies.props
index 6a58a487..0ab4698d 100644
--- a/ProjectHeads/App.Head.Uwp.Dependencies.props
+++ b/ProjectHeads/App.Head.Uwp.Dependencies.props
@@ -1,10 +1,9 @@
-
-
-
-
-
-
+
+
+
+
+
diff --git a/ProjectHeads/App.Head.Uwp.props b/ProjectHeads/App.Head.Uwp.props
index 807b4eb7..3a79f60b 100644
--- a/ProjectHeads/App.Head.Uwp.props
+++ b/ProjectHeads/App.Head.Uwp.props
@@ -3,9 +3,10 @@
$(UwpTargetFramework)
+ Uwp
-
+
diff --git a/ProjectHeads/App.Head.WinAppSdk.Dependencies.props b/ProjectHeads/App.Head.WinAppSdk.Dependencies.props
index cbb98ffa..154d4526 100644
--- a/ProjectHeads/App.Head.WinAppSdk.Dependencies.props
+++ b/ProjectHeads/App.Head.WinAppSdk.Dependencies.props
@@ -1,9 +1,8 @@
-
-
-
-
-
+
+
+
+
diff --git a/ProjectHeads/App.Head.WinAppSdk.props b/ProjectHeads/App.Head.WinAppSdk.props
index ebf8e8fa..cd101a86 100644
--- a/ProjectHeads/App.Head.WinAppSdk.props
+++ b/ProjectHeads/App.Head.WinAppSdk.props
@@ -1,4 +1,8 @@
+
+ WinUI
+
+
diff --git a/ProjectHeads/App.Head.props b/ProjectHeads/App.Head.props
index 7a8c59d2..af5b586f 100644
--- a/ProjectHeads/App.Head.props
+++ b/ProjectHeads/App.Head.props
@@ -22,6 +22,20 @@
true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -50,7 +64,7 @@
-
+
From c106a3a2fc741fd85bec30655cdda1a724653959 Mon Sep 17 00:00:00 2001
From: Arlo Godfrey
Date: Tue, 18 Jul 2023 13:27:54 -0500
Subject: [PATCH 2/2] Update UseUnoWinUI to accommodate submodule
---
MultiTarget/UseUnoWinUI.ps1 | 30 +++---------------------------
1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/MultiTarget/UseUnoWinUI.ps1 b/MultiTarget/UseUnoWinUI.ps1
index c876178f..7b419a43 100644
--- a/MultiTarget/UseUnoWinUI.ps1
+++ b/MultiTarget/UseUnoWinUI.ps1
@@ -1,27 +1,10 @@
Param (
[Parameter(HelpMessage = "The WinUI version to use when building an Uno head.", Mandatory = $true)]
[ValidateSet('2', '3')]
- [string]$winUIMajorVersion,
-
- [Parameter(HelpMessage = "Disables suppressing changes to the affected files in git, allowing changes to be committed.")]
- [switch]$allowGitChanges = $false
+ [string]$winUIMajorVersion
)
-# Suppress git warning "core.useBuiltinFSMonitor will be deprecated soon; use core.fsmonitor instead"
-& git config advice.useCoreFSMonitorConfig false;
-
-function SupressOrAllowChanges([string] $filePath) {
- if ($allowGitChanges.IsPresent) {
- git update-index --no-assume-unchanged $filePath
- }
- else {
- git update-index --assume-unchanged $filePath
- }
-}
-
function ApplyWinUISwap([string] $filePath) {
- SupressOrAllowChanges $filePath;
-
$fileContents = Get-Content -Path $filePath;
if ($winUIMajorVersion -eq "3") {
@@ -42,17 +25,10 @@ function ApplyWinUISwap([string] $filePath) {
Write-Output "Updated $(Resolve-Path -Relative $filePath)"
}
-Write-Output "Switching to WinUI $winUIMajorVersion";
+Write-Output "Switching Uno to WinUI $winUIMajorVersion";
ApplyWinUISwap $PSScriptRoot/../ProjectHeads/App.Head.Uno.props
ApplyWinUISwap $PSScriptRoot/PackageReferences/Uno.props
ApplyWinUISwap $PSScriptRoot/WinUI.TargetVersion.props
-if ($allowGitChanges.IsPresent) {
- Write-Warning "Changes to the default Uno package settings in Labs can now be committed.`r`nRun this command again without -allowGitChanges to disable committing further changes.";
-}
-else {
- Write-Output "Changes to the default Uno package settings in Labs are now suppressed.`r`nTo switch branches, run `"git reset --hard`" with a clean working tree.";
-}
-
-Write-Output "Done, switched to WinUI $winUIMajorVersion"
\ No newline at end of file
+Write-Output "Done. Please close and regenerate your solution. Do not commit these changes to the tooling repository."
\ No newline at end of file