summaryrefslogtreecommitdiff
path: root/tests/src/dir.props
blob: cb976cc081f7defde51b0f9ce7dcc6a0e513fd09 (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
<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>
  </PropertyGroup>

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

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

  <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>

  <!-- Set default ZapRequire level (used only when CrossGen is enabled) -->
  <PropertyGroup>
    <ZapRequire Condition="'$(ZapRequire)' == ''">2</ZapRequire>
  </PropertyGroup>
  
  <PropertyGroup>
    <ProjectJson>$(SourceDir)Common\test_dependencies\project.json</ProjectJson>
    <ProjectLockJson>$(SourceDir)Common\test_dependencies\project.lock.json</ProjectLockJson>

    <!-- Specify the target framework of the common test dependency project.json. -->
    <NuGetTargetMoniker>.NETCoreApp,Version=v2.0</NuGetTargetMoniker>
  </PropertyGroup>
</Project>