forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
259 lines (214 loc) · 13.8 KB
/
Copy pathDirectory.Build.props
File metadata and controls
259 lines (214 loc) · 13.8 KB
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?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>
<InstallV8ForTests>false</InstallV8ForTests>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)\Common\dir.sdkbuild.props" Condition="'$(UsingMicrosoftNETSdk)' == 'true'" />
<Import Project="$(MSBuildThisFileDirectory)\Common\dir.common.props" Condition="'$(UsingMicrosoftNETSdk)' != 'true'" />
<PropertyGroup Condition="'$(UseBootstrap)' == 'true'">
<UseBootstrapLayout>true</UseBootstrapLayout>
</PropertyGroup>
<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>
<!-- Most IL tests do not depend on having a specific assembly name, but some of them contain
hard-coded assembly name directives which are incorrect. This MSBuild property default configures ilasm
to override the assembly name directive when assembling so that it matches the output dll name,
which fixes a variety of failures in crossgen r2r tests (from not being able to find dlls for references).
-->
<PropertyGroup>
<SynthesizeIlasmAssemblyName>true</SynthesizeIlasmAssemblyName>
</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>
<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>
<PropertyGroup>
<!-- The SDK for VB.NET requires the DefineConstants variable to be , delimited instead of ; -->
<DefineConstants Condition="'$(MSBuildProjectExtension)' == '.vbproj'">$(DefineConstants.Replace(';',','))</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,8500,8981</NoWarn>
<!--
Disable xunit warnings that aren't relevant with our custom runner.
xUnit1028: Use supported test return types. We support test methods that return int where 100 is passing and everything else is failure.
xUnit1031: Don't use task blocking operations. Our runner doesn't set up a synchronization context, so we can use the blocking operations without issue.
-->
<NoWarn>$(NoWarn);xUnit1028;xUnit1031;xUnit1051</NoWarn>
<RunAnalyzers>false</RunAnalyzers>
<EnableTrimAnalyzer>false</EnableTrimAnalyzer>
<EnableAotAnalyzer>false</EnableAotAnalyzer>
<EnableSingleFileAnalyzer>false</EnableSingleFileAnalyzer>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SkipSigning Condition="'$(CrossGen)' == 'true'">true</SkipSigning>
<AssemblyKey>Test</AssemblyKey>
<GenerateDependencyFile>false</GenerateDependencyFile>
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<UseAppHost>false</UseAppHost>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</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>
<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>
<!-- Don't append the RID to the output path for our test tree. Our test builds are already separated by RID. -->
<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' ) OR ($(WindowsHost) And '$(TargetArchitecture)' == 'wasm')">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>
<CrossGen2OutputFormat>wasm</CrossGen2OutputFormat>
</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' or ('$(TargetOS)' == 'android' and '$(TestBuildMode)' == 'nativeaot')">
<EnableAggressiveTrimming Condition="'$(OutputType)' == 'Exe'">true</EnableAggressiveTrimming>
<PublishTrimmed Condition="'$(OutputType)' == 'Exe'">true</PublishTrimmed>
<SkipTestUtilitiesReference>true</SkipTestUtilitiesReference>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeFlavor)' == 'coreclr' and '$(TargetsAppleMobile)' == 'true'">
<_targetOS>$(TargetOS)</_targetOS>
<_targetArchitecture>$(TargetArchitecture)</_targetArchitecture>
<UseNativeAOTRuntime Condition="'$(TestBuildMode)' == 'nativeaot'">true</UseNativeAOTRuntime>
<AppleAppBuilderRuntime Condition="'$(TestBuildMode)' == 'nativeaot'">NativeAOT</AppleAppBuilderRuntime>
<AppleAppBuilderRuntime Condition="'$(TestBuildMode)' != 'nativeaot'">CoreCLR</AppleAppBuilderRuntime>
<NativeLib>static</NativeLib>
<CustomNativeMain>true</CustomNativeMain>
<_IsApplePlatform Condition="'$(TargetsAppleMobile)' == 'true'">true</_IsApplePlatform>
<_IsiOSLikePlatform Condition="'$(TargetsAppleMobile)' == 'true'">true</_IsiOSLikePlatform>
<_SymbolPrefix Condition="'$(_IsApplePlatform)' == 'true'">_</_SymbolPrefix>
<HybridGlobalization Condition="'$(_IsApplePlatform)' == 'true'">true</HybridGlobalization>
</PropertyGroup>
<PropertyGroup Condition="'$(UsingMicrosoftNETSdk)' == 'true' and '$(TargetOS)' == 'android' and '$(TestBuildMode)' == 'nativeaot' and '$(OutputType)' == 'Exe'">
<NativeLib>shared</NativeLib>
<CustomNativeMain>true</CustomNativeMain>
</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'" />
<PropertyGroup Condition="'$(UsingMicrosoftNETSdk)' == 'true' and '$(TargetsAndroid)' == 'true' and '$(TestBuildMode)' == 'nativeaot'">
<!-- We need the library import generator when running android tests. -->
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
<!-- Treat as merged runners so that each assembly gets its own apk -->
<IsMergedTestRunnerAssembly>true</IsMergedTestRunnerAssembly>
<HasMergedInTests>true</HasMergedInTests>
<ExpectedExitCode>100</ExpectedExitCode>
</PropertyGroup>
</Project>