-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
Copy pathDirectory.Build.props
226 lines (185 loc) · 12 KB
/
Directory.Build.props
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LibrariesConfiguration>Release</LibrariesConfiguration>
<!-- NativeAot tests rely on presence of ILLink targets, but don't actually run ILLink. -->
<UsingToolMicrosoftNetILLinkTasks Condition="'$(UsingToolMicrosoftNetILLinkTasks)' == ''">true</UsingToolMicrosoftNetILLinkTasks>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)\Common\dir.sdkbuild.props" Condition="'$(UsingMicrosoftNETSdk)' == 'true'" />
<Import Project="$(MSBuildThisFileDirectory)\Common\dir.common.props" Condition="'$(UsingMicrosoftNETSdk)' != 'true'" />
<PropertyGroup>
<RunningOnUnix Condition="('$(RunningOnUnix)' == '') And ('$(MSBuildRuntimeType)' == 'Core') And ('$(OS)'!='Windows_NT')">true</RunningOnUnix>
</PropertyGroup>
<!-- Common repo directories -->
<PropertyGroup>
<TestProjectDir>$(MSBuildThisFileDirectory)</TestProjectDir>
<TestSourceDir>$([MSBuild]::NormalizePath('$(RepoRoot)/src/tests/'))</TestSourceDir>
</PropertyGroup>
<PropertyGroup>
<AltJitArch>$(__AltJitArch)</AltJitArch>
<EnableNativeSanitizers Condition="'$(__EnableNativeSanitizers)' != ''">$(__EnableNativeSanitizers)</EnableNativeSanitizers>
</PropertyGroup>
<!-- Output paths -->
<PropertyGroup>
<!-- When not using the SDK, we want to set this property here so
that BuildVersionFile gets the correct value. -->
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == '' Or '$(UsingMicrosoftNETSdk)' != 'true'">$(ArtifactsDir)obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(BaseIntermediateOutputPath)\$(TargetOS).$(TargetArchitecture).$(Configuration)</IntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)' == ''">$(BaseIntermediateOutputPath)\coreclr\$(TargetOS).$(TargetArchitecture).$(Configuration)</OutputPath>
</PropertyGroup>
<!-- Targeting Package paths -->
<PropertyGroup>
<TargetingPackPath Condition="'$(BaseTargetingPackPath)' == ''">$(ArtifactsDir)TargetingPack\</TargetingPackPath>
</PropertyGroup>
<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>
<!-- 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>
<CLRTestPriorityToBuild Condition="'$(__Priority)' != ''">$(__Priority)</CLRTestPriorityToBuild>
<WindowsHost>$([MSBuild]::IsOSPlatform(Windows))</WindowsHost>
<TargetsWindows>false</TargetsWindows>
<TargetsWindows Condition="'$(TargetOS)' == 'windows'">true</TargetsWindows>
<ScriptExt>.sh</ScriptExt>
<ScriptExt Condition="$(WindowsHost)">.cmd</ScriptExt>
<DotNetCli>"$(RepoRoot)\dotnet$(ScriptExt)"</DotNetCli>
<XunitTestBinBase Condition="'$(XunitTestBinBase)' == ''">$(__TestBinDir)</XunitTestBinBase>
<XunitTestBinBase>$([MSBuild]::NormalizeDirectory('$(XunitTestBinBase)/'))</XunitTestBinBase>
<CORE_ROOT Condition="'$(CORE_ROOT)' == ''">$(XunitTestBinBase)Tests/Core_Root</CORE_ROOT>
<TestBuildMode Condition="'$(__TestBuildMode)' != ''">$(__TestBuildMode)</TestBuildMode>
<RuntimeFlavor Condition="'$(__RuntimeFlavor)' != ''">$(__RuntimeFlavor)</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">coreclr</RuntimeFlavor>
<RestoreDefaultOptimizationDataPackage Condition="'$(RestoreDefaultOptimizationDataPackage)' == ''">false</RestoreDefaultOptimizationDataPackage>
<UsePartialNGENOptimization Condition="'$(UsePartialNGENOptimization)' == ''">false</UsePartialNGENOptimization>
<RunWithAndroid>false</RunWithAndroid>
<RunWithAndroid Condition="'$(TargetOS)' == 'android'">true</RunWithAndroid>
<RunWithiOS>false</RunWithiOS>
<RunWithiOS Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'maccatalyst'">true</RunWithiOS>
<MonoAot>false</MonoAot>
<MonoAot Condition="'$(__MonoAot)' == '1'">true</MonoAot>
<RuntimeVariant Condition="'$(__MonoAot)' == '1'">llvmaot</RuntimeVariant>
<MonoFullAot>false</MonoFullAot>
<MonoFullAot Condition="'$(__MonoFullAot)' == '1'">true</MonoFullAot>
<RuntimeVariant Condition="'$(__MonoFullAot)' == '1'">llvmfullaot</RuntimeVariant>
<MonoBinDir>$(__MonoBinDir)</MonoBinDir>
</PropertyGroup>
<!-- Setup Default symbol and optimization for Configuration -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<Optimize Condition="'$(Optimize)' == ''">false</Optimize>
<DebugType Condition="'$(DebugType)' == ''">full</DebugType>
<DefineConstants>$(DefineConstants);DEBUG;TRACE;XUNIT_PERF</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
<DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>
<DefineConstants>$(DefineConstants);TRACE;XUNIT_PERF</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Checked'">
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
<DebugType Condition="'$(DebugType)' == ''">full</DebugType>
<DefineConstants>$(DefineConstants);DEBUG;TRACE;XUNIT_PERF</DefineConstants>
</PropertyGroup>
<!-- Setup the default output and intermediate paths -->
<PropertyGroup>
<SkipXunitDependencyCopying>true</SkipXunitDependencyCopying>
</PropertyGroup>
<!-- Disable some standard properties for building our projects -->
<PropertyGroup>
<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,618,642,649,652,659,675,1691,1717,1718,3001,3002,3003,3005,3008,8981</NoWarn>
<RunAnalyzers>false</RunAnalyzers>
<EnableTrimAnalyzer>false</EnableTrimAnalyzer>
<EnableAotAnalyzer>false</EnableAotAnalyzer>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SkipSigning Condition="'$(CrossGen)' == 'true'">true</SkipSigning>
<AssemblyKey>Test</AssemblyKey>
<GenerateDependencyFile>false</GenerateDependencyFile>
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<UseAppHost>false</UseAppHost>
</PropertyGroup>
<!-- Set arch specific properties -->
<PropertyGroup>
<TargetBits>32</TargetBits>
<TargetBits Condition="'$(TargetArchitecture)'=='x64'">64</TargetBits>
<TargetBits Condition="'$(TargetArchitecture)'=='arm64'">64</TargetBits>
<TargetBits Condition="'$(TargetArchitecture)'=='loongarch64'">64</TargetBits>
<TargetBits Condition="'$(TargetArchitecture)'=='riscv64'">64</TargetBits>
</PropertyGroup>
<PropertyGroup>
<TargetsUnknownUnix Condition="'$(TargetsUnix)' == 'true' AND '$(TargetOS)' != 'freebsd' AND '$(TargetOS)' != 'linux' AND '$(TargetOS)' != 'netbsd' AND '$(TargetOS)' != 'osx' AND '$(TargetOS)' != 'maccatalyst' AND '$(TargetOS)' != 'illumos' AND '$(TargetOS)' != 'solaris'">true</TargetsUnknownUnix>
<Language Condition="'$(Language)' == '' and '$(MSBuildProjectExtension)' == '.csproj'">C#</Language>
<Language Condition="'$(Language)' == '' and '$(MSBuildProjectExtension)' == '.fsproj'">F#</Language>
<Language Condition="'$(Language)' == '' and '$(MSBuildProjectExtension)' == '.ilproj'">IL</Language>
</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>
<!-- Don't append the RID to the output path for our test tree. Our test builds are already separated by RID
and including the RID breaks some of our glob expressions in issues.targets -->
<PropertyGroup>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
<PropertyGroup>
<!-- Specify the target framework of the common test dependency project.json. -->
<NuGetTargetMoniker>$(NetCoreAppCurrentToolTargetFrameworkMoniker)</NuGetTargetMoniker>
<NuGetTargetMonikerShort>$(NetCoreAppToolCurrent)</NuGetTargetMonikerShort>
</PropertyGroup>
<!-- Set Test Wrapper running host OS -->
<PropertyGroup>
<TestWrapperTargetsWindows>false</TestWrapperTargetsWindows>
<TestWrapperTargetsWindows Condition=" ('$(TargetsWindows)' != '' And '$(TargetsWindows)' ) OR ('$(TargetOS)' == 'android' And '$(TargetArchitecture)' == 'arm64' )">true</TestWrapperTargetsWindows>
<TestScriptExtension Condition="'$(TestWrapperTargetsWindows)' != 'true' ">sh</TestScriptExtension>
<TestScriptExtension Condition="'$(TestWrapperTargetsWindows)' == 'true' ">cmd</TestScriptExtension>
</PropertyGroup>
<PropertyGroup>
<!-- Scenario tests install this version of Microsoft.NetCore.App, then patch coreclr binaries via xcopy. At the moment it is
updated manually whenever breaking changes require it to move forward, but it would be nice if we could update it automatically
as we do with many of the package versions above -->
<BaselineMicrosoftNetCoreAppPackageVersion>2.1.0-preview3-26416-01</BaselineMicrosoftNetCoreAppPackageVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'browser'">
<CLRTestMSBuildArgs>/p:MSBuildEnableWorkloadResolver=false /p:Configuration=$(Configuration)</CLRTestMSBuildArgs>
</PropertyGroup>
<PropertyGroup Condition="'$(IsTestsCommonProject)' != 'true'">
<BuildAsStandalone Condition="'$(BuildAsStandalone)' == ''">true</BuildAsStandalone>
<OutputType Condition="$(BuildAsStandalone)">Exe</OutputType>
<TestFramework>GeneratedRunner</TestFramework>
<!-- Prevent project-specific NuGet props/targets from clashing with the ones we manually import below. -->
<ImportProjectExtensionProps>false</ImportProjectExtensionProps>
<ImportProjectExtensionTargets>false</ImportProjectExtensionTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'ios' Or '$(TargetOS)' == 'tvos'">
<EnableAggressiveTrimming>true</EnableAggressiveTrimming>
<PublishTrimmed>true</PublishTrimmed>
<SkipTestUtilitiesReference>true</SkipTestUtilitiesReference>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeFlavor)' == 'coreclr' and '$(TargetsAppleMobile)' == 'true'">
<_targetOS>$(TargetOS)</_targetOS>
<UseNativeAOTRuntime>true</UseNativeAOTRuntime>
<NativeLib>static</NativeLib>
<CustomNativeMain>true</CustomNativeMain>
<_IsApplePlatform Condition="'$(TargetsAppleMobile)' == 'true'">true</_IsApplePlatform>
<_IsiOSLikePlatform Condition="'$(TargetsAppleMobile)' == 'true'">true</_IsiOSLikePlatform>
<_SymbolPrefix Condition="'$(_IsApplePlatform)' == 'true'">_</_SymbolPrefix>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)testing\tests.props" Condition="'$(IsTestsCommonProject)' != 'true'" />
<Import Project="$(BaseOutputPath)\packages\Common\test_dependencies\test_dependencies\test_dependencies.*.props" Condition="'$(IsTestsCommonProject)' != 'true'" />
</Project>