forked from dotnet/winforms
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Directory.Build.targets
39 lines (33 loc) · 1.9 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="$(RepositoryEngineeringDir)CodeStyle.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(RepositoryEngineeringDir)packageContent.targets" />
<Import Project="$(RepositoryEngineeringDir)versioning.targets" />
<!-- to prevent using MS.NC.Platforms from SDK, which is lagging behind the version that WinForms gets from the CoreFx packages -->
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Platforms" Version="$(MicrosoftNETCorePlatformsPackageVersion)" />
</ItemGroup>
<!-- Set code coverage properties that reference properties not available in Directory.Build.props -->
<PropertyGroup Condition="'$(Coverage)' == 'true'">
<CoverletOutput>$(TargetDir)coverage\$(MSBuildProjectName).coverage</CoverletOutput>
</PropertyGroup>
<Target Name="InstrumentModulesNoBuildBeforeTest" Condition="'$(CollectCoverage)' == 'true'" BeforeTargets="RunTests">
<CallTarget Targets="InstrumentModulesAfterBuild" />
</Target>
<Target Name="GenerateCoverageResultAfterTest" Condition="'$(CollectCoverage)' == 'true'" AfterTargets="RunTests">
<CallTarget Targets="GenerateCoverageResult" />
</Target>
<ItemGroup>
<!-- Set TargetingPackVersion -->
<FrameworkReference Update="Microsoft.NETCore.App"
Condition=" '$(MicrosoftNETCoreAppPackageVersion)'!='' And $(TargetFramework.StartsWith('netcoreapp3.')) ">
<TargetingPackVersion>$(MicrosoftNETCoreAppPackageVersion)</TargetingPackVersion>
</FrameworkReference>
</ItemGroup>
<PropertyGroup>
<!-- If TargetFramework is not netcoreapp3.x, then reset RuntimeFrameworkVersion -->
<!-- TODO: /p:EnableInstallDotNetCoreRuntimes=true to endable this for tests once dotnet/arcade#2343 is in -->
<RuntimeFrameworkVersion Condition="!$(TargetFramework.StartsWith('netcoreapp3.'))" />
</PropertyGroup>
</Project>