Skip to content

Commit 572a0e2

Browse files
authored
chore: remove native rendering and winappsdk (#1640)
1 parent ddc20d2 commit 572a0e2

File tree

16 files changed

+30
-281
lines changed

16 files changed

+30
-281
lines changed

Chefs.UITests/Chefs.UITests.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88

9-
<!-- Comment to use native rendering -->
10-
<UseSkiaRendering Condition="'$(UseSkiaRendering)'==''">true</UseSkiaRendering>
11-
129
<DefineConstants Condition="$(TargetFrameworkOverride.ToLowerInvariant().EndsWith('-android'))">$(DefineConstants);TARGET_FRAMEWORK_OVERRIDE_ANDROID</DefineConstants>
1310
<DefineConstants Condition="$(TargetFrameworkOverride.ToLowerInvariant().Contains('-ios'))">$(DefineConstants);TARGET_FRAMEWORK_OVERRIDE_IOS</DefineConstants>
14-
<DefineConstants Condition="'$(UseSkiaRendering)'=='true'">$(DefineConstants);HAS_SKIA_RENDERER</DefineConstants>
1511
</PropertyGroup>
1612

1713
<ItemGroup>

Chefs.UITests/Constants.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ namespace Chefs.UITests;
99

1010
public class Constants
1111
{
12-
public readonly static string ApplicationId =
13-
#if HAS_SKIA_RENDERER
14-
"uno.platform.chefs.skia";
15-
#else
16-
"uno.platform.chefs";
17-
#endif
12+
public readonly static string ApplicationId = "uno.platform.chefs.skia";
1813

1914
public readonly static string WebAssemblyDefaultUri = "http://localhost:51480/";
2015
public readonly static string iOSAppName = ApplicationId;

Chefs.UITests/Given_WelcomePage.cs

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,22 @@
1313

1414
namespace Chefs.UITests;
1515

16-
[AutoRetry(5)]
16+
[AutoRetry]
1717
public class Given_WelcomePage : TestBase
1818
{
1919
[Test]
2020
public void When_SmokeTest()
2121
{
2222
Helpers.Wait(seconds: 3);
2323

24-
#if HAS_SKIA_RENDERER
2524
PlatformHelpers.On(
2625
iOS: () => App.WaitForElement(q => q.Class("UnoSKMetalView")),
2726
Android: () => App.WaitForElement(q => q.Class("UnoSKCanvasView")),
2827
Browser: () => App.WaitForElement(q => q.Id("uno-canvas"))
2928
);
30-
#endif
3129

3230
TakeScreenshot("Launched");
3331

34-
#if HAS_SKIA_RENDERER
3532
PlatformHelpers.On(
3633
// Cannot use backdoors on iOS, AppDelegate is inaccessible
3734
iOS: () => { },
@@ -40,42 +37,9 @@ public void When_SmokeTest()
4037
);
4138

4239
TakeScreenshot("WelcomePage");
43-
#else
44-
Login();
45-
#endif
46-
4740
}
4841

4942
private void AssertWelcomePage() => App.WaitFor(() => GetCurrentPage().EndsWithIgnoreCase("WelcomePage"), timeoutMessage: "Timed out waiting for WelcomePage");
5043

5144
private string GetCurrentPage() => (App.InvokeGeneric("browser:SampleRunner|GetCurrentPage", "") as string) ?? string.Empty;
52-
53-
#if !HAS_SKIA_RENDERER
54-
private void Login()
55-
{
56-
var skipButton = new QueryEx(q => q.All().Marked("SkipButton"));
57-
var username = new QueryEx(q => q.All().Marked("LoginUsername"));
58-
var password = new QueryEx(q => q.All().Marked("LoginPassword"));
59-
var loginButton = new QueryEx(q => q.All().Marked("LoginButton"));
60-
var trendingNow = new QueryEx(q => q.All().Marked("TrendingNowFeed"));
61-
62-
App.WaitForElement(skipButton, timeoutMessage: "Timed out waiting for WelcomePage");
63-
64-
TakeScreenshot("WelcomePage");
65-
66-
App.Tap(skipButton);
67-
68-
App.WaitForElement(loginButton, timeoutMessage: "Timed out waiting for LoginPage");
69-
70-
TakeScreenshot("LoginPage");
71-
72-
App.EnterText(username, "testuser");
73-
App.EnterText(password, "testpassword");
74-
App.Tap(loginButton);
75-
76-
App.WaitForElement(trendingNow);
77-
78-
TakeScreenshot("HomePage");
79-
}
80-
#endif
8145
}

Chefs/App.xaml.host.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)
178178

179179
new RouteMap("RecipeDetails", View: views.FindByViewModel<RecipeDetailsModel>()),
180180
new RouteMap("LiveCooking", View: views.FindByViewModel<LiveCookingModel>()),
181-
#if !IS_WASM_SKIA
182181
new RouteMap("Map", View: views.FindByViewModel<MapModel>()),
183-
#endif
184182
]),
185183
new RouteMap("Notifications", View: views.FindByViewModel<NotificationsModel>()),
186184
new RouteMap("Filter", View: views.FindByViewModel<FilterModel>()),

Chefs/Chefs.csproj

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<TargetFrameworks Condition="'$(TargetFrameworkOverride)'==''">
99
net9.0-android;
1010
net9.0-ios;
11-
net9.0-maccatalyst;
1211
net9.0-windows10.0.19041;
1312
net9.0-desktop;
1413
net9.0-browserwasm;
@@ -17,19 +16,15 @@
1716
<UnoSingleProject>true</UnoSingleProject>
1817
<!-- Display name -->
1918
<ApplicationTitle>Chefs</ApplicationTitle>
20-
21-
<!-- Comment to use native rendering -->
22-
<UseSkiaRendering Condition="'$(UseSkiaRendering)'==''">true</UseSkiaRendering>
2319

2420
<!-- App Identifier -->
25-
<ApplicationId Condition="'$(UseSkiaRendering)' != 'true'">uno.platform.chefs</ApplicationId>
26-
<ApplicationId Condition="'$(UseSkiaRendering)' == 'true'">uno.platform.chefs.skia</ApplicationId>
21+
<ApplicationId>uno.platform.chefs.skia</ApplicationId>
2722

2823
<ApplicationId Condition="'$(IsCanaryBranch)'=='true'">$(ApplicationId)-canary</ApplicationId>
2924

3025
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
3126
<ApplicationVersion>1</ApplicationVersion>
32-
<UseMocks>true</UseMocks>
27+
<UseMocks Condition="'$(UseMocks)'==''">true</UseMocks>
3328
<!--
3429
If you encounter this error message:
3530
@@ -45,12 +40,6 @@
4540
UnoFeatures let's you quickly add and manage implicit package references based on the features you want to use.
4641
https://aka.platform.uno/singleproject-features
4742
-->
48-
<IsSkiaWasm Condition="'$(UseSkiaRendering)'=='true' AND $(IsBrowserWasm)">true</IsSkiaWasm>
49-
<IsSkiaWasm Condition="'$(IsSkiaWasm)'==''">false</IsSkiaWasm>
50-
<IsSkiaAndroid Condition="'$(UseSkiaRendering)'=='true' AND $(IsAndroid)">true</IsSkiaAndroid>
51-
<IsSkiaAndroid Condition="'$(IsSkiaAndroid)'==''">false</IsSkiaAndroid>
52-
<IsSkiaUIKit Condition="'$(UseSkiaRendering)'=='true' AND $(IsIOSOrCatalyst)">true</IsSkiaUIKit>
53-
<IsSkiaUIKit Condition="'$(IsSkiaUIKit)'==''">false</IsSkiaUIKit>
5443

5544
<UnoFeatures>
5645
Material;
@@ -67,32 +56,16 @@
6756
Skia;
6857
ThemeService;
6958
Authentication;
59+
SkiaRenderer;
7060
</UnoFeatures>
71-
<UnoFeatures Condition="$(IsSkiaWasm)">$(UnoFeatures)SkiaRenderer;</UnoFeatures>
72-
<UnoFeatures Condition="$(IsSkiaAndroid)">$(UnoFeatures)SkiaRenderer;</UnoFeatures>
73-
<UnoFeatures Condition="$(IsSkiaUIKit)">$(UnoFeatures)SkiaRenderer;</UnoFeatures>
7461

7562
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
76-
<DefineConstants Condition="$(IsSkiaWasm)">$(DefineConstants);IS_WASM_SKIA</DefineConstants>
77-
<DefineConstants Condition="$(IsSkiaAndroid)">$(DefineConstants);IS_ANDROID_SKIA</DefineConstants>
78-
<DefineConstants Condition="$(IsSkiaUIKit)">$(DefineConstants);IS_UIKIT_SKIA</DefineConstants>
79-
<DefineConstants Condition="'$(UseSkiaRendering)'=='true'">$(DefineConstants);HAS_SKIA_RENDERER</DefineConstants>
8063
</PropertyGroup>
8164

82-
<Choose>
83-
<When Condition="$(IsWinAppSdk)">
84-
<ItemGroup>
85-
<PackageReference Include="Mapsui.WinUI" />
86-
<PackageReference Include="LiveChartsCore.SkiaSharpView.WinUI" />
87-
</ItemGroup>
88-
</When>
89-
<Otherwise>
90-
<ItemGroup>
91-
<PackageReference Include="Mapsui.Uno.WinUI" />
92-
<PackageReference Include="LiveChartsCore.SkiaSharpView.Uno.WinUI" />
93-
</ItemGroup>
94-
</Otherwise>
95-
</Choose>
65+
<ItemGroup>
66+
<PackageReference Include="Mapsui.Uno.WinUI" />
67+
<PackageReference Include="LiveChartsCore.SkiaSharpView.Uno.WinUI" />
68+
</ItemGroup>
9669

9770
<PropertyGroup Condition="'$(UseMocks)'=='true'">
9871
<DefineConstants>$(DefineConstants);USE_MOCKS</DefineConstants>
@@ -171,25 +144,9 @@
171144
<PackageReference Include="Xamarin.TestCloud.Agent" />
172145
</ItemGroup>
173146
</When>
174-
<When Condition="$(IsMacCatalyst)">
175-
<PropertyGroup Condition="'$(Configuration)'=='Release'">
176-
<MtouchUseLlvm>true</MtouchUseLlvm>
177-
<CodeSigningKey>Apple Distribution: Uno Platform Inc. (PD74CHS9Z5)</CodeSigningKey>
178-
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
179-
<CreatePackage>true</CreatePackage>
180-
<EnablePackageSigning>true</EnablePackageSigning>
181-
<EnableCodeSigning>true</EnableCodeSigning>
182-
183-
<_BaseCodesignProvision>Uno Chefs</_BaseCodesignProvision>
184-
<_BaseCodesignProvision Condition="$(UseSkiaRendering)">Uno Chefs Skia</_BaseCodesignProvision>
185-
<CodesignProvision>$(_BaseCodesignProvision) (Catalyst)</CodesignProvision>
186-
<CodesignProvision Condition="$(BUILD_SOURCEBRANCH.StartsWith('refs/heads/canaries'))">$(_BaseCodesignProvision) Canary (Catalyst)</CodesignProvision>
187-
</PropertyGroup>
188-
</When>
189147
<When Condition="$(IsBrowserWasm)">
190148
<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(WasmShellMonoRuntimeExecutionMode)'=='InterpreterAndAOT'">
191-
<WasmAotFileName Condition="'$(UseSkiaRendering)' != 'true' ">aot.profile</WasmAotFileName>
192-
<WasmAotFileName Condition="'$(UseSkiaRendering)' == 'true' ">aot-skia.profile</WasmAotFileName>
149+
<WasmAotFileName>aot-skia.profile</WasmAotFileName>
193150
</PropertyGroup>
194151

195152
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using System.Collections.Immutable;
22
using Android.Runtime;
3-
#if !IS_ANDROID_SKIA
4-
using Com.Nostra13.Universalimageloader.Core;
5-
#endif
63
using Microsoft.UI.Xaml.Media;
74

85
namespace Chefs.Droid;
@@ -24,22 +21,5 @@ static Application()
2421
public Application(IntPtr javaReference, JniHandleOwnership transfer)
2522
: base(() => new App(), javaReference, transfer)
2623
{
27-
#if !IS_ANDROID_SKIA
28-
ConfigureUniversalImageLoader();
29-
#endif
3024
}
31-
32-
#if !IS_ANDROID_SKIA
33-
private static void ConfigureUniversalImageLoader()
34-
{
35-
// Create global configuration and initialize ImageLoader with this config
36-
ImageLoaderConfiguration config = new ImageLoaderConfiguration
37-
.Builder(Context)
38-
.Build();
39-
40-
ImageLoader.Instance.Init(config);
41-
42-
ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
43-
}
44-
#endif
4525
}

Chefs/Platforms/MacCatalyst/Main.maccatalyst.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@ public class EntryPoint
88
// This is the main entry point of the application.
99
public static void Main(string[] args)
1010
{
11-
#if !IS_UIKIT_SKIA
12-
// if you want to use a different Application Delegate class from "AppDelegate"
13-
// you can specify it here.
14-
UIApplication.Main(args, null, typeof(App));
15-
#else
1611
var host = UnoPlatformHostBuilder.Create()
1712
.App(() => new App())
1813
.UseAppleUIKit()
1914
.Build();
2015

2116
host.Run();
22-
#endif
2317
}
2418
}

Chefs/Platforms/WebAssembly/Program.cs

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,16 @@ namespace Chefs;
44

55
public class Program
66
{
7-
#if IS_WASM_SKIA
8-
static async Task Main(string[] args)
9-
#else
10-
static int Main(string[] args)
11-
#endif
12-
{
13-
App.InitializeLogging();
7+
static async Task Main(string[] args)
148

15-
#if !IS_WASM_SKIA
16-
Uno.UI.Xaml.Media.FontFamilyHelper.PreloadAsync("ms-appx:///Assets/Fonts/MaterialIcons-Regular.ttf#Material Symbols Outlined");
17-
Uno.UI.Xaml.Media.FontFamilyHelper.PreloadAsync("ms-appx:///Assets/Fonts/FontAwesome-Brands.otf#Font Awesome 6 Brands");
18-
#endif
9+
{
10+
App.InitializeLogging();
1911

20-
#if IS_WASM_SKIA
21-
var host = UnoPlatformHostBuilder.Create()
22-
.App(() => new App())
23-
.UseWebAssembly()
24-
.Build();
12+
var host = UnoPlatformHostBuilder.Create()
13+
.App(() => new App())
14+
.UseWebAssembly()
15+
.Build();
2516

26-
await host.RunAsync();
27-
#else
28-
Microsoft.UI.Xaml.Application.Start(_ => new App());
29-
return 0;
30-
#endif
31-
}
17+
await host.RunAsync();
18+
}
3219
}

Chefs/Platforms/iOS/Main.iOS.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,11 @@ public class EntryPoint
99
public static void Main(string[] args)
1010
{
1111
App.InitializeLogging();
12-
13-
#if !IS_UIKIT_SKIA
14-
// if you want to use a different Application Delegate class from "AppDelegate"
15-
// you can specify it here.
16-
UIApplication.Main(args, null, typeof(App));
17-
#else
1812
var host = UnoPlatformHostBuilder.Create()
1913
.App(() => new App())
2014
.UseAppleUIKit()
2115
.Build();
2216

2317
host.Run();
24-
#endif
2518
}
2619
}

build/workflow/build-android.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
jobs:
22
- job: Android_UITest_Build
33
timeoutInMinutes: 90
4-
strategy:
5-
matrix:
6-
Native:
7-
UseSkiaRendering: false
8-
VariantName: Native
9-
Skia:
10-
UseSkiaRendering: true
11-
VariantName: Skia
124
pool:
135
vmImage: macOS-14
146

@@ -50,14 +42,6 @@ jobs:
5042
ArtifactName: Android_UITest_$(VariantName)
5143

5244
- job: Android
53-
strategy:
54-
matrix:
55-
Android:
56-
UseSkiaRendering: false
57-
VariantName: Native
58-
Android_Skia:
59-
UseSkiaRendering: true
60-
VariantName: Skia
6145

6246
pool:
6347
vmImage: windows-2022

0 commit comments

Comments
 (0)