Skip to content

Commit

Permalink
Merge pull request unoplatform#16161 from Youssef1313/has-uno-winui
Browse files Browse the repository at this point in the history
build: Don't include HAS_UNO_WINUI for Windows builds
  • Loading branch information
jeromelaban authored Apr 26, 2024
2 parents df5929a + d4c0585 commit ea348a1
Show file tree
Hide file tree
Showing 28 changed files with 34 additions and 34 deletions.
1 change: 0 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<Deterministic>true</Deterministic>

<UNO_UWP_BUILD>false</UNO_UWP_BUILD>
<DefineConstants Condition="'$(UNO_UWP_BUILD)'!='true'">$(DefineConstants);HAS_UNO_WINUI</DefineConstants>

<!-- Resizetizer codegen is not supported in UWP -->
<UnoResizetizerDisableWindowIconExtensions Condition="'$(UNO_UWP_BUILD)'=='true'">true</UnoResizetizerDisableWindowIconExtensions>
Expand Down
6 changes: 3 additions & 3 deletions src/SamplesApp/SamplesApp.Shared/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using Uno.Logging;
#endif

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using LaunchActivatedEventArgs = Microsoft/* UWP don't rename */.UI.Xaml.LaunchActivatedEventArgs;
#else
using LaunchActivatedEventArgs = Windows.ApplicationModel.Activation.LaunchActivatedEventArgs;
Expand Down Expand Up @@ -120,7 +120,7 @@ override void OnLaunched(LaunchActivatedEventArgs e)
LaunchiOSWatchDog();
#endif
var activationKind =
#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
e.UWPLaunchActivatedEventArgs.Kind
#else
e.Kind
Expand Down Expand Up @@ -306,7 +306,7 @@ private void ActivateMainWindow()

public event EventHandler? MainWindowActivated;

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
protected override void OnWindowCreated(global::Microsoft.UI.Xaml.WindowCreatedEventArgs args)
{
if (Current is null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void Setter()
stopButton.IsEnabled = _cts != null && !_cts.IsCancellationRequested || !isRunning;
RunningStateForUITest = runningState.Text = isRunning ? "Running" : "Finished";
runStatus.Text = message;
#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
if (Private.Infrastructure.TestServices.WindowHelper.CurrentTestWindow is Microsoft.UI.Xaml.Window window)
{
window.Title = message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using Windows.Foundation;
using Windows.Foundation.Collections;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using PointerDeviceType = Microsoft.UI.Input.PointerDeviceType;
#else
using PointerDeviceType = Windows.Devices.Input.PointerDeviceType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private void CoreWindowActivated(CoreWindow sender, Windows.UI.Core.WindowActiva
}

private void WindowActivated(object sender,
#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
Microsoft/* UWP don't rename */.UI.Xaml.WindowActivatedEventArgs e
#else
Windows.UI.Core.WindowActivatedEventArgs e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.UI.Xaml.Media;
using Uno.UI.Samples.Controls;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using Microsoft.UI.Input;
#else
using Windows.Devices.Input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.UI.Xaml.Input;
using Uno.UI.Samples.Controls;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using Microsoft.UI.Input;
#else
using Windows.Devices.Input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.UI.Xaml.Media;
using Uno.UI.Samples.Controls;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using Microsoft.UI.Input;
#else
using Windows.Devices.Input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.UI.Xaml.Navigation;
using Uno.UI.Samples.Controls;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using Microsoft.UI.Input;
#else
using Windows.Devices.Input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Microsoft.UI.Xaml.Documents;
using Uno.Extensions;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using Microsoft.UI.Input;
#else
using Windows.Devices.Input;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft/* UWP don't rename */.UI.Xaml;
#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
#endif
using Uno.UI.Samples.Controls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.UI.Xaml.Input;
using Uno.UI.Samples.Controls;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using Microsoft.UI.Input;
#else
using Windows.Devices.Input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.UI.Xaml.Input;
using Uno.UI.Samples.Controls;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using Microsoft.UI.Input;
#else
using Windows.Devices.Input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Windows.Foundation;
using Microsoft.UI.Xaml.Input;

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Microsoft.UI.Xaml.Controls;
#endif

Expand Down
3 changes: 2 additions & 1 deletion src/Uno.CrossTargetting.targets
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@

<PropertyGroup Condition=" '$(TargetFramework)' != 'uap10.0.19041' and '$(TargetFramework)'!='net7.0-windows10.0.19041.0' and '$(TargetPlatformIdentifier)' != 'UAP'">
<DefineConstants>$(DefineConstants);HAS_UNO</DefineConstants>
<DefineConstants Condition="'$(UNO_UWP_BUILD)'!='true'">$(DefineConstants);HAS_UNO_WINUI</DefineConstants>

<!-- Hint the VS's XAML parser -->
<!-- https://github.com/unoplatform/uno/issues/15517 -->
<DefaultXamlRuntime Condition="'$(DefaultXamlRuntime)'==''">WinUI</DefaultXamlRuntime>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-windows10.0.19041.0'">
<DefineConstants>$(DefineConstants);HAS_INPUT_INJECTOR</DefineConstants>
<DefineConstants>$(DefineConstants);HAS_INPUT_INJECTOR;WINDOWS_WINUI</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'uap10.0.19041' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
using Private.Infrastructure;

#if !HAS_UNO_WINUI
using Microsoft.UI.Xaml.Controls;
#if HAS_UNO && !HAS_UNO_WINUI
using Windows.UI.Xaml.Controls;
#endif

namespace Uno.UI.RuntimeTests.Tests.Microsoft_UI_Xaml_Controls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
using Private.Infrastructure;
using Uno.UI.RuntimeTests.Helpers;

#if !HAS_UNO_WINUI
using Microsoft.UI.Xaml.Controls;
#if HAS_UNO && !HAS_UNO_WINUI
using Windows.UI.Xaml.Controls;
#endif

namespace Uno.UI.RuntimeTests.Tests.Microsoft_UI_Xaml_Controls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
using RatingControl = Microsoft/* UWP don't rename */.UI.Xaml.Controls.RatingControl;

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Windows.UI.Xaml.Controls;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Uno.UI.RuntimeTests.Helpers;
using Windows.UI.Input.Preview.Injection;

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using PointerDeviceType = Microsoft.UI.Input.PointerDeviceType;
#else
using PointerDeviceType = Windows.Devices.Input.PointerDeviceType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using SamplesApp.UITests;
using Windows.Foundation;

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
using Microsoft.UI.Xaml.Shapes;
using static Private.Infrastructure.TestServices;

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using Uno.UI;
#endif

#if HAS_UNO_WINUI
#if HAS_UNO_WINUI || WINAPPSDK
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Controls;
Expand All @@ -45,7 +45,7 @@ namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls
[RunsOnUIThread]
public partial class Given_NavigationView
{
#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
[TestMethod]
[RunsOnUIThread]
#if __MACOS__
Expand Down Expand Up @@ -161,7 +161,7 @@ async Task<Rect> Select(int group, int item)

}

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
public partial class MyNavigationView : NavigationView
{
public NavigationViewList MenuItemsHost { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using Uno.UI;
using MUXControlsTestApp.Utilities;

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@



#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
#endif
#if HAS_UNO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using Uno.Extensions;
using Uno.UI.RuntimeTests.Helpers;

#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Windows.UI.Xaml.Controls;
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using FluentAssertions;
#if !HAS_UNO_WINUI
#if HAS_UNO && !HAS_UNO_WINUI
using Microsoft/* UWP don't rename */.UI.Xaml.Controls;
#endif
using Private.Infrastructure;
Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI/Extensions/PrettyPrint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Windows.Foundation;
using Windows.UI;

#if HAS_UNO_WINUI || WINAPPSDK
#if HAS_UNO_WINUI || WINAPPSDK || WINUI
using Colors = Microsoft.UI.Colors;
#else
using Colors = Windows.UI.Colors;
Expand Down

0 comments on commit ea348a1

Please sign in to comment.