2023-01-10 04:57:58 +03:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2018-12-02 03:25:55 +03:00
|
|
|
<Project>
|
|
|
|
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
|
2019-09-12 20:07:08 +03:00
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<PackageVersion Condition=" '$(PackageVersion)' == '' ">$(Version)</PackageVersion>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
2024-07-27 01:07:57 +03:00
|
|
|
<PropertyGroup>
|
|
|
|
<!--
|
|
|
|
Disable nullable warnings when targeting anything other than our supported .NET core version(s).
|
|
|
|
This condition will be evaluated multiple times in multi-targeted projects hence need to be careful
|
|
|
|
to only set in the inner builds, not the outer build where only $(TargetFrameworks) is defined.
|
|
|
|
We still check $(TargetFrameworks) for empty though, because for single-targeted builds we want to
|
|
|
|
allow nullable warnings regardless of target framework.
|
|
|
|
-->
|
|
|
|
<DisableNullableWarnings Condition="'$(DisableNullableWarnings)' == '' AND '$(TargetFrameworks)' != '' AND '$(TargetFramework)' != '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp'">true</DisableNullableWarnings>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<PropertyGroup Condition="'$(DisableNullableWarnings)' == 'true'">
|
|
|
|
<NoWarn>$(NoWarn);Nullable</NoWarn>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
2019-09-24 01:11:16 +03:00
|
|
|
<Import Project="eng\targets\Packaging.targets" />
|
2019-02-22 21:24:51 +03:00
|
|
|
|
|
|
|
<!-- Workaround https://github.com/dotnet/cli/issues/10528 -->
|
|
|
|
<PropertyGroup>
|
|
|
|
<BundledNETCorePlatformsPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</BundledNETCorePlatformsPackageVersion>
|
|
|
|
</PropertyGroup>
|
2019-07-03 05:02:36 +03:00
|
|
|
|
2021-02-05 20:30:30 +03:00
|
|
|
<!-- Global Analyzer Config -->
|
|
|
|
<ItemGroup>
|
|
|
|
<!-- Always include Common.globalconfig -->
|
|
|
|
<EditorConfigFiles Include="$(RepositoryEngineeringDir)config\globalconfigs\Common.globalconfig" />
|
|
|
|
<!-- Include Shipping.globalconfig for shipping projects -->
|
|
|
|
<EditorConfigFiles Condition="'$(IsShipping)' == 'true'" Include="$(RepositoryEngineeringDir)config\globalconfigs\Shipping.globalconfig" />
|
2021-02-12 00:48:55 +03:00
|
|
|
<!-- Include NonShipping.globalconfig for non-shipping projects, except for API shims -->
|
|
|
|
<EditorConfigFiles Condition="'$(IsShipping)' != 'true' AND '$(IsApiShim)' != 'true'" Include="$(RepositoryEngineeringDir)config\globalconfigs\NonShipping.globalconfig" />
|
2021-02-08 19:36:22 +03:00
|
|
|
<!-- Include ApiShim.globalconfig for API shim projects -->
|
|
|
|
<EditorConfigFiles Condition="'$(IsApiShim)' == 'true'" Include="$(RepositoryEngineeringDir)config\globalconfigs\ApiShim.globalconfig" />
|
2021-02-05 20:30:30 +03:00
|
|
|
</ItemGroup>
|
|
|
|
|
2021-04-22 00:23:29 +03:00
|
|
|
<!--
|
|
|
|
Where necessary, do not pretend we support iOS or Android. This file is imported after project
|
|
|
|
has a chance to set $(RemoveDevicePlatformSupport) and long after @(SupportedPlatforms) is initialized.
|
|
|
|
-->
|
|
|
|
<ItemGroup Condition=" '$(RemoveDevicePlatformSupport)' == 'true' ">
|
|
|
|
<SupportedPlatform Remove="Android" />
|
|
|
|
<SupportedPlatform Remove="iOS" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2024-07-02 22:51:14 +03:00
|
|
|
<!--
|
|
|
|
We provide a simple mechanism for including NetFx-only files.
|
|
|
|
If a C# file should only be compiled under NetFx, it can be named with a ".NetFx.cs" extension.
|
|
|
|
Or, the file can be included in a folder called "NetFx" or has a name that ends in "_NetFx".
|
|
|
|
-->
|
|
|
|
<ItemGroup Condition="'$(TargetFramework)' != '$(DefaultNetFxTargetFramework)'">
|
|
|
|
<Compile Remove="**\*.NetFx.cs" />
|
|
|
|
<Compile Remove="**\NetFx\**\*.*" />
|
|
|
|
<Compile Remove="**\*_NetFx\**\*.*" />
|
|
|
|
|
|
|
|
<None Include="**\*.NetFx.cs" />
|
|
|
|
<None Include="**\NetFx\**\*.*" />
|
|
|
|
<None Include="**\*_NetFx\**\*.*" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
We provide a simple mechanism for including NetCore-only files.
|
|
|
|
If a C# file should only be compiled under NetCore, it can be named with a ".NetCore.cs" extension.
|
|
|
|
Or, the file can be included in a folder called "NetCore" or has a name that ends in "_NetCore".
|
|
|
|
-->
|
2024-07-17 04:06:54 +03:00
|
|
|
<ItemGroup Condition="'$(TargetFramework)' != '$(DefaultNetCoreTargetFramework)' AND '$(TargetFramework)' != '$(NetCurrent)' AND '$(TargetFramework)' != '$(NetPrevious)'">
|
2024-07-02 22:51:14 +03:00
|
|
|
<Compile Remove="**\*.NetCore.cs" />
|
|
|
|
<Compile Remove="**\NetCore\**\*.*" />
|
|
|
|
<Compile Remove="**\*_NetCore\**\*.*" />
|
|
|
|
|
|
|
|
<None Include="**\*.NetCore.cs" />
|
|
|
|
<None Include="**\NetCore\**\*.*" />
|
|
|
|
<None Include="**\*_NetCore\**\*.*" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2024-04-04 23:08:17 +03:00
|
|
|
<!--
|
|
|
|
Warn consumers until the underlying issue is fixed
|
|
|
|
https://github.com/dotnet/roslyn/issues/72657
|
|
|
|
-->
|
|
|
|
<Target Name="CheckNuPkgEnvEndsWithSlash"
|
|
|
|
AfterTargets="AfterCompile">
|
2024-04-05 17:47:09 +03:00
|
|
|
<Warning Condition="'$(NUGET_PACKAGES)' != '' AND !$(NUGET_PACKAGES.EndsWith($([System.String]::new($([System.IO.Path]::DirectorySeparatorChar)))))"
|
2024-04-05 00:24:48 +03:00
|
|
|
Text="NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues: $(NUGET_PACKAGES)" />
|
2024-04-04 23:08:17 +03:00
|
|
|
</Target>
|
|
|
|
|
2020-11-05 04:19:41 +03:00
|
|
|
<Target Name="GetCustomAssemblyAttributes"
|
|
|
|
BeforeTargets="GetAssemblyAttributes"
|
|
|
|
Condition=" '$(MSBuildProjectExtension)' == '.csproj' "
|
|
|
|
DependsOnTargets="InitializeSourceControlInformation">
|
|
|
|
<ItemGroup>
|
|
|
|
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(Serviceable)' == 'true'">
|
|
|
|
<_Parameter1>Serviceable</_Parameter1>
|
|
|
|
<_Parameter2>True</_Parameter2>
|
|
|
|
</AssemblyAttribute>
|
|
|
|
</ItemGroup>
|
|
|
|
</Target>
|
2024-07-03 01:00:34 +03:00
|
|
|
|
|
|
|
<!-- RestrictedInternalsVisibleTo -->
|
|
|
|
<ItemDefinitionGroup>
|
|
|
|
<RestrictedInternalsVisibleTo>
|
|
|
|
<Visible>false</Visible>
|
|
|
|
</RestrictedInternalsVisibleTo>
|
|
|
|
</ItemDefinitionGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<InternalsVisibleTo Include="@(RestrictedInternalsVisibleTo)" Key="%(Key)" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Target Name="PrepareGenerateRestrictedInternalsVisibleTo"
|
|
|
|
BeforeTargets="PrepareGenerateInternalsVisibleToFile"
|
|
|
|
Condition="'@(RestrictedInternalsVisibleTo)' != ''">
|
|
|
|
<ItemGroup>
|
|
|
|
<_InternalsVisibleToAttribute Include="System.Runtime.CompilerServices.RestrictedInternalsVisibleToAttribute">
|
|
|
|
<_Parameter1>%(RestrictedInternalsVisibleTo.Identity)</_Parameter1>
|
|
|
|
<_Parameter2 Condition="'%(RestrictedInternalsVisibleTo.Namespace)' != ''">%(RestrictedInternalsVisibleTo.Namespace)</_Parameter2>
|
|
|
|
</_InternalsVisibleToAttribute>
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Warning Condition="'%(RestrictedInternalsVisibleTo.Partner)' == '' and '%(RestrictedInternalsVisibleTo.Namespace)' == ''" Text="RestrictedInternalsVisibleTo items must specify the 'Partner' or 'Namespace' attribute. Target assembly: %(Identity)" />
|
|
|
|
</Target>
|
2019-05-29 23:06:38 +03:00
|
|
|
</Project>
|