Skip to content

Commit

Permalink
Merge pull request #18548 from ramezgerges/uno_sdk_ignore_platform_xaml
Browse files Browse the repository at this point in the history
fix(uno.sdk): ignore xaml files in Platforms folders
  • Loading branch information
jeromelaban authored Oct 31, 2024
2 parents bdb1b63 + d35f69f commit fe0c9cd
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace uno53net9blank;
using System;
using Microsoft.UI.Xaml.Controls;

public sealed
#if !DESKTOP
// This control tests that ControlWithXamlEverywhereExceptDesktop.xaml is not included,
// so if ControlWithXamlEverywhereExceptDesktop.xaml is included, it won't compile.
partial
#endif
class ControlWithXamlEverywhereExceptDesktop : Page
{
public ControlWithXamlEverywhereExceptDesktop()
{
// no this.InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Page x:Class="uno53net9blank.ControlWithXamlEverywhereExceptDesktop"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:skia="http://uno.ui/skia"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="skia"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Page x:Class="uno53net9blank.ControlWithXamlEverywhereExceptDesktop"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:skia="http://uno.ui/skia"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="skia"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Page x:Class="uno53net9blank.ControlWithXamlEverywhereExceptDesktop"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:skia="http://uno.ui/skia"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="skia"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Page x:Class="uno53net9blank.ControlWithXamlEverywhereExceptDesktop"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:skia="http://uno.ui/skia"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="skia"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
</Page>
1 change: 1 addition & 0 deletions src/Uno.Sdk/targets/Uno.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
Condition=" $(_IsUnoSingleProjectAndLegacy) == 'true' ">
<ItemGroup>
<None Remove="@(_IgnorePlatformFiles)" />
<Page Remove="@(_IgnorePlatformFiles)" />
<Compile Remove="@(_IgnorePlatformFiles)" />
<Content Remove="@(_IgnorePlatformFiles)" />
<EmbeddedResource Remove="@(_IgnorePlatformFiles)" />
Expand Down
1 change: 1 addition & 0 deletions src/Uno.Sdk/targets/Uno.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
<_IgnorePlatformFiles Include="$(WindowsProjectFolder)**"
Condition=" $(IsWinAppSdk) != 'true' AND '$(WindowsProjectFolder)'!='' " />
<Compile Remove="@(_IgnorePlatformFiles)" />
<Page Remove="@(_IgnorePlatformFiles)" />
<Content Remove="@(_IgnorePlatformFiles)" />
<EmbeddedResource Remove="@(_IgnorePlatformFiles)" />
<Manifest Remove="@(_IgnorePlatformFiles)" />
Expand Down
1 change: 1 addition & 0 deletions src/Uno.Sdk/targets/Uno.Sdk.After.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- Sanity check ensure that platform files for other targets are not included -->
<ItemGroup Condition=" $(_IsUnoSingleProjectAndLegacy) == 'true' and $(PlatformsProjectFolder) != '' and Exists($(PlatformsProjectFolder))">
<Compile Remove="@(_IgnorePlatformFiles)" />
<Page Remove="@(_IgnorePlatformFiles)" />
<Content Remove="@(_IgnorePlatformFiles)" />
<EmbeddedResource Remove="@(_IgnorePlatformFiles)" />
<Manifest Remove="@(_IgnorePlatformFiles)" />
Expand Down
1 change: 1 addition & 0 deletions src/Uno.Sdk/targets/Uno.SingleProject.Desktop.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<_AllPlatformFiles Include="$(PlatformsProjectFolder)/**/*" />
<_IgnorePlatformFiles Include="@(_AllPlatformFiles)" Exclude="@(_TargetPlatformFiles)" />
<Compile Remove="@(_IgnorePlatformFiles)" />
<Page Remove="@(_IgnorePlatformFiles)" />
<Content Remove="@(_IgnorePlatformFiles)" />
<EmbeddedResource Remove="@(_IgnorePlatformFiles)" />
<Manifest Remove="@(_IgnorePlatformFiles)" />
Expand Down

0 comments on commit fe0c9cd

Please sign in to comment.