xamarin-macios/dotnet/targets/Microsoft.Sdk.Eol.targets

49 строки
2.0 KiB
XML

<!--
***********************************************************************************************
Microsoft.Sdk.Eol.targets
Imported only when using a .NET version that has reached EOL, contains settings to force the error:
error NETSDK1202: The workload 'ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.
Things to note:
* $(WarningsAsErrors) includes NETSDK1202, so that the build stops and we don't run into other (and more confusing) errors.
* Force $(TargetPlatformVersion) to just be 1.0, to make it past early error messages
* _ClearMissingWorkloads prevents undesired extra error messages
***********************************************************************************************
-->
<Project InitialTargets="_ClearMissingWorkloads">
<PropertyGroup>
<!-- This is required to let .NET know that our workload handles the current target framework -->
<TargetPlatformSupported>true</TargetPlatformSupported>
<!-- Force NETSDK1202 to be an error (otherwise we run into a less descriptive later on) -->
<WarningsAsErrors>$(WarningsAsErrors);NETSDK1202</WarningsAsErrors>
<!--
Fixes this error:
error NU1012: Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-ios
The actual version number doesn't seem to matter, so we're just staying at 1.0 forever.
-->
<TargetPlatformVersion>1.0</TargetPlatformVersion>
</PropertyGroup>
<ItemGroup>
<EolWorkload Include="$(TargetFramework)" Url="https://aka.ms/maui-support-policy" />
</ItemGroup>
<Target Name="_ClearMissingWorkloads">
<!--
Prevents the error:
Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147:
To build this project, the following workloads must be installed: wasm-tools-net6
To install these workloads, run the following command: dotnet workload restore
-->
<ItemGroup>
<MissingWorkloadPack Remove="@(MissingWorkloadPack)" />
</ItemGroup>
</Target>
</Project>