Skip to content

Commit

Permalink
Add support for Modern UWP (#12)
Browse files Browse the repository at this point in the history
* Fixing uap content files

* Add modern UWP, add font resource content files manually

* Fix AOT

* Only copy fonts to executables and don't bother packaging projects

* Make platform check more generic

* Asset path changed

---------

Co-authored-by: Dawei Huang <davidxuang@live.com>
  • Loading branch information
devsko and davidxuang authored Nov 13, 2024
1 parent 77414f1 commit 6b45001
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
17 changes: 13 additions & 4 deletions FluentIcons.Uwp/FluentIcons.Uwp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.44">
<Project Sdk="MSBuild.Sdk.Extras/3.0.44">
<PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) or '$(EnableWindowsTargeting)' == 'true'">
$(TargetFrameworks);uap10.0.17763.0
$(TargetFrameworks);uap10.0.17763.0;net8.0-windows10.0.26100.0
</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net8.0-macos</TargetFrameworks>
<Description>FluentUI System Icons control library for UWP.</Description>
Expand All @@ -14,7 +14,7 @@
<Choose>
<When Condition="$(TargetFramework.StartsWith('uap'))">
<PropertyGroup>
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

Expand All @@ -23,6 +23,15 @@
</ItemGroup>
</When>

<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<PropertyGroup>
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<UseUwp>true</UseUwp>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
</PropertyGroup>
</When>

<Otherwise>
<ItemGroup>
<ProjectReference Include="..\FluentIcons.Uno\FluentIcons.Uno.csproj" ExactVersion="true" />
Expand All @@ -46,4 +55,4 @@
PackagePath="content-transitive/$(PackageId)/Assets" />
<None Include="VisualStudioToolsManifest.xml" Pack="True" PackagePath="tools" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion FluentIcons.Uwp/SymbolIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private static void OnMirroredWhenRightToLeftChanged(DependencyObject sender, De
}

[MarkupExtensionReturnType(ReturnType = typeof(SymbolIcon))]
public class SymbolIconExtension : MarkupExtension
public partial class SymbolIconExtension : MarkupExtension
{
public Symbol? Symbol { get; set; }
public IconVariant? IconVariant { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion FluentIcons.Uwp/SymbolIconSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private static void OnMirroredWhenRightToLeftChanged(DependencyObject sender, De
}

[MarkupExtensionReturnType(ReturnType = typeof(SymbolIconSource))]
public class SymbolIconSourceExtension : MarkupExtension
public partial class SymbolIconSourceExtension : MarkupExtension
{
public Symbol? Symbol { get; set; }
public IconVariant? IconVariant { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>

<ItemGroup Condition="'$(UseUwp)' == 'true' and '$(OutputType)' == 'WinExe'">
<Content Include="$(MSBuildThisFileDirectory)..\..\content-transitive\**" Visible="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>

0 comments on commit 6b45001

Please sign in to comment.