Uno.Samples/UI/PhotoViewer/PhotoViewer.Mobile/PhotoViewer.Mobile.csproj

75 строки
4.3 KiB
XML

<Project Sdk="Uno.Sdk">
<PropertyGroup>
<TargetFrameworks>$(DotNetVersion)-android;$(DotNetVersion)-ios;$(DotNetVersion)-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="'$(OverrideTargetFramework)'!=''">$(OverrideTargetFramework)</TargetFrameworks>
<SingleProject>true</SingleProject>
<OutputType>Exe</OutputType>
<!-- Display name -->
<ApplicationTitle>PhotoViewer</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>platform.uno.PhotoViewer</ApplicationId>
<ApplicationIdGuid>66D78F82-4804-4697-ABCB-0088D91A56C4</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<!-- Debugger workaround https://github.com/dotnet/maui-samples/blob/8aa6b8780b12e97b157514c3bdc54bb4a13001cd/HelloMacCatalyst/HelloMacCatalyst.csproj#L7 -->
<!-- <MtouchExtraArgs Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">$(MtouchExtraArgs) -setenv:MONO_THREADS_SUSPEND=preemptive</MtouchExtraArgs> -->
<!-- Required for C# Hot Reload -->
<UseInterpreter Condition="'$(Configuration)' == 'Debug' and $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'maccatalyst'">True</UseInterpreter>
<IsUnoHead>true</IsUnoHead>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Uno.WinUI" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="Uno.Extensions.Logging.OSLog" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" />
<PackageReference Include="Uno.WinUI.DevServer" Condition="'$(Configuration)'=='Debug'" />
</ItemGroup>
<Choose>
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<ItemGroup>
<PackageReference Include="Xamarin.Google.Android.Material" />
<PackageReference Include="Uno.UniversalImageLoader" />
</ItemGroup>
</When>
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<PropertyGroup>
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<!-- See https://github.com/unoplatform/uno/issues/9430 for more details. -->
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<!-- https://github.com/xamarin/xamarin-macios/issues/14812 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>
</PropertyGroup>
</When>
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<PropertyGroup>
<!-- Configure the GC -->
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<!-- Required for unknown crash as of .NET 6 Mobile Preview 13 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
<!-- Full globalization is required for Uno -->
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<!-- https://github.com/xamarin/xamarin-macios/issues/14812 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>
</PropertyGroup>
</When>
</Choose>
<ItemGroup>
<ProjectReference Include="..\PhotoViewer\PhotoViewer.csproj" />
</ItemGroup>
<Import Project="..\PhotoViewer.Shared\base.props" />
<Target Name="ValidateOverrides" BeforeTargets="Restore;_CheckForUnsupportedTargetFramework" Condition="'$(OverrideTargetFramework)' != ''">
<Error
Text="OverrideTargetFramework set to '$(OverrideTargetFramework)' is missing valid target. Set OverrideTargetFramework to one of the TargetFrameworks for this project or skip building this project (eg unload the project in Visual Studio)"
Condition="$(OverrideTargetFramework.Contains('windows10')) or !$(OverrideTargetFramework.Contains('-'))" />
</Target>
</Project>