Skip to content

Commit

Permalink
Merge pull request #12920 from Youssef1313/net-conditionals
Browse files Browse the repository at this point in the history
refactor: Cleanup NET6_0 conditionals
  • Loading branch information
MartinZikmund authored Jul 19, 2023
2 parents 26f20e9 + 20f471d commit 4f4ba17
Show file tree
Hide file tree
Showing 107 changed files with 18 additions and 1,025 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.Storage;

#if NET6_0_OR_GREATER
using ObjCRuntime;
#endif

namespace SampleControl.Presentation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.Storage;

#if NET6_0_OR_GREATER
using ObjCRuntime;
#endif

namespace SampleControl.Presentation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ public void SetFullScreenMode(bool fullscreen)
protected override void OnActivityResult(int requestCode, Result resultCode, Android.Content.Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
#if !NET6_0_OR_GREATER
AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(requestCode, resultCode, data);
#endif
}


Expand All @@ -121,22 +118,5 @@ public void OnPixelCopyFinished(int copyResult)
}
}
}

#if !NET6_0_OR_GREATER
[Activity]
[IntentFilter(
new[] {
Android.Content.Intent.ActionView
},
Categories = new[] {
Android.Content.Intent.CategoryDefault,
Android.Content.Intent.CategoryBrowsable
},
DataScheme = "msauth")]
public class MsalActivity : BrowserTabActivity
{
}
#endif

}

3 changes: 0 additions & 3 deletions src/SamplesApp/UITests.Shared/Msal/MsalLoginAndGraph.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ public MsalLoginAndGraph()
.WithTenantId(TENANT_ID)
.WithRedirectUri(REDIRECT_URI)
.WithUnoHelpers()
#if __IOS__ && !NET6_0_OR_GREATER
.WithIosKeychainSecurityGroup("com.companyname.SamplesApp")
#endif
.Build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ public void Boolean_Should_Be_Read_From_The_Next_Non_Whitespace_Character_Only()
{
var generatedCode = Parse("M17.432 11.619c.024.082.04.165.04.247V26.54c0 .37-.271.552-.605.409l-5.339-2.282c-.336-.144-.604-.558-.604-.926V9.066c0-.368.27-.551.604-.409l5.339 2.283a.898.898 0 01.27.188c.09.169.189.333.295.49M9.615 9.07v14.675c0 .368-.27.782-.605.925l-5.339 2.282c-.334.143-.604-.04-.604-.408V11.868c0-.368.269-.782.604-.926l5.34-2.282c.333-.143.604.04.604.41m15.713 4.173V23.74c0 .368-.27.782-.605.926l-5.338 2.282c-.334.143-.604-.04-.604-.41V13.216c1.015 1.231 2.702 3.615 3.136 6.3h.312c.43-2.665 2.087-5.033 3.099-6.272m-3.217-2.39c-2.065 0-3.738-1.705-3.738-3.808 0-2.102 1.673-3.807 3.738-3.807 2.064 0 3.738 1.705 3.738 3.807 0 2.103-1.674 3.808-3.738 3.808M22.054 2c-2.768 0-5.012 2.286-5.012 5.105 0 1.378.531 2.693 1.401 3.611 0 0 2.928 2.912 3.488 6.389h.279c.56-3.477 3.471-6.389 3.471-6.389.873-.918 1.386-2.232 1.386-3.61 0-2.82-2.245-5.106-5.013-5.106");

// A separate assert for net6.0 has been added because here net6.0 will output numbers as 17.471999999999998 instead of 17.472.
// https://github.com/unoplatform/uno/pull/8531#discussion_r851318424
#if NET6_0_OR_GREATER
Assert.AreEqual(@"global::Uno.Media.GeometryHelper.Build(c =>
{
c.BeginFigure(new global::Windows.Foundation.Point(17.432, 11.619), true);
Expand Down Expand Up @@ -285,58 +282,6 @@ public void Boolean_Should_Be_Read_From_The_Next_Non_Whitespace_Character_Only()
c.BezierTo(new global::Windows.Foundation.Point(27.066999999999997, 4.286000000000001), new global::Windows.Foundation.Point(24.821999999999996, 2.0000000000000018), new global::Windows.Foundation.Point(22.053999999999995, 2.0000000000000018), true, false);
c.SetClosedState(false);
}, global::Windows.UI.Xaml.Media.FillRule.EvenOdd)", generatedCode);
#else
Assert.AreEqual(@"global::Uno.Media.GeometryHelper.Build(c =>
{
c.BeginFigure(new global::Windows.Foundation.Point(17.432, 11.619), true);
c.BezierTo(new global::Windows.Foundation.Point(17.456, 11.701), new global::Windows.Foundation.Point(17.472, 11.784), new global::Windows.Foundation.Point(17.472, 11.866), true, false);
c.LineTo(new global::Windows.Foundation.Point(17.472, 26.54), true, false);
c.BezierTo(new global::Windows.Foundation.Point(17.472, 26.91), new global::Windows.Foundation.Point(17.201, 27.092), new global::Windows.Foundation.Point(16.867, 26.949), true, false);
c.LineTo(new global::Windows.Foundation.Point(11.528, 24.667), true, false);
c.BezierTo(new global::Windows.Foundation.Point(11.192, 24.523), new global::Windows.Foundation.Point(10.924, 24.109), new global::Windows.Foundation.Point(10.924, 23.741), true, false);
c.LineTo(new global::Windows.Foundation.Point(10.924, 9.066), true, false);
c.BezierTo(new global::Windows.Foundation.Point(10.924, 8.698), new global::Windows.Foundation.Point(11.194, 8.515), new global::Windows.Foundation.Point(11.528, 8.657), true, false);
c.LineTo(new global::Windows.Foundation.Point(16.867, 10.94), true, false);
c.ArcTo(new global::Windows.Foundation.Point(17.137, 11.128), new global::Windows.Foundation.Size(0.898, 0.898), 0d, false, global::Windows.UI.Xaml.Media.SweepDirection.Clockwise, true, false);
c.BezierTo(new global::Windows.Foundation.Point(17.227, 11.297), new global::Windows.Foundation.Point(17.326, 11.461), new global::Windows.Foundation.Point(17.432, 11.618), true, false);
c.SetClosedState(false);
c.BeginFigure(new global::Windows.Foundation.Point(9.615, 9.07), true);
c.LineTo(new global::Windows.Foundation.Point(9.615, 23.745), true, false);
c.BezierTo(new global::Windows.Foundation.Point(9.615, 24.113), new global::Windows.Foundation.Point(9.345, 24.527), new global::Windows.Foundation.Point(9.01, 24.67), true, false);
c.LineTo(new global::Windows.Foundation.Point(3.671, 26.952), true, false);
c.BezierTo(new global::Windows.Foundation.Point(3.337, 27.095), new global::Windows.Foundation.Point(3.067, 26.912), new global::Windows.Foundation.Point(3.067, 26.544), true, false);
c.LineTo(new global::Windows.Foundation.Point(3.067, 11.868), true, false);
c.BezierTo(new global::Windows.Foundation.Point(3.067, 11.5), new global::Windows.Foundation.Point(3.336, 11.086), new global::Windows.Foundation.Point(3.671, 10.942), true, false);
c.LineTo(new global::Windows.Foundation.Point(9.011, 8.66), true, false);
c.BezierTo(new global::Windows.Foundation.Point(9.344, 8.517), new global::Windows.Foundation.Point(9.615, 8.7), new global::Windows.Foundation.Point(9.615, 9.07), true, false);
c.SetClosedState(false);
c.BeginFigure(new global::Windows.Foundation.Point(25.328, 13.243), true);
c.LineTo(new global::Windows.Foundation.Point(25.328, 23.74), true, false);
c.BezierTo(new global::Windows.Foundation.Point(25.328, 24.108), new global::Windows.Foundation.Point(25.058, 24.522), new global::Windows.Foundation.Point(24.723, 24.666), true, false);
c.LineTo(new global::Windows.Foundation.Point(19.385, 26.948), true, false);
c.BezierTo(new global::Windows.Foundation.Point(19.051, 27.091), new global::Windows.Foundation.Point(18.781, 26.908), new global::Windows.Foundation.Point(18.781, 26.538), true, false);
c.LineTo(new global::Windows.Foundation.Point(18.781, 13.216), true, false);
c.BezierTo(new global::Windows.Foundation.Point(19.796, 14.447), new global::Windows.Foundation.Point(21.483, 16.831), new global::Windows.Foundation.Point(21.917, 19.516), true, false);
c.LineTo(new global::Windows.Foundation.Point(22.229, 19.516), true, false);
c.BezierTo(new global::Windows.Foundation.Point(22.659, 16.851), new global::Windows.Foundation.Point(24.316, 14.483), new global::Windows.Foundation.Point(25.328, 13.244), true, false);
c.SetClosedState(false);
c.BeginFigure(new global::Windows.Foundation.Point(22.111, 10.854), true);
c.BezierTo(new global::Windows.Foundation.Point(20.046, 10.854), new global::Windows.Foundation.Point(18.373, 9.149), new global::Windows.Foundation.Point(18.373, 7.046), true, false);
c.BezierTo(new global::Windows.Foundation.Point(18.373, 4.944), new global::Windows.Foundation.Point(20.046, 3.239), new global::Windows.Foundation.Point(22.111, 3.239), true, false);
c.BezierTo(new global::Windows.Foundation.Point(24.175, 3.239), new global::Windows.Foundation.Point(25.849, 4.944), new global::Windows.Foundation.Point(25.849, 7.046), true, false);
c.BezierTo(new global::Windows.Foundation.Point(25.849, 9.149), new global::Windows.Foundation.Point(24.175, 10.854), new global::Windows.Foundation.Point(22.111, 10.854), true, false);
c.SetClosedState(false);
c.BeginFigure(new global::Windows.Foundation.Point(22.054, 2), true);
c.BezierTo(new global::Windows.Foundation.Point(19.286, 2), new global::Windows.Foundation.Point(17.042, 4.286), new global::Windows.Foundation.Point(17.042, 7.105), true, false);
c.BezierTo(new global::Windows.Foundation.Point(17.042, 8.483), new global::Windows.Foundation.Point(17.573, 9.798), new global::Windows.Foundation.Point(18.443, 10.716), true, false);
c.BezierTo(new global::Windows.Foundation.Point(18.443, 10.716), new global::Windows.Foundation.Point(21.371, 13.628), new global::Windows.Foundation.Point(21.931, 17.105), true, false);
c.LineTo(new global::Windows.Foundation.Point(22.21, 17.105), true, false);
c.BezierTo(new global::Windows.Foundation.Point(22.77, 13.628), new global::Windows.Foundation.Point(25.681, 10.716), new global::Windows.Foundation.Point(25.681, 10.716), true, false);
c.BezierTo(new global::Windows.Foundation.Point(26.554, 9.798), new global::Windows.Foundation.Point(27.067, 8.484), new global::Windows.Foundation.Point(27.067, 7.106), true, false);
c.BezierTo(new global::Windows.Foundation.Point(27.067, 4.286), new global::Windows.Foundation.Point(24.822, 2), new global::Windows.Foundation.Point(22.054, 2), true, false);
c.SetClosedState(false);
}, global::Windows.UI.Xaml.Media.FillRule.EvenOdd)", generatedCode);
#endif
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ protected sealed override void Dispose(bool disposing)
{{
GC.ReRegisterForFinalize(this);
#if !(NET6_0_OR_GREATER && __MACOS__)
// net6.0-macos uses CoreCLR (not mono) and the notification mechanism is different
#if __MACOS__
// net7.0-macos and later uses CoreCLR (not mono) and the notification mechanism is different
// workaround for mono's https://github.com/xamarin/xamarin-macios/issues/15089
NSObjectMemoryRepresentation.RemoveInFinalizerQueueFlag(this);
#endif
Expand Down
7 changes: 0 additions & 7 deletions src/Uno.Foundation.Runtime.WebAssembly/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,4 @@
[assembly: InternalsVisibleTo("Uno.Wasm")]
[assembly: InternalsVisibleTo("Uno.UI.Tests")]
[assembly: InternalsVisibleTo("Uno.UI.Wasm.Tests")]

#if NET6_0_OR_GREATER
[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")]
#elif __IOS__
[assembly: Foundation.LinkerSafe]
#elif __ANDROID__
[assembly: Android.LinkerSafe]
#endif
10 changes: 0 additions & 10 deletions src/Uno.Foundation/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,4 @@
[assembly: InternalsVisibleTo("Uno.UI.Tests.Performance")]
[assembly: InternalsVisibleTo("Uno.UI.Composition")]
[assembly: InternalsVisibleTo("Uno.UI.Dispatching")]

#if NET6_0_OR_GREATER
[assembly: System.Reflection.AssemblyMetadata("IsTrimmable", "True")]
#elif __IOS__
#pragma warning disable CS0618 // Type or member is obsolete
[assembly: Foundation.LinkerSafe]
#pragma warning restore CS0618 // Type or member is obsolete
[assembly: AssemblyMetadata("IsTrimmable", "True")]
#elif __ANDROID__
[assembly: Android.LinkerSafe]
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@

namespace Windows.Foundation.Collections;

#if !NET6_0_OR_GREATER // moved to linker file
#if __IOS__
[global::Foundation.Preserve(AllMembers = true)]
#elif __ANDROID__
[Android.Runtime.Preserve(AllMembers = true)]
#endif
#endif
internal class ObservableVectorEnumerableWrapper : ObservableVectorWrapper, IObservableVector<object>
{
private readonly IEnumerable _source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

namespace Windows.Foundation.Collections;

#if !NET6_0_OR_GREATER // moved to linker file
#if __IOS__
[global::Foundation.Preserve(AllMembers = true)]
#elif __ANDROID__
[Android.Runtime.Preserve(AllMembers = true)]
#endif
#endif
internal class ObservableVectorListWrapper : ObservableVectorWrapper, IObservableVector<object>
{
private readonly IList _source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@

namespace Windows.Foundation.Collections;

#if !NET6_0_OR_GREATER // moved to linker file
#if __IOS__
[global::Foundation.Preserve(AllMembers = true)]
#elif __ANDROID__
[Android.Runtime.Preserve(AllMembers = true)]
#endif
#endif
internal abstract class ObservableVectorWrapper
{
public event VectorChangedEventHandler<object> VectorChanged;
Expand Down
Loading

0 comments on commit 4f4ba17

Please sign in to comment.