Skip to content

Commit

Permalink
Fixed Wasdk breaking on net7+ (#125)
Browse files Browse the repository at this point in the history
* [WIP] Added net7 as Wasdk Tfm

* Revert to Uno tfms to netstandard until Wasdk supports net7

* Revert "Revert to Uno tfms to netstandard until Wasdk supports net7"

This reverts commit 08dddc7.

* Fixed an issue where IsWinAppSdk was evaluating to true for net7.0 (non-windows)
  • Loading branch information
Arlodotexe authored Aug 28, 2023
1 parent aca3ba7 commit d71eef1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion MultiTarget/AvailableTargetFrameworks.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<UwpTargetFramework>uap10.0.17763</UwpTargetFramework>
<WinAppSdkTargetFramework>net6.0-windows10.0.19041.0</WinAppSdkTargetFramework>
<WinAppSdkTargetFramework>net6.0-windows10.0.19041.0;net7.0-windows10.0.19041.0;</WinAppSdkTargetFramework>

<WasmHeadTargetFramework>net7.0</WasmHeadTargetFramework>
<LinuxHeadTargetFramework>net7.0</LinuxHeadTargetFramework>
Expand Down
3 changes: 2 additions & 1 deletion MultiTarget/EnabledTargetFrameworks.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<UwpTargetFramework>uap10.0.17763</UwpTargetFramework>
<WinAppSdkTargetFramework>net6.0-windows10.0.19041.0</WinAppSdkTargetFramework>
<WinAppSdkTargetFramework>net6.0-windows10.0.19041.0;net7.0-windows10.0.19041.0;</WinAppSdkTargetFramework>

<WasmHeadTargetFramework>net7.0</WasmHeadTargetFramework>
<LinuxHeadTargetFramework>net7.0</LinuxHeadTargetFramework>
Expand All @@ -17,3 +17,4 @@
<DotnetCommonTargetFramework>net7.0</DotnetCommonTargetFramework>
</PropertyGroup>
</Project>

3 changes: 2 additions & 1 deletion MultiTarget/MultiTargetIdentifiers.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
<IsGtk Condition="'$(IsGtk)' == '' AND ('$(IsGtkHead)' == 'true' or '$(IsGtkLib)' == 'true')">true</IsGtk>

<IsUwp Condition="'$(IsUwp)' == '' AND '$(TargetFramework)' == '$(UwpTargetFramework)' AND '$(UwpTargetFramework)' != '' AND '$(MultiTargetsUwp)' == 'true'">true</IsUwp>
<IsWinAppSdk Condition="'$(IsWinAppSdk)' == '' AND '$(TargetFramework)' == '$(WinAppSdkTargetFramework)' AND '$(WinAppSdkTargetFramework)' != '' AND '$(MultiTargetsWasdk)' == 'true'">true</IsWinAppSdk>
<IsWinAppSdk Condition="'$(IsWinAppSdk)' == '' AND $(WinAppSdkTargetFramework.Contains('$(TargetFramework);')) AND '$(WinAppSdkTargetFramework)' != '' AND '$(MultiTargetsWasdk)' == 'true'">true</IsWinAppSdk>

<IsDroid Condition="'$(IsDroid)' == '' AND '$(TargetFramework)' == '$(AndroidLibTargetFramework)' AND '$(AndroidLibTargetFramework)' != '' AND '$(MultiTargetsDroid)' == 'true'">true</IsDroid>
<IsMacOS Condition="'$(IsMacOS)' == '' AND '$(TargetFramework)' == '$(MacOSLibTargetFramework)' AND '$(MacOSLibTargetFramework)' != '' AND '$(MultiTargetsMacOS)' == 'true'">true</IsMacOS>
<IsiOS Condition="'$(IsiOS)' == '' AND '$(TargetFramework)' == '$(iOSLibTargetFramework)' AND '$(iOSLibTargetFramework)' != '' AND '$(MultiTargetsiOS)' == 'true'">true</IsiOS>
Expand Down
2 changes: 1 addition & 1 deletion ProjectHeads/App.Head.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<!-- Source generators -->
<ItemGroup Condition="'$(TargetFramework)' != '$(WinAppSdkTargetFramework)'">
<ItemGroup Condition="'$(IsWinAppSdk)' != 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions ProjectHeads/Head.WinAppSdk.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\PackageReferences\WinAppSdk.props" />
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\WinUI.Extra.props" />

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>$(WinAppSdkTargetFramework)</TargetFramework>
<TargetFramework>$(WinAppSdkTargetFramework.Split(';')[0])</TargetFramework>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
Expand All @@ -15,6 +12,9 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\PackageReferences\WinAppSdk.props" />
<Import Project="$(MSBuildThisFileDirectory)\..\MultiTarget\WinUI.Extra.props" />

<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ProjectHeads/Tests.Head.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<!-- Source generators -->
<ItemGroup Condition="'$(TargetFramework)' != '$(WinAppSdkTargetFramework)'">
<ItemGroup Condition="'$(IsWinAppSdk)' != 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
</ItemGroup>
Expand Down

0 comments on commit d71eef1

Please sign in to comment.