<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFrameworks>net7.0-maccatalyst;net6.0-android;net6.0-ios</TargetFrameworks>
		<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
		<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
    <OutputType>Exe</OutputType>
		<RootNamespace>Templates_Wherever_Needed</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>

		<!-- Display name -->
		<ApplicationTitle>Templates-Wherever-Needed</ApplicationTitle>

		<!-- App Identifier -->
		<ApplicationId>com.companyname.templates_wherever_needed</ApplicationId>
		<ApplicationIdGuid>372fdacd-deac-4c68-8f11-ea279112576f</ApplicationIdGuid>

		<!-- Versions -->
		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
		<ApplicationVersion>1</ApplicationVersion>

		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
		<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-android|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-android|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-ios|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-maccatalyst|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-maccatalyst|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-windows10.0.19041.0|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-windows10.0.19041.0|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup>
	  <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-ios|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-ios|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-android|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-android|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-windows10.0.19041.0|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-windows10.0.19041.0|AnyCPU'">
	  <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
	</PropertyGroup>

	<!-- Android -->
	<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-android')) != true">
		<Compile Remove="**\**\*.Android.cs" />
		<None Include="**\**\*.Android.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
	</ItemGroup>

	<!-- Both iOS and Mac Catalyst -->
	<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-ios')) != true AND $(TargetFramework.StartsWith('net7.0-maccatalyst')) != true">
		<Compile Remove="**\**\*.MaciOS.cs" />
		<None Include="**\**\*.MaciOS.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
	</ItemGroup>

	<!-- iOS -->
	<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-ios')) != true">
		<Compile Remove="**\**\*.iOS.cs" />
		<None Include="**\**\*.iOS.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
	</ItemGroup>

	<!-- Mac Catalyst -->
	<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-maccatalyst')) != true">
		<Compile Remove="**\**\*.MacCatalyst.cs" />
		<None Include="**\**\*.MacCatalyst.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
	</ItemGroup>

	<!-- Windows -->
	<ItemGroup Condition="$(TargetFramework.Contains('-windows')) != true">
		<Compile Remove="**\*.Windows.cs" />
		<None Include="**\*.Windows.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
	</ItemGroup>

	<ItemGroup>
		<!-- App Icon -->
		<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

		<!-- Splash Screen -->
		<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
  
		<!-- Images -->
		<MauiImage Include="Resources\Images\*" />
    <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

    <!-- Custom Fonts -->
		<MauiFont Include="Resources\Fonts\*" />

		<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
		<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
	</ItemGroup>

	<ItemGroup>
	  <None Remove="Resources\Fonts\ChaoZiSheJiYingJianFan.ttf" />
	  <None Remove="Resources\Fonts\YeZiGongChangChuanQiuShaXingKai.ttf" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Acr.UserDialogs" Version="8.0.1" />
		<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
	</ItemGroup>

	<ItemGroup>
	  <Compile Update="Views\AboutPage.xaml.cs">
	    <DependentUpon>AboutPage.xaml</DependentUpon>
	  </Compile>
	</ItemGroup>

	<ItemGroup>
	  <MauiXaml Update="Views\AboutPage.xaml">
	    <Generator>MSBuild:Compile</Generator>
	  </MauiXaml>
	</ItemGroup>

	<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">
	  <PackageReference Include="CommunityToolkit.Maui">
	    <Version>5.1.0</Version>
	  </PackageReference>
	</ItemGroup>

</Project>
