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

	<PropertyGroup>
		<TargetFrameworks>$(TargetFrameworks);net9.0-android</TargetFrameworks>
		<TargetFrameworks>$(TargetFrameworks);net9.0-ios</TargetFrameworks>
		<!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</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);net8.0-tizen</TargetFrameworks> -->

		<!-- Note for MacCatalyst:
            The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
            When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
            The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
            either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
		<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

		<OutputType>Exe</OutputType>
		<RootNamespace>salesbook.Maui</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>
		<EnableDefaultCssItems>false</EnableDefaultCssItems>
		<Nullable>enable</Nullable>

		<!-- Display name -->
		<ApplicationTitle>salesbook</ApplicationTitle>

		<!-- App Identifier -->
		<ApplicationId>it.integry.salesbook</ApplicationId>

		<!-- Versions -->
		<ApplicationDisplayVersion>1.1.0</ApplicationDisplayVersion>
		<ApplicationVersion>5</ApplicationVersion>

		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
		<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
			14.0
		</SupportedOSPlatformVersion>-->
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
		<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>-->
		<!--<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>-->
		<!--slower build, faster runtime in DEBUG-->
		<!-- <_MauiForceXamlCForDebug Condition="'$(Configuration)' == 'Debug'">true</_MauiForceXamlCForDebug> -->
	</PropertyGroup>

	<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
		<DefineConstants>$(DefineConstants);PLATFORM</DefineConstants>
		<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>
		<TargetPlatformVersion>35</TargetPlatformVersion>

		<!--<EmbedAssembliesIntoApk Condition="'$(Configuration)' == 'Debug'">true</EmbedAssembliesIntoApk>
		<AndroidPackageFormats Condition="'$(Configuration)' == 'Release'">aab</AndroidPackageFormats>
		<AndroidLinkTool>r8</AndroidLinkTool>
		<AndroidLinkTool>proguard</AndroidLinkTool>-->

	</PropertyGroup>

	<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android' AND '$(Configuration)' == 'Debug'">

		<!--these help speed up android builds-->
		<!--
		<RuntimeIdentifier>android-arm64</RuntimeIdentifier>
		<AndroidEnableProfiler>true</AndroidEnableProfiler>
		<AndroidPackageFormat>aab</AndroidPackageFormat>
		-->
	</PropertyGroup>

	<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' AND '$(Configuration)' == 'Debug'">
		<!--forces the simulator to pickup entitlements-->
		<EnableCodeSigning>true</EnableCodeSigning>
		<CodesignRequireProvisioningProfile>true</CodesignRequireProvisioningProfile>
		<DisableCodesignVerification>true</DisableCodesignVerification>
	</PropertyGroup>

	<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
		<SupportedOSPlatformVersion>14.2</SupportedOSPlatformVersion>
		<DefineConstants>$(DefineConstants);APPLE;PLATFORM</DefineConstants>
	</PropertyGroup>

	<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
		<CodesignKey>Apple Distribution: Integry S.r.l. (UNP26J4R89)</CodesignKey>
		<CodesignProvision></CodesignProvision>
		<ProvisioningType>manual</ProvisioningType>
	</PropertyGroup>

	<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
		<!--
		<BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" />

		<CustomEntitlements Include="keychain-access-groups" Type="StringArray" Value="%24(AppIdentifierPrefix)$(ApplicationId)" Visible="false" />
		<CustomEntitlements Include="aps-environment" Type="string" Value="development" Condition="'$(Configuration)' == 'Debug'" Visible="false" />
		<CustomEntitlements Include="aps-environment" Type="string" Value="production" Condition="'$(Configuration)' == 'Release'" Visible="false" />
		-->
	</ItemGroup>

	<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-android'">
		<GoogleServicesJson Include="google-services.json">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</GoogleServicesJson>
	</ItemGroup>

	<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-ios'">
		<BundleResource Include="GoogleService-Info.plist" />
	</ItemGroup>

	<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
		<!-- Android App Icon -->
		<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" ForegroundScale="0.65" />
	</ItemGroup>

	<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
		<!-- ios App Icon -->
		<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" />
	</ItemGroup>

	<ItemGroup>
		<!-- Splash Screen -->
		<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#dff2ff" 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>
		<PackageReference Include="CommunityToolkit.Maui" Version="12.0.0" />
		<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
		<PackageReference Include="IntegryApiClient.MAUI" Version="1.1.6" />
		<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
		<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.81" />
		<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.81" />
		<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.81" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.6" />
		<PackageReference Include="Sentry.Maui" Version="5.11.2" />
		<PackageReference Include="Shiny.Notifications" Version="3.3.4" />
		<PackageReference Include="Shiny.Push" Version="3.3.4" />
		<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
	</ItemGroup>

	<ItemGroup>
		<ProjectReference Include="..\salesbook.Shared\salesbook.Shared.csproj" />
	</ItemGroup>

</Project>