Remove dependency on a custom task to detect when compiling on macOS (#1987)
MSBuild.IsOSPlatform is new to MSBuild 15.3 and can be used to determine when we are building on macOS.
This commit is contained in:
parent
659fa967a1
commit
d3fb5e76f1
|
|
@ -7,6 +7,7 @@
|
|||
<RootNamespace>Microsoft.AspNetCore.Server.Kestrel.FunctionalTests</RootNamespace>
|
||||
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(DefineConstants);MACOS</DefineConstants>
|
||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||
|
||||
<!--
|
||||
|
|
@ -42,15 +43,4 @@
|
|||
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="DefinePlatformConstants" BeforeTargets="CoreCompile">
|
||||
<Sdk_GetOSPlatform>
|
||||
<!-- Returns {Linux, macOS, Windows} -->
|
||||
<Output TaskParameter="PlatformName" PropertyName="OSPlatform" />
|
||||
</Sdk_GetOSPlatform>
|
||||
|
||||
<PropertyGroup>
|
||||
<DefineConstants>$(DefineConstants);$(OSPlatform.ToUpperInvariant())</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue