From defb1db1640a7bbb4d94497a1f47b405611f70fc Mon Sep 17 00:00:00 2001 From: Pedro Jesus Date: Sun, 11 Aug 2024 15:14:06 -0300 Subject: [PATCH 01/15] fix memo leak --- .../Touch/TouchBehavior.android.cs | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs index 1f53f9fd90..031f0f4ba8 100644 --- a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs +++ b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs @@ -12,6 +12,18 @@ namespace CommunityToolkit.Maui.Behaviors; + + + + +sealed class WeakWrapper(T value) + where T : class +{ + readonly WeakReference weakValue = new(value); + + public T? Value => weakValue.TryGetTarget(out var target) ? target : null; +} + public partial class TouchBehavior { static readonly MColor defaultNativeAnimationColor = MColor.FromRgba(128, 128, 128, 64); @@ -19,7 +31,8 @@ public partial class TouchBehavior bool isHoverSupported; float startX; float startY; - AView? view; + //AView? view; + WeakWrapper view = default!; ViewGroup? viewGroup; AccessibilityManager? accessibilityManager; @@ -41,10 +54,11 @@ protected override void OnAttachedTo(VisualElement bindable, AView platformView) base.OnAttachedTo(bindable, platformView); Element = bindable; - view = platformView; + view = new(platformView); viewGroup = Microsoft.Maui.Platform.ViewExtensions.GetParentOfType(platformView); platformView.Touch += OnTouch; + //platformView.SetOnTouchListener(new Listener(this)); UpdateClickHandler(); accessibilityManager = platformView.Context?.GetSystemService(Context.AccessibilityService) as AccessibilityManager; @@ -73,7 +87,7 @@ protected override void OnDetachedFrom(VisualElement bindable, AView platformVie { base.OnDetachedFrom(bindable, platformView); - view = platformView; + view = new(platformView); if (Element is null) { @@ -91,10 +105,10 @@ protected override void OnDetachedFrom(VisualElement bindable, AView platformVie accessibilityListener = null; } - if (view is not null) + if (view.Value is not null) { - view.Touch -= OnTouch; - view.Click -= OnClick; + view.Value.Touch -= OnTouch; + view.Value.Click -= OnClick; } Element = null; @@ -118,15 +132,15 @@ static ColorStateList GetColorStateList(MColor? color) void UpdateClickHandler() { - if (view is null || !view.IsAlive()) + if (view.Value is null) { return; } - view.Click -= OnClick; + view.Value.Click -= OnClick; if (IsAccessibilityMode || (IsEnabled && (Element?.IsEnabled ?? false))) { - view.Click += OnClick; + view.Value.Click += OnClick; return; } } @@ -231,8 +245,8 @@ void OnTouchMove(AView view, AView.TouchEventArgs touchEventArgs) return; } - var diffX = Math.Abs(touchEventArgs.Event.GetX() - startX) / this.view?.Context?.Resources?.DisplayMetrics?.Density ?? throw new InvalidOperationException("Context cannot be null"); - var diffY = Math.Abs(touchEventArgs.Event.GetY() - startY) / this.view?.Context?.Resources?.DisplayMetrics?.Density ?? throw new InvalidOperationException("Context cannot be null"); + var diffX = Math.Abs(touchEventArgs.Event.GetX() - startX) / this.view.Value?.Context?.Resources?.DisplayMetrics?.Density ?? throw new InvalidOperationException("Context cannot be null"); + var diffY = Math.Abs(touchEventArgs.Event.GetY() - startY) / this.view.Value?.Context?.Resources?.DisplayMetrics?.Density ?? throw new InvalidOperationException("Context cannot be null"); var maxDiff = Math.Max(diffX, diffY); var disallowTouchThreshold = DisallowTouchThreshold; @@ -272,8 +286,8 @@ void OnHoverExit() partial void PlatformDispose() { - view?.Dispose(); - view = null; + view.Value?.Dispose(); + //view = null; viewGroup?.Dispose(); viewGroup = null; @@ -289,31 +303,21 @@ sealed class AccessibilityListener : Java.Lang.Object, AccessibilityManager.IAccessibilityStateChangeListener, AccessibilityManager.ITouchExplorationStateChangeListener { - TouchBehavior? platformTouchBehavior; + WeakWrapper platformTouchBehavior; internal AccessibilityListener(TouchBehavior platformTouchBehavior) { - this.platformTouchBehavior = platformTouchBehavior; + this.platformTouchBehavior = new(platformTouchBehavior); } public void OnAccessibilityStateChanged(bool enabled) { - platformTouchBehavior?.UpdateClickHandler(); + platformTouchBehavior.Value?.UpdateClickHandler(); } public void OnTouchExplorationStateChanged(bool enabled) { - platformTouchBehavior?.UpdateClickHandler(); - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - platformTouchBehavior = null; - } - - base.Dispose(disposing); + platformTouchBehavior.Value?.UpdateClickHandler(); } } } \ No newline at end of file From 789322fca6ab2fcc315eb2875892185d3c3690ba Mon Sep 17 00:00:00 2001 From: Pedro Jesus Date: Sun, 11 Aug 2024 16:18:08 -0300 Subject: [PATCH 02/15] created WeakWrapper --- src/CommunityToolkit.Maui/WeakWrapper.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/CommunityToolkit.Maui/WeakWrapper.cs diff --git a/src/CommunityToolkit.Maui/WeakWrapper.cs b/src/CommunityToolkit.Maui/WeakWrapper.cs new file mode 100644 index 0000000000..335f2c34b4 --- /dev/null +++ b/src/CommunityToolkit.Maui/WeakWrapper.cs @@ -0,0 +1,15 @@ +namespace CommunityToolkit.Maui; + +/// +/// This class is a Wrapper for objects that should be weak, this will make it less verbose +/// and easy to use. +/// +/// The of the object +/// The actual object reference, will be null if it's already collected by GC. +sealed class WeakWrapper(T value) + where T : class +{ + readonly WeakReference weakValue = new(value); + + public T? Value => weakValue.TryGetTarget(out var target) ? target : null; +} From cd744a0669a5387f79f89195ffa8f9f6c6f0fa72 Mon Sep 17 00:00:00 2001 From: Pedro Jesus Date: Sun, 11 Aug 2024 16:18:20 -0300 Subject: [PATCH 03/15] use the WeakWrapper --- .../Touch/TouchBehavior.android.cs | 39 +++++++------------ 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs index 031f0f4ba8..1f04d58f41 100644 --- a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs +++ b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs @@ -13,17 +13,6 @@ namespace CommunityToolkit.Maui.Behaviors; - - - -sealed class WeakWrapper(T value) - where T : class -{ - readonly WeakReference weakValue = new(value); - - public T? Value => weakValue.TryGetTarget(out var target) ? target : null; -} - public partial class TouchBehavior { static readonly MColor defaultNativeAnimationColor = MColor.FromRgba(128, 128, 128, 64); @@ -31,8 +20,7 @@ public partial class TouchBehavior bool isHoverSupported; float startX; float startY; - //AView? view; - WeakWrapper view = default!; + AView? view; ViewGroup? viewGroup; AccessibilityManager? accessibilityManager; @@ -54,11 +42,10 @@ protected override void OnAttachedTo(VisualElement bindable, AView platformView) base.OnAttachedTo(bindable, platformView); Element = bindable; - view = new(platformView); + view = platformView; viewGroup = Microsoft.Maui.Platform.ViewExtensions.GetParentOfType(platformView); platformView.Touch += OnTouch; - //platformView.SetOnTouchListener(new Listener(this)); UpdateClickHandler(); accessibilityManager = platformView.Context?.GetSystemService(Context.AccessibilityService) as AccessibilityManager; @@ -87,7 +74,7 @@ protected override void OnDetachedFrom(VisualElement bindable, AView platformVie { base.OnDetachedFrom(bindable, platformView); - view = new(platformView); + view = platformView; if (Element is null) { @@ -105,10 +92,10 @@ protected override void OnDetachedFrom(VisualElement bindable, AView platformVie accessibilityListener = null; } - if (view.Value is not null) + if (view is not null) { - view.Value.Touch -= OnTouch; - view.Value.Click -= OnClick; + view.Touch -= OnTouch; + view.Click -= OnClick; } Element = null; @@ -132,15 +119,15 @@ static ColorStateList GetColorStateList(MColor? color) void UpdateClickHandler() { - if (view.Value is null) + if (view is null) { return; } - view.Value.Click -= OnClick; + view.Click -= OnClick; if (IsAccessibilityMode || (IsEnabled && (Element?.IsEnabled ?? false))) { - view.Value.Click += OnClick; + view.Click += OnClick; return; } } @@ -245,8 +232,8 @@ void OnTouchMove(AView view, AView.TouchEventArgs touchEventArgs) return; } - var diffX = Math.Abs(touchEventArgs.Event.GetX() - startX) / this.view.Value?.Context?.Resources?.DisplayMetrics?.Density ?? throw new InvalidOperationException("Context cannot be null"); - var diffY = Math.Abs(touchEventArgs.Event.GetY() - startY) / this.view.Value?.Context?.Resources?.DisplayMetrics?.Density ?? throw new InvalidOperationException("Context cannot be null"); + var diffX = Math.Abs(touchEventArgs.Event.GetX() - startX) / this.view?.Context?.Resources?.DisplayMetrics?.Density ?? throw new InvalidOperationException("Context cannot be null"); + var diffY = Math.Abs(touchEventArgs.Event.GetY() - startY) / this.view?.Context?.Resources?.DisplayMetrics?.Density ?? throw new InvalidOperationException("Context cannot be null"); var maxDiff = Math.Max(diffX, diffY); var disallowTouchThreshold = DisallowTouchThreshold; @@ -286,8 +273,8 @@ void OnHoverExit() partial void PlatformDispose() { - view.Value?.Dispose(); - //view = null; + view?.Dispose(); + view = null; viewGroup?.Dispose(); viewGroup = null; From 5ceea9fe67b2f92628b6e77742d32a85681b7cdf Mon Sep 17 00:00:00 2001 From: Pedro Jesus Date: Sun, 11 Aug 2024 16:33:40 -0300 Subject: [PATCH 04/15] moving back a missed piece --- .../Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs index 1f04d58f41..4e6e8ad782 100644 --- a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs +++ b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs @@ -119,7 +119,7 @@ static ColorStateList GetColorStateList(MColor? color) void UpdateClickHandler() { - if (view is null) + if (view is null || !view.IsAlive()) { return; } From 49c0b4f21c2f607ef88a2accaf73752363ad13a4 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:25:46 -0700 Subject: [PATCH 05/15] Remove WeakWrapper, Properly dispose of `WeakReference.Target` --- .../Touch/TouchBehavior.android.cs | 26 +++++++++++++++---- src/CommunityToolkit.Maui/WeakWrapper.cs | 15 ----------- 2 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 src/CommunityToolkit.Maui/WeakWrapper.cs diff --git a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs index 4e6e8ad782..dbb9531599 100644 --- a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs +++ b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs @@ -43,7 +43,7 @@ protected override void OnAttachedTo(VisualElement bindable, AView platformView) Element = bindable; view = platformView; - viewGroup = Microsoft.Maui.Platform.ViewExtensions.GetParentOfType(platformView); + viewGroup = platformView.GetParentOfType(); platformView.Touch += OnTouch; UpdateClickHandler(); @@ -290,21 +290,37 @@ sealed class AccessibilityListener : Java.Lang.Object, AccessibilityManager.IAccessibilityStateChangeListener, AccessibilityManager.ITouchExplorationStateChangeListener { - WeakWrapper platformTouchBehavior; + readonly WeakReference platformTouchBehaviorReference; internal AccessibilityListener(TouchBehavior platformTouchBehavior) { - this.platformTouchBehavior = new(platformTouchBehavior); + platformTouchBehaviorReference = new(platformTouchBehavior); } public void OnAccessibilityStateChanged(bool enabled) { - platformTouchBehavior.Value?.UpdateClickHandler(); + if (platformTouchBehaviorReference.TryGetTarget(out var platformTouchBehavior)) + { + platformTouchBehavior.UpdateClickHandler(); + } } public void OnTouchExplorationStateChanged(bool enabled) { - platformTouchBehavior.Value?.UpdateClickHandler(); + if (platformTouchBehaviorReference.TryGetTarget(out var platformTouchBehavior)) + { + platformTouchBehavior.UpdateClickHandler(); + } + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + platformTouchBehaviorReference.SetTarget(null); + } + + base.Dispose(disposing); } } } \ No newline at end of file diff --git a/src/CommunityToolkit.Maui/WeakWrapper.cs b/src/CommunityToolkit.Maui/WeakWrapper.cs deleted file mode 100644 index 335f2c34b4..0000000000 --- a/src/CommunityToolkit.Maui/WeakWrapper.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace CommunityToolkit.Maui; - -/// -/// This class is a Wrapper for objects that should be weak, this will make it less verbose -/// and easy to use. -/// -/// The of the object -/// The actual object reference, will be null if it's already collected by GC. -sealed class WeakWrapper(T value) - where T : class -{ - readonly WeakReference weakValue = new(value); - - public T? Value => weakValue.TryGetTarget(out var target) ? target : null; -} From b75758c7978c3b5d2333bcfe1015555537323225 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:26:08 -0700 Subject: [PATCH 06/15] Remove accidental whitespace --- .../Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs index dbb9531599..9a5cc96bd2 100644 --- a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs +++ b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs @@ -12,7 +12,6 @@ namespace CommunityToolkit.Maui.Behaviors; - public partial class TouchBehavior { static readonly MColor defaultNativeAnimationColor = MColor.FromRgba(128, 128, 128, 64); From 89c3ac0d072a9310521e7597d4bc1b3fb957ddf3 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:27:18 -0700 Subject: [PATCH 07/15] `dotnet format` --- .../Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs index 9a5cc96bd2..6b5a56c719 100644 --- a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs +++ b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.android.cs @@ -311,7 +311,7 @@ public void OnTouchExplorationStateChanged(bool enabled) platformTouchBehavior.UpdateClickHandler(); } } - + protected override void Dispose(bool disposing) { if (disposing) From f691ca4e51cc1ae0e4c900624dd0d85908d92e82 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:34:05 -0700 Subject: [PATCH 08/15] Update `Install Tizen Workload` step `Install Tizen Workload` now fails fast --- azure-pipelines.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 76bc033c97..9aa46afcfe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,8 +83,13 @@ jobs: script: 'dotnet workload install maui' - pwsh: | - Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' - .\workload-install.ps1 + if ($LastExitCode -ne 1) + { + Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' + .\workload-install.ps1 + } + + exit 0; displayName: Install Tizen Workload # Print Information on the .NET SDK Used By the CI Build Host @@ -213,8 +218,13 @@ jobs: script: dotnet workload install maui --skip-sign-check --source https://api.nuget.org/v3/index.json - pwsh: | - Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' - .\workload-install.ps1 + if ($LastExitCode -ne 1) + { + Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' + .\workload-install.ps1 + } + + exit 0; displayName: Install Tizen Workload # Print Information on the .NET SDK Used By the CI Build Host From aac070a383a3b8b9baea667fb6f72564082e01a5 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:35:30 -0700 Subject: [PATCH 09/15] Update `Install Tizen Workload` step --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9aa46afcfe..3cac2f10c5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,9 +83,9 @@ jobs: script: 'dotnet workload install maui' - pwsh: | + Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' if ($LastExitCode -ne 1) { - Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' .\workload-install.ps1 } @@ -218,9 +218,9 @@ jobs: script: dotnet workload install maui --skip-sign-check --source https://api.nuget.org/v3/index.json - pwsh: | + Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' if ($LastExitCode -ne 1) { - Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' .\workload-install.ps1 } From c0a1e09a6749202d219cafd012f10108adaabe99 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:35:58 -0700 Subject: [PATCH 10/15] Update azure-pipelines.yml --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3cac2f10c5..a9cddb7d81 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -87,6 +87,7 @@ jobs: if ($LastExitCode -ne 1) { .\workload-install.ps1 + exit 1; } exit 0; @@ -222,6 +223,7 @@ jobs: if ($LastExitCode -ne 1) { .\workload-install.ps1 + exit 1; } exit 0; From 3cc5c45c7f4b9e492cf3c5d86bb8078b79a6270f Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:44:02 -0700 Subject: [PATCH 11/15] Update azure-pipelines.yml --- azure-pipelines.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a9cddb7d81..66f5803db5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,14 +83,14 @@ jobs: script: 'dotnet workload install maui' - pwsh: | - Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' + Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' | findstr /S /c:"404"; if ($LastExitCode -ne 1) { - .\workload-install.ps1 exit 1; } - exit 0; + .\workload-install.ps1 + exit 1; displayName: Install Tizen Workload # Print Information on the .NET SDK Used By the CI Build Host @@ -219,13 +219,13 @@ jobs: script: dotnet workload install maui --skip-sign-check --source https://api.nuget.org/v3/index.json - pwsh: | - Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' + Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' | findstr /S /c:"404"; if ($LastExitCode -ne 1) { - .\workload-install.ps1 exit 1; } + .\workload-install.ps1 exit 0; displayName: Install Tizen Workload From 31ce3c7088435daf4eedcfc68e7616b30992db8c Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:48:25 -0700 Subject: [PATCH 12/15] Update azure-pipelines.yml --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 66f5803db5..68e478f301 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -82,7 +82,7 @@ jobs: inputs: script: 'dotnet workload install maui' - - pwsh: | + - powershell: | Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' | findstr /S /c:"404"; if ($LastExitCode -ne 1) { @@ -218,7 +218,7 @@ jobs: inputs: script: dotnet workload install maui --skip-sign-check --source https://api.nuget.org/v3/index.json - - pwsh: | + - powershell: | Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' | findstr /S /c:"404"; if ($LastExitCode -ne 1) { From 4950145d94459aa409dff456288eb7adce100bff Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:52:07 -0700 Subject: [PATCH 13/15] Update azure-pipelines.yml --- azure-pipelines.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 68e478f301..59e638b6db 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,14 +83,15 @@ jobs: script: 'dotnet workload install maui' - powershell: | - Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' | findstr /S /c:"404"; - if ($LastExitCode -ne 1) + Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' + .\workload-install.ps1 + + if ($LastExitCode -ne 0) { exit 1; } - .\workload-install.ps1 - exit 1; + exit 0; displayName: Install Tizen Workload # Print Information on the .NET SDK Used By the CI Build Host @@ -219,13 +220,14 @@ jobs: script: dotnet workload install maui --skip-sign-check --source https://api.nuget.org/v3/index.json - powershell: | - Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' | findstr /S /c:"404"; - if ($LastExitCode -ne 1) + Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' + .\workload-install.ps1 + + if ($LastExitCode -ne 0) { exit 1; } - .\workload-install.ps1 exit 0; displayName: Install Tizen Workload From 51525f3b338221f145f3894f6196e9f89cdcc05e Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:58:06 -0700 Subject: [PATCH 14/15] Update azure-pipelines.yml --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 59e638b6db..750116c3cb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -84,12 +84,12 @@ jobs: - powershell: | Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' - .\workload-install.ps1 - if ($LastExitCode -ne 0) { exit 1; } + + .\workload-install.ps1 exit 0; displayName: Install Tizen Workload @@ -221,12 +221,12 @@ jobs: - powershell: | Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' - .\workload-install.ps1 - if ($LastExitCode -ne 0) { exit 1; } + + .\workload-install.ps1 exit 0; displayName: Install Tizen Workload From 1f9805886a2f8f77cd352a65f29d6387eb99f031 Mon Sep 17 00:00:00 2001 From: Jay Cho Date: Fri, 16 Aug 2024 17:06:33 +0900 Subject: [PATCH 15/15] Update azure-pipelines.yml --- azure-pipelines.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 750116c3cb..97447c5c98 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -84,14 +84,7 @@ jobs: - powershell: | Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' - if ($LastExitCode -ne 0) - { - exit 1; - } - .\workload-install.ps1 - - exit 0; displayName: Install Tizen Workload # Print Information on the .NET SDK Used By the CI Build Host @@ -221,14 +214,7 @@ jobs: - powershell: | Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1' - if ($LastExitCode -ne 0) - { - exit 1; - } - .\workload-install.ps1 - - exit 0; displayName: Install Tizen Workload # Print Information on the .NET SDK Used By the CI Build Host