Skip to content

Commit

Permalink
Allow building samples for .NET 8 (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotMorten authored Oct 6, 2023
1 parent 98e596c commit af2a797
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
21 changes: 20 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@

<IsToolkitLibrary Condition="'$(IsTestProject)' == 'true' or '$(IsSampleProject)' == 'true' or $(IsTemplateProject) == 'true'">false</IsToolkitLibrary>
<IsToolkitLibrary Condition="'$(IsTestProject)' != 'true' and '$(IsSampleProject)' != 'true' and $(IsTemplateProject) != 'true'">true</IsToolkitLibrary>
</PropertyGroup>

<!--Framework versions-->
<PropertyGroup Condition="'$(ArcGISRuntimePackageVersion)'&lt;'200.3.0'">
<ArcGISRuntime_MinimumSupportedWindowsBuild Condition="'$(ArcGISRuntime_MinimumSupportedWindowsBuild)'==''">17763</ArcGISRuntime_MinimumSupportedWindowsBuild>
<WindowsSDKTargetBuild Condition="'$(WindowsSDKTargetBuild)'==''">19041</WindowsSDKTargetBuild>
<UWPTargetPlatformVersion>10.0.$(WindowsSDKTargetBuild).0</UWPTargetPlatformVersion>
Expand All @@ -43,7 +45,24 @@
<NetMauiWindowsTargetFramework Condition="'$(NetMauiWindowsTargetFramework)'==''">$(NETMauiTarget)-windows10.0.$(WindowsSDKTargetBuild).0</NetMauiWindowsTargetFramework>
<NetAndroidTargetFramework Condition="'$(NetAndroidTargetFramework)'==''">$(NETMauiTarget)-android33.0</NetAndroidTargetFramework>
<NetCatalystTargetFramework Condition="'$(NetCatalystTargetFramework)'==''">$(NETMauiTarget)-maccatalyst16.1</NetCatalystTargetFramework>
<NetiOSTargetFramework Condition="'$(NetiOSTargetFramework)'==''">$(NETMauiTarget)-ios16.1</NetiOSTargetFramework>
<NetiOSTargetFramework Condition="'$(NetiOSTargetFramework)'==''">$(NETMauiTarget)-ios16.1</NetiOSTargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(ArcGISRuntimePackageVersion)'&gt;='200.3.0'">
<ArcGISRuntime_MinimumSupportedWindowsBuild Condition="'$(ArcGISRuntime_MinimumSupportedWindowsBuild)'==''">19041</ArcGISRuntime_MinimumSupportedWindowsBuild>
<WindowsSDKTargetBuild Condition="'$(WindowsSDKTargetBuild)'==''">19041</WindowsSDKTargetBuild>
<UWPTargetPlatformVersion>10.0.$(WindowsSDKTargetBuild).0</UWPTargetPlatformVersion>
<UWPTargetPlatformMinVersion>10.0.$(ArcGISRuntime_MinimumSupportedWindowsBuild).0</UWPTargetPlatformMinVersion>
<DotNetTargetFramework>net472</DotNetTargetFramework>
<UWPTargetFramework>uap10.0.$(WindowsSDKTargetBuild)</UWPTargetFramework>
<NetWindowsTargetFramework Condition="'$(NetWindowsTargetFramework)'==''">net8.0-windows10.0.$(WindowsSDKTargetBuild).0</NetWindowsTargetFramework>
<NETMauiTarget Condition="'$(NETMauiTarget)'==''">net8.0</NETMauiTarget>
<NetMauiWindowsTargetFramework Condition="'$(NetMauiWindowsTargetFramework)'==''">$(NETMauiTarget)-windows10.0.$(WindowsSDKTargetBuild).0</NetMauiWindowsTargetFramework>
<NetAndroidTargetFramework Condition="'$(NetAndroidTargetFramework)'==''">$(NETMauiTarget)-android34.0</NetAndroidTargetFramework>
<NetCatalystTargetFramework Condition="'$(NetCatalystTargetFramework)'==''">$(NETMauiTarget)-maccatalyst16.1</NetCatalystTargetFramework>
<NetiOSTargetFramework Condition="'$(NetiOSTargetFramework)'==''">$(NETMauiTarget)-ios16.1</NetiOSTargetFramework>
</PropertyGroup>
<PropertyGroup>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>

<!--Output paths-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks>$(NETMauiTarget)-android;$(NETMauiTarget)-ios;$(NETMauiTarget)-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);$(NetMauiWindowsTargetFramework)</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Toolkit.SampleApp.Maui</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))'=='.NETCoreApp'">
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), &quot;net8.0&quot;))'!='true'">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net8.0'))">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>$(NetWindowsTargetFramework)</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>Esri.ArcGISRuntime.Toolkit.SampleApp</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand All @@ -11,6 +11,7 @@
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<DefineConstants>$(DefineConstants);WINUI</DefineConstants>
<UseRidGraph Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net8.0'))">true</UseRidGraph>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit af2a797

Please sign in to comment.