summaryrefslogtreecommitdiff
path: root/tests/src/dir.props
blob: abdb7cc0f57415d1932ae7bd0c489a12b3a0c97a (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="dir.common.props" />

  <!-- Disable some standard properties for building our projects -->
  <PropertyGroup>
    <NoStdLib>true</NoStdLib>
    <NoExplicitReferenceToStdLib>true</NoExplicitReferenceToStdLib>
    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
    <!-- Disable some C# warnings for the tests. -->
    <NoWarn>78,162,164,168,169,219,251,252,414,429,642,649,652,675,1691,1717,1718,3001,3002,3003,3005,3008</NoWarn>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <SkipSigning Condition="'$(CrossGen)' == 'true'">true</SkipSigning>
    <!-- Set the project.json directory for generated TestWrappers. -->
    <TestWrappersPackagesConfigFileDirectory>$(MSBuildThisFileDirectory)TestWrappersConfig\</TestWrappersPackagesConfigFileDirectory>
    <AssemblyKey>Test</AssemblyKey>
  </PropertyGroup>

  <!-- Expose the target OS in a more convenient fashion -->
  <PropertyGroup>
    <OSGroup Condition="'$(OSGroup)'=='' and $(OSPlatformConfig.StartsWith('Windows'))">Windows_NT</OSGroup>
    <OSGroup Condition="'$(OSGroup)'=='' and $(OSPlatformConfig.StartsWith('Linux'))">Linux</OSGroup>
    <OSGroup Condition="'$(OSGroup)'=='' and $(OSPlatformConfig.StartsWith('OSX'))">OSX</OSGroup>
    <OSGroup Condition="'$(OSGroup)'=='' and $(OSPlatformConfig.StartsWith('FreeBSD'))">FreeBSD</OSGroup>
    <OSGroup Condition="'$(OSGroup)'==''">AnyOS</OSGroup>
  </PropertyGroup>

  <!-- Setup properties per OSGroup -->
  <Choose>
    <When Condition="'$(OSGroup)'=='AnyOS'">
      <PropertyGroup>
      </PropertyGroup>
    </When>
    <When Condition="'$(OSGroup)'=='Windows_NT'">
      <PropertyGroup>
        <TargetsWindows>true</TargetsWindows>
        <TestNugetRuntimeId>win-$(__BuildArch)</TestNugetRuntimeId>
      </PropertyGroup>
    </When>
    <When Condition="'$(OSGroup)'=='Linux'">
      <PropertyGroup>
        <TargetsUnix>true</TargetsUnix>
        <TargetsLinux>true</TargetsLinux>
        <TestNugetRuntimeId>ubuntu.14.04-$(__BuildArch)</TestNugetRuntimeId>
      </PropertyGroup>
    </When>
    <When Condition="'$(OSGroup)'=='OSX'">
      <PropertyGroup>
        <TargetsUnix>true</TargetsUnix>
        <TargetsOSX>true</TargetsOSX>
        <TestNugetRuntimeId>osx.10.12-$(__BuildArch)</TestNugetRuntimeId>
      </PropertyGroup>
    </When>
    <When Condition="'$(OSGroup)'=='FreeBSD'">
      <PropertyGroup>
        <TargetsUnix>true</TargetsUnix>
        <TargetsFreeBSD>true</TargetsFreeBSD>
        <TestNugetRuntimeId>ubuntu.14.04-$(__BuildArch)</TestNugetRuntimeId>
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup>
        <ConfigurationErrorMsg>$(ConfigurationErrorMsg);Unknown OSGroup [$(OSGroup)] specificed in your project.</ConfigurationErrorMsg>
      </PropertyGroup>
    </Otherwise>
  </Choose>

  <PropertyGroup>
    <TargetRid Condition="'$(__RuntimeId)' != ''">$(__RuntimeId)</TargetRid>
    <TargetRid Condition="'$(__RuntimeId)' == ''">$(TestNugetRuntimeId)</TargetRid>
  </PropertyGroup>

  <PropertyGroup>
    <TargetsUnknownUnix Condition="'$(TargetsUnix)' == 'true' AND '$(OSGroup)' != 'FreeBSD' AND '$(OSGroup)' != 'Linux' AND '$(OSGroup)' != 'OSX'">true</TargetsUnknownUnix>
    <Language Condition="'$(Language)' == '' and  '$(MSBuildProjectExtension)' == '.csproj'">C#</Language>
    <Language Condition="'$(Language)' == '' and  '$(MSBuildProjectExtension)' == '.ilproj'">IL</Language>
  </PropertyGroup>

  <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
    <!-- RAR thinks all EXEs require binding redirects.  That's not the case for CoreCLR -->
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>

  <!-- Don't reference the mscorlib facade -->
  <PropertyGroup>
    <ExcludeMscorlibFacade>true</ExcludeMscorlibFacade>
  </PropertyGroup>

  <!-- Set default ZapRequire level (used only when CrossGen is enabled) -->
  <PropertyGroup>
    <ZapRequire Condition="'$(ZapRequire)' == ''">2</ZapRequire>
  </PropertyGroup>
  
  <PropertyGroup>
    <RestoreOutputPath>$(MSBuildProjectDirectory)\obj</RestoreOutputPath>

    <!-- Specify the target framework of the common test dependency project.json. -->
    <NuGetTargetMoniker>.NETCoreApp,Version=v2.2</NuGetTargetMoniker>
    <NuGetTargetMonikerShort>netcoreapp2.2</NuGetTargetMonikerShort>
    <PrereleaseResolveNuGetPackages>true</PrereleaseResolveNuGetPackages>
  </PropertyGroup>

</Project>