summaryrefslogtreecommitdiff
path: root/tests/dir.props
blob: 5e31468e4cea3f4089c45c139c2974a84031f504 (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="dir.sdkbuild.props" Condition="'$(UsingMicrosoftNETSdk)' == 'true'"  />

  <PropertyGroup>
    <LangVersion>8.0</LangVersion>
    <UseSharedCompilation>true</UseSharedCompilation>
  </PropertyGroup>

    <!--
     Switching to the .NET Core version of the BuildTools tasks seems to break numerous scenarios, such as VS intellisense and resource designer
     as well as running the build on mono. Until we can get these sorted out we will continue using the .NET 4.5 version of the tasks.
     
     It also breaks building any C# project with dotnet.exe on Windows. The windows version of BuildTools doesn't appear to download the .NET Core
     Roslyn NuGet package which has a Csc task supporting OverrideToolHost, but the default BuildTools CSharpCore targets file does specify 
     OverrideToolHost. The result is that building anything in C# when RunningOnCore=true on Windows fails in Csc task with a parameter not supported error.
     
     Given that the Windows Core scenario is pretty broken on BuildTools it is currently configured not to use BuildTools at all. This allows ad-hoc usage
     of the dotnet tool to work in the test tree as a developer convenience. Its not clear that we should invest in improving BuildTools Core support and
     instead we could just move to using dotnet officially.
     -->  
  <PropertyGroup>  
    <RunningOnCore>false</RunningOnCore>
    <RunningOnCore Condition="'$(MSBuildRuntimeType)' == 'core'">true</RunningOnCore>
    <BuildToolsTargetsDesktop>false</BuildToolsTargetsDesktop>
    <BuildToolsTargetsDesktop Condition="'$(RunningOnCore)' != 'true'">true</BuildToolsTargetsDesktop>
    <BuildToolsTargets45>$(BuildToolsTargetsDesktop)</BuildToolsTargets45>
    <RunningOnUnix Condition="('$(RunningOnUnix)' == '') And ('$(MSBuildRuntimeType)' == 'Core') And ('$(OS)'!='Windows_NT')">true</RunningOnUnix>
    <UseBuildTools>true</UseBuildTools>
  </PropertyGroup>  

  <!-- Common repo directories -->
  <PropertyGroup>
    <CopyNuGetImplementations Condition="'$(CopyNuGetImplementations)'==''">false</CopyNuGetImplementations>
    <ProjectDir>$(MSBuildThisFileDirectory)</ProjectDir>
    <SourceDir>$(ProjectDir)src\</SourceDir>
    <PackagesDir>$(ProjectDir)..\.packages\</PackagesDir>
    <ToolsDir Condition="'$(ToolsDir)'==''">$(ProjectDir)..\Tools\</ToolsDir>
    <DotnetCliPath Condition="'$(DotnetCliPath)'==''">$(ProjectDir)..\.dotnet\</DotnetCliPath>
    <BuildToolsTaskDir Condition="'$(BuildToolsTargets45)' == 'true'">$(ToolsDir)net46\</BuildToolsTaskDir>
    <OverrideToolHost Condition="'$(OS)' != 'Windows_NT'">$(DotnetCliPath)dotnet</OverrideToolHost>
    <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
         the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
    <_TargetFrameworkDirectories Condition="'$(BuildToolsTargetsDesktop)' != 'true'">$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
    <_FullFrameworkReferenceAssemblyPaths Condition="'$(BuildToolsTargetsDesktop)' != 'true'">$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
    <ExcludeSigningImport>true</ExcludeSigningImport>
  </PropertyGroup>

  <!-- Common properties -->
  <PropertyGroup>
    <RootBinDir>$(__RootBinDir)\</RootBinDir>
    <RootBinDir Condition="'$(__RootBinDir)'==''">$(ProjectDir)..\bin\</RootBinDir>

    <BinDir>$(__BinDir)\</BinDir>
    <BinDir Condition="'$(__BinDir)'==''">$(RootBinDir)Product\$(BuildOS).$(BuildArch).$(BuildType)\</BinDir>

    <TestWorkingDir Condition="'$(__TestWorkingDir)'==''">$(RootBinDir)tests\$(BuildOS).$(BuildArch).$(BuildType)\</TestWorkingDir>

    <AltJitArch>$(__AltJitArch)</AltJitArch>
  </PropertyGroup>

<!-- Default Test platform to deploy the netstandard compiled tests to -->
  <PropertyGroup>
    <!-- we default TestTFM and FilterToTestTFM to netcoreapp1.0 if they are not explicity defined -->
    <DefaultTestTFM Condition="'$(DefaultTestTFM)'==''">netcoreapp1.0</DefaultTestTFM>
    <TestTFM Condition="'$(TestTFM)'==''">$(DefaultTestTFM)</TestTFM>
    <FilterToTestTFM Condition="'$(FilterToTestTFM)'==''">$(DefaultTestTFM)</FilterToTestTFM>
  </PropertyGroup>

  <!-- Output paths -->
  <PropertyGroup>
    <!-- When not using the SKD, we want to set this property here so
         that BuildVersionFile gets the correct value. -->
    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == '' Or '$(UsingMicrosoftNETSdk)' != 'true'">$(RootBinDir)obj\</BaseIntermediateOutputPath>
    <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(BaseIntermediateOutputPath)\$(BuildOS).$(BuildArch).$(BuildType)</IntermediateOutputPath>
    <OutputPath Condition="'$(OutputPath)' == ''">$(BaseIntermediateOutputPath)\$(BuildOS).$(BuildArch).$(BuildType)</OutputPath>
  </PropertyGroup>

    <!-- Targeting Package paths -->
  <PropertyGroup>
    <TargetingPackPath Condition="'$(BaseTargetingPackPath)' == ''">$(RootBinDir)TargetingPack\</TargetingPackPath>
  </PropertyGroup>

  <!-- Import Build tools common props file where repo-independent properties are found -->
  <Import Condition="Exists('$(ToolsDir)Build.Common.props') And '$(UseBuildTools)'=='true'" Project="$(ToolsDir)Build.Common.props" />

  <!-- Provides properties for dependency versions and configures dependency verification/auto-upgrade. -->
  <Import Project="$(ProjectDir)..\dependencies.props" />

  <!-- Add test-specific package restore sources. -->
  <PropertyGroup>
    <RestoreSources Condition="'$(DotNetBuildOffline)' != 'true'">
      https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json;
      $(RestoreSources)
    </RestoreSources>
    <RestoreSources Condition="'$(IntermediateAzureFeed)' != ''">
      $(IntermediateAzureFeed);
      $(RestoreSources)
    </RestoreSources>
  </PropertyGroup>

  <!-- Use Roslyn Compilers to build -->
  <Import Project="$(RoslynPropsFile)" Condition="Exists('$(RoslynPropsFile)')" />

  <PropertyGroup Condition="'$(BuildAllProjects)'=='true'">
    <!-- When we do a traversal build we get all packages up front, don't restore them again -->
    <RestorePackages>false</RestorePackages>
  </PropertyGroup>

  <PropertyGroup Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'">
    <BuildVersionFile>$(BaseIntermediateOutputPath)BuildVersion-$(OfficialBuildId).props</BuildVersionFile>
  </PropertyGroup>

  <!-- If we want to overwrite the desired CoreCLR package version, we need to get the new version from the generated props file in bin/obj -->
  <Import Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" Project="$(BuildVersionFile)" />

  <PropertyGroup Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'">
    <VersionToRestore Condition="'$(StableVersion)' != ''">$(StableVersion)</VersionToRestore>
    <VersionToRestore Condition="'$(VersionToRestore)' == ''">$(PackageVersion)-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)</VersionToRestore>
    <PackageVersionArg>/p:MicrosoftNETCoreRuntimeCoreCLRPackageVersion=$(VersionToRestore)</PackageVersionArg>
  </PropertyGroup>

  <!-- Which tests shall we build? Default: Priority 0 tests.
    At the command-line, the user can specify /p:CLRTestPriorityToBuild=666 (for example), and
    all tests with CLRTestPriority 666,..., 1 AND 0 will build. 
    
    Consequently, specifying CLRTestPriorityToBuild=1 will build all tests with CLRTestPriority 1 and 0.
    
    CLRTestPriority = 0 will build only priority 0 cases. 
  
    In other words, the CLRTestPriority cases of 0 are *essential* testcases. The higher the value,
    the less priority we give them.
   -->
  <PropertyGroup>
    <CLRTestPriorityToBuild>0</CLRTestPriorityToBuild>
  </PropertyGroup>

  <!-- Where to put a "testhost" for running corefx tests -->
  <PropertyGroup>
    <TestHostVersion>$(ProductVersion)</TestHostVersion>
    <TestHostRootPath>$([MSBuild]::NormalizeDirectory('$(TestWorkingDir)', 'testhost'))</TestHostRootPath>
    <NETCoreAppTestHostFxrPath>$([MSBuild]::NormalizeDirectory('$(TestHostRootPath)', 'host', 'fxr', '$(TestHostVersion)'))</NETCoreAppTestHostFxrPath>
    <NETCoreAppTestSharedFrameworkPath>$([MSBuild]::NormalizeDirectory('$(TestHostRootPath)', 'shared', 'Microsoft.NETCore.App', '$(TestHostVersion)'))</NETCoreAppTestSharedFrameworkPath>
  </PropertyGroup>
  
</Project>