summaryrefslogtreecommitdiff
path: root/tests/override.targets
blob: a713489fc36ce4846d730f84bf4400179e28fa58 (plain)
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!--
    Overrides for all other targets (including build tools) can go in this file.
  -->

  <!-- Override the AddDesignTimeFacadeReferences target to add the ability to reference System.Private.CoreLib.
       Some tests use functionality not available in the portable reference assemblies.
       For portability reasons it's generally a good idea to reference the facades instead of the
       raw implementation assemblies.  However, these tests are useful. -->
  <Target Name="AddDesignTimeFacadeReferences"
      Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true'"
      BeforeTargets="ResolveReferences"
      DependsOnTargets="GetReferenceAssemblyPaths"
  >

    <ItemGroup>
      <ReferencePath Include="$(ProjectDir)\..\bin\Product\$(BuildOS).$(BuildArch).$(BuildType)\System.Private.CoreLib.dll" />
    </ItemGroup>
  </Target>

  <!-- Remove package references when referencing System.Private.CoreLib from SDK style project --> 
  <Target Name="CleanResolvedCompileFileDefinitions"  AfterTargets="ResolvePackageAssets" Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true' and '$(UsingMicrosoftNETSdk)' == 'true'" >
    <ItemGroup>
      <ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)" />
    </ItemGroup>
  </Target>
  
  <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
    <!--
      Allow this project to setup the default target frameworks. Note this depends on the targeting packs that VS
      installs to resolve mscorlib and System. That should be fixed in the future.
      -->
    <_TargetFrameworkDirectories></_TargetFrameworkDirectories>
    <_FullFrameworkReferenceAssemblyPaths></_FullFrameworkReferenceAssemblyPaths>
  </PropertyGroup>
</Project>