-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
Directory.Build.targets
553 lines (455 loc) · 29.1 KB
/
Directory.Build.targets
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Common files don't take part in the root src\tests\Directory.Build.targets
This file prevents them from including it as it gets included in its place
If they ever need to take part, we can conditionally include them as documented
here https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build#directorybuildprops-and-directorybuildtargets
-->
<Import Project="$(MSBuildThisFileDirectory)/Common/disableversioncheck.targets"
Condition="'$(DisableVersionCheckImported)' != 'true'" />
<!-- Default priority building values. -->
<PropertyGroup>
<DisableProjectBuild Condition="'$(IsMergedTestRunnerAssembly)' == 'true' and $(BuildAsStandalone)">true</DisableProjectBuild>
<OutputType Condition="('$(IsMergedTestRunnerAssembly)' == 'true' and !$(BuildAsStandalone)) or '$(RequiresProcessIsolation)' == 'true'">Exe</OutputType>
<CLRTestKind Condition="'$(CLRTestKind)' == '' and '$(OutputType)' == 'Exe'">BuildAndRun</CLRTestKind>
<CLRTestKind Condition="'$(CLRTestKind)' == ''">BuildOnly</CLRTestKind>
<CLRTestPriority Condition="'$(CLRTestPriority)' == ''">0</CLRTestPriority>
<!-- Merged test runner assemblies might not have any non-generated sources, and that's okay -->
<NoWarn Condition="'$(IsMergedTestRunnerAssembly)' == 'true'">$(NoWarn);CS2008</NoWarn>
</PropertyGroup>
<!-- All CLRTests need to be of a certain "kind". These kinds are enumerated below.
By default all tests are BuildAndRun. This means that the build system will Build them
and construct a run-batch-script for them. -->
<Choose>
<When Condition=" '$(CLRTestKind)'=='SharedLibrary'">
<PropertyGroup>
<_CLRTestCompilesSource>true</_CLRTestCompilesSource>
<_CLRTestNeedsToRun>false</_CLRTestNeedsToRun>
<GenerateRunScript>false</GenerateRunScript>
<_CLRTestBuildsExecutable>false</_CLRTestBuildsExecutable>
</PropertyGroup>
</When>
<When Condition=" '$(CLRTestKind)'=='BuildAndRun' ">
<PropertyGroup>
<GenerateRunScript>true</GenerateRunScript>
<_CLRTestNeedsToRun>true</_CLRTestNeedsToRun>
<_CLRTestCompilesSource>true</_CLRTestCompilesSource>
<_CLRTestBuildsExecutable>true</_CLRTestBuildsExecutable>
</PropertyGroup>
</When>
<When Condition=" '$(CLRTestKind)'=='BuildOnly'">
<PropertyGroup>
<_CLRTestNeedsToRun>false</_CLRTestNeedsToRun>
<GenerateRunScript>false</GenerateRunScript>
<_CLRTestCompilesSource>true</_CLRTestCompilesSource>
<_CLRTestBuildsExecutable>true</_CLRTestBuildsExecutable>
</PropertyGroup>
</When>
<When Condition=" '$(CLRTestKind)'=='RunOnly' ">
<PropertyGroup>
<GenerateRunScript>true</GenerateRunScript>
<SkipSigning>true</SkipSigning>
<_CLRTestBuildsExecutable>false</_CLRTestBuildsExecutable>
<_CLRTestNeedsToRun>true</_CLRTestNeedsToRun>
<_CLRTestCompilesSource>false</_CLRTestCompilesSource>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<_CLRTestNeedsProjectToRun>false</_CLRTestNeedsProjectToRun>
<_CLRTestNeedsProjectToRun Condition=" '$(_CLRTestNeedsToRun)' and '!$(_CLRTestBuildsExecutable)' ">true</_CLRTestNeedsProjectToRun>
</PropertyGroup>
<PropertyGroup>
<!-- Since bug in Roslyn for Linux empty DebugType property leads to build failure. See issue Roslyn@20343 -->
<DebugType Condition=" '$(DebugType)' == '' and '$(RunningOnUnix)' == 'true' ">None</DebugType>
<TestLibraryProjectPath>$(RepoRoot)\src\tests\Common\CoreCLRTestLibrary\CoreCLRTestLibrary.csproj</TestLibraryProjectPath>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(TestLibraryProjectPath)" Condition="'$(IsMergedTestRunnerAssembly)' == 'true'" />
</ItemGroup>
<!--
If it needs ProjectToRun, turn the project into a ProjectReference so it gets built
-->
<ItemGroup Condition=" $(_CLRTestNeedsProjectToRun) ">
<ProjectReference Include="$(CLRTestProjectToRun)">
<Private>false</Private>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition="'$(RequiresCodeFlowEnforcement)' == 'true'">
<CLRTestTargetUnsupported Condition="'$(UseCodeFlowEnforcement)' != 'true'">true</CLRTestTargetUnsupported>
</PropertyGroup>
<!-- Determine if this project should be built or not -->
<PropertyGroup>
<BuildAllProjects Condition="'$(BuildAllProjects)' == ''">false</BuildAllProjects>
<_WillCLRTestProjectBuild Condition="'$(_WillCLRTestProjectBuild)' == ''">false</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' != 'true'">true</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' == 'true' And '$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)'">true</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(CLRTestBuildAllTargets)' != 'allTargets' And '$(CLRTestTargetUnsupported)' == 'true'">false</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' == 'true'">false</_WillCLRTestProjectBuild>
</PropertyGroup>
<PropertyGroup>
<_CopyNativeProjectBinaries Condition="'$(__CopyNativeTestBinaries)' != '1'">$(__CopyNativeProjectsAfterCombinedTestBuild)</_CopyNativeProjectBinaries>
<_CopyNativeProjectBinaries Condition="'$(_WillCLRTestProjectBuild)' != 'true'">false</_CopyNativeProjectBinaries>
<_CopyNativeProjectBinaries Condition="'$(_CopyNativeProjectBinaries)' == ''">true</_CopyNativeProjectBinaries>
</PropertyGroup>
<!-- We enable auto-unification of assembly references after importing the common targets. Binding redirects are not needed
for coreclr since it auto-unifies, so the warnings we get without this setting are just noise -->
<PropertyGroup>
<AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
</PropertyGroup>
<!-- Project language -->
<!-- TODO: This might just be the Language property -->
<PropertyGroup Condition="'$(ProjectLanguage)' == ''">
<ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.ilproj' OR '$(Language)' == 'IL'">IL</ProjectLanguage>
<ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.csproj' OR '$(Language)' == 'C#' OR '$(ProjectLanguage)'==''">CSharp</ProjectLanguage>
<SkipImportILTargets Condition="'$(CLRTestPriority)' > '$(CLRTestPriorityToBuild)'">true</SkipImportILTargets>
<SkipImportILTargets Condition="'$(CLRTestBuildAllTargets)' != '' And '$(CLRTestNeedTarget)' != '$(CLRTestBuildAllTargets)'">true</SkipImportILTargets>
</PropertyGroup>
<Target Name="CopyNativeProjectBinaries" Condition="'$(_CopyNativeProjectBinaries)' == 'true'">
<ItemGroup Condition="'$(UseVisualStudioNativeBinariesLayout)' == 'true'">
<NativeProjectBinaries Include="$(NativeProjectOutputFolder)\*.*" />
</ItemGroup>
<ItemGroup Condition="'$(UseVisualStudioNativeBinariesLayout)' != 'true'">
<!-- ############################################################### -->
<!-- The following is required because the single configuration -->
<!-- generators, unlike multi-configuration generators, -->
<!-- do not place the binaries built into a separate -->
<!-- Debug/Checked/Release directory. Therefore we must filter -->
<!-- the folder to only include dynamic libraries, static libraries -->
<!-- and executables. -->
<!-- -->
<!-- Please take care when modifying the following lines of code. -->
<!-- ############################################################### -->
<!-- Include everything and then filter. -->
<NativeProjectBinariesMatched Include="$(NativeProjectOutputFolder)\**\*.*" />
<!-- Filter executables on unix -->
<NativeProjectBinariesExeFilter Condition="'%(Extension)' == ''" Include="@(NativeProjectBinariesMatched)" />
<!-- Filter executables on Windows -->
<NativeProjectBinariesExeFilter Condition="'%(Extension)' == '.exe'" Include="@(NativeProjectBinariesMatched)" />
<!-- Filter manifest/data files on Windows -->
<NativeProjectBinariesManifestFilter Condition="'%(Extension)' == '.manifest'" Include="@(NativeProjectBinariesMatched)" />
<NativeProjectBinariesManifestFilter Condition="'%(Extension)' == '.tlb'" Include="@(NativeProjectBinariesMatched)" />
<!-- Filter out the *Make* files -->
<NativeProjectBinariesExeFilterRemovedMakeFile Condition="'%(FileName)' != 'Makefile'" Include="@(NativeProjectBinariesExeFilter)" />
<!-- Filter .dylib files for OSX -->
<NativeProjectBinariesDyLibFilter Condition="'%(Extension)' == '.dylib'" Include="@(NativeProjectBinariesMatched)" />
<!-- Filter .so files for Linux -->
<NativeProjectBinariesDyLibFilter Condition="'%(Extension)' == '.so'" Include="@(NativeProjectBinariesMatched)" />
<!-- Filter static lib files for Unix -->
<NativeProjectBinariesStaticLibFilter Condition="'%(Extension)' == '.a'" Include="@(NativeProjectBinariesMatched)" />
<!-- Filter dynamic lib files for Windows -->
<NativeProjectBinariesDyLibFilter Condition="'%(Extension)' == '.dll'" Include="@(NativeProjectBinariesMatched)" />
<!-- Filter symbol files for Windows -->
<NativeProjectsBinariesSymbolsFilter Condition="'%(Extension)' == '.pdb'" Include="@(NativeProjectBinariesMatched)" />
<!-- Filter static lib files for Windows -->
<NativeProjectBinariesStaticLibFilter Condition="'%(Extension)' == '.lib'" Include="@(NativeProjectBinariesMatched)" />
<!-- Merge the filtered lists -->
<NativeProjectBinaries Include="@(NativeProjectBinariesExeFilterRemovedMakeFile)" />
<NativeProjectBinaries Include="@(NativeProjectBinariesDyLibFilter)" />
<NativeProjectBinaries Include="@(NativeProjectBinariesStaticLibFilter)" />
<NativeProjectBinaries Include="@(NativeProjectsBinariesSymbolsFilter)" />
<NativeProjectBinaries Include="@(NativeProjectBinariesManifestFilter)" />
</ItemGroup>
<!-- There are currently no native project binaries on wasm or Android -->
<Error Text="The native project files are missing in $(NativeProjectOutputFolder) please run build from the root of the repo at least once"
Condition="'@(NativeProjectBinaries)' == '' And '$(TargetOS)' != 'Browser' And '$(TargetOS)' != 'Android' And '$(TargetOS)' != 'iOS' And '$(TargetOS)' != 'iOSSimulator'"/>
<Copy
SourceFiles="@(NativeProjectBinaries)"
DestinationFiles="@(NativeProjectBinaries -> '$(OutDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
</Copy>
</Target>
<Target Name="ResolveCMakeNativeProjectReference"
Condition="'@(CMakeProjectReference)' != ''"
BeforeTargets="ConsolidateNativeProjectReference;BeforeResolveReferences;BeforeClean" >
<ItemGroup>
<NativeProjectReference Include="%(CMakeProjectReference.Identity)" Condition="$([System.String]::Copy(%(CMakeProjectReference.FileName)).ToUpper()) == 'CMAKELISTS'" />
<NativeProjectReferenceNormalized Include="@(NativeProjectReference -> '%(FullPath)')" />
</ItemGroup>
</Target>
<Target Name="ConsolidateNativeProjectReference"
Condition="'$(_CopyNativeProjectBinaries)' == 'true'"
BeforeTargets="Build" >
<ItemGroup Condition="'@(NativeProjectReferenceNormalized)' != ''">
<NativeProjectOutputFoldersToCopy Include="$([System.String]::Copy('%(NativeProjectReferenceNormalized.RelativeDir)').Replace($(TestSourceDir),$(__NativeTestIntermediatesDir)\))" Condition="'$(UseVisualStudioNativeBinariesLayout)' != 'true'" />
<NativeProjectOutputFoldersToCopy Include="$([System.String]::Copy('%(NativeProjectReferenceNormalized.RelativeDir)').Replace($(TestSourceDir),$(__NativeTestIntermediatesDir)\))$(Configuration)\" Condition="'$(UseVisualStudioNativeBinariesLayout)' == 'true'" />
</ItemGroup>
<Message Text= "Full native project references are :%(NativeProjectReferenceNormalized.Identity)" />
<Message Text= "Native binaries will be copied from :%(NativeProjectOutputFoldersToCopy.Identity)" />
<MSBuild Projects="$(MSBuildProjectFile)" Targets="CopyNativeProjectBinaries" Properties="NativeProjectOutputFolder=%(NativeProjectOutputFoldersToCopy.Identity)" Condition="'@(NativeProjectReference)' != ''" />
<MSBuild Projects="@(ProjectReference)"
Targets="CopyAllNativeProjectReferenceBinaries"
Condition="'$(IsMergedTestRunnerAssembly)' == 'true'"
BuildInParallel="true" />
</Target>
<Target Name="CopyAllNativeProjectReferenceBinaries"
DependsOnTargets="ResolveCMakeNativeProjectReference;ConsolidateNativeProjectReference"
BeforeTargets="Build">
<ItemGroup Condition="'$(IsMergedTestRunnerAssembly)' == 'true'">
<OutOfProcessTestMarkers Include="$(OutDir)/../**/*.OutOfProcessTest" />
<OutOfProcessTestFolders Include="$([MSBuild]::NormalizePath('$([System.IO.Path]::GetDirectoryName('%(OutOfProcessTestMarkers.FullPath)'))'))" Condition="'@(OutOfProcessTestMarkers)' != ''" />
<MergedWrapperReferenceFolders Include="@(ProjectReference->'$([MSBuild]::NormalizePath('$([System.IO.Path]::GetFullPath('%(ProjectReference.Identity)/..', '$(OutDir)/..'))/%(ProjectReference.FileName)'))')" />
<!-- Don't copy out-of-process test components to the merged wrapper output folder -->
<MergedWrapperReferenceFolders Remove="@(OutOfProcessTestFolders)" />
<!-- For merged project wrappers, include native libraries in all project references -->
<MergedWrapperReferenceFiles Include="%(MergedWrapperReferenceFolders.Identity)/*$(LibSuffix)" Condition="'@(MergedWrapperReferenceFolders)' != ''" />
</ItemGroup>
<Copy SourceFiles="@(MergedWrapperReferenceFiles)"
DestinationFiles="@(MergedWrapperReferenceFiles->'$(OutDir)/%(FileName)%(Extension)')"
SkipUnchangedFiles="true"
Condition="'@(MergedWrapperReferenceFiles)' != ''"
/>
</Target>
<!-- Build shell or command scripts whenever we copy native binaries -->
<Import Project="$(MSBuildThisFileDirectory)Common\CLRTest.Execute.targets" />
<Target Name="CreateExecuteScript"
BeforeTargets="Build;CopyAllNativeProjectReferenceBinaries"
Condition="'$(CLRTestBuildAllTargets)' != 'allTargets' And '$(GenerateRunScript)' != 'false' And ('$(_WillCLRTestProjectBuild)' == 'true')"
DependsOnTargets="GenerateExecutionScriptsInternal" />
<Target Name="UpdateReferenceItems"
BeforeTargets="BeforeResolveReferences"
>
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="GetLiveRefAssemblies">
<Output TaskParameter="TargetOutputs" ItemName="Reference" />
</MSBuild>
<ItemGroup>
<Reference Include="$(TargetingPackPath)/*.dll" >
<Private>false</Private>
</Reference>
</ItemGroup>
</Target>
<Target Name="GetLiveRefAssemblies" Returns="@(LibrariesRefAssembliesDlls)"
DependsOnTargets="ResolveLibrariesRefAssembliesFromLocalBuild">
<ItemGroup>
<LibrariesRefAssembliesDlls Include="@(LibrariesRefAssemblies)" Condition="'%(Extension)' == '.dll'" Private="false" />
</ItemGroup>
</Target>
<Target Name="GenerateMarkerFiles" BeforeTargets="AssignTargetPaths">
<ItemGroup>
<Content Include="$(AssemblyName).reflect.xml" Condition="Exists('$(AssemblyName).reflect.xml')" CopyToOutputDirectory="PreserveNewest" />
<MarkerFile Include="$(IntermediateOutputPath)\$(MSBuildProjectName).MergedTestAssembly" Condition="'$(IsMergedTestRunnerAssembly)' == 'true'" />
<MarkerFile Include="$(IntermediateOutputPath)\$(AssemblyName).NoMonoAot" Condition="'$(MonoAotIncompatible)' == 'true'" />
<Content Include="@(MarkerFile)" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<Copy SourceFiles="$(AssemblyName).reflect.xml"
DestinationFolder="$(OutputPath)"
Condition="Exists('$(AssemblyName).reflect.xml')"/>
<WriteLinesToFile
Condition="'$(IsMergedTestRunnerAssembly)' == 'true'"
File="$(IntermediateOutputPath)\$(MSBuildProjectName).MergedTestAssembly"
Lines="MergedTestAssembly"
Overwrite="true"
WriteOnlyWhenDifferent="true" />
<WriteLinesToFile
Condition="'$(MonoAotIncompatible)' == 'true'"
File="$(IntermediateOutputPath)\$(AssemblyName).NoMonoAot"
Lines="NoMonoAot"
Overwrite="true"
WriteOnlyWhenDifferent="true" />
<!-- We don't want the out-of-process test marker file to be included in referencing projects, so we don't include it as content. -->
<WriteLinesToFile
Condition="'$(RequiresProcessIsolation)' == 'true' and '$(BuildAsStandalone)' != 'true'"
File="$(OutputPath)\$(AssemblyName).OutOfProcessTest"
Lines="OutOfProcessTest"
Overwrite="true"
WriteOnlyWhenDifferent="true" />
</Target>
<PropertyGroup>
<ProjectAssetsFile>$(BaseOutputPath)\packages\Common\test_dependencies\test_dependencies\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
<Import Project="$(BaseOutputPath)\packages\Common\test_dependencies\test_dependencies\test_dependencies.*.targets" />
<PropertyGroup>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup>
<IncludeOOBLibraries>true</IncludeOOBLibraries>
</PropertyGroup>
<ItemGroup>
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
<KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App" />
</ItemGroup>
<Target Name="CopyDependencyToCoreRoot"
DependsOnTargets="ResolveAssemblyReferences;ResolveRuntimeFilesFromLocalBuild">
<ItemGroup>
<RunTimeDependencyExclude Include="$(CORE_ROOT)\**\*.*" />
<RunTimeDependencyExcludeFiles Include="@(RunTimeDependencyExclude -> '%(FileName)%(Extension)')" />
<RunTimeDependencyExcludeFiles Include="@(RunTimeDependencyExclude -> '%(FileName).ni%(Extension)')" />
<RunTimeDependencyExcludeFiles Include="@(RunTimeDependencyExclude -> '%(FileName).pdb')" />
<AllResolvedRuntimeDependencies Include="@(RuntimeCopyLocalItems -> '%(FileName)%(Extension)');@(NativeCopyLocalItems -> '%(FileName)%(Extension)')">
<File>%(Identity)</File>
</AllResolvedRuntimeDependencies>
<RunTimeDependencyCopyLocalFile Include="@(AllResolvedRuntimeDependencies)" Exclude="@(RunTimeDependencyExcludeFiles)"/>
<RunTimeDependencyCopyLocal Include="@(RunTimeDependencyCopyLocalFile -> '%(File)')" />
<RunTimeDependencyCopyLocal Include="$(TargetingPackPath)/*" />
<RunTimeDependencyCopyLocal Include="$(TargetingPackPath)/xunit.*" TargetDir="xunit/" />
</ItemGroup>
<ItemGroup>
<RunTimeArtifactsExcludeFiles Include="PDB/createdump.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/linuxonjit.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/mcs.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/mscordaccore.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/mscordbi.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/mscorrc.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/protononjit.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/superpmi.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/superpmi-shim-collector.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/superpmi-shim-counter.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/superpmi-shim-simple.pdb" />
</ItemGroup>
<ItemGroup Condition="'$(MinimalCoreRoot)' == 'true'">
<RunTimeArtifactsExcludeFiles Include="PDB/ilasm.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/ildasm.pdb" />
</ItemGroup>
<ItemGroup>
<RunTimeArtifactsIncludeFolders Include="/" />
<!-- Used by the Crossgen comparison job -->
<RunTimeArtifactsIncludeFolders Include="IL/" />
<!-- Used for Crossgen2 R2R tests -->
<RunTimeArtifactsIncludeFolders Include="crossgen2/">
<IncludeSubFolders>True</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
<!-- Used for capturing symbolic stack traces using Watson -->
<RunTimeArtifactsIncludeFolders Include="PDB/" />
<!-- Used by the coreroot_determinism test -->
<RunTimeArtifactsIncludeFolders Include="R2RTest/">
<IncludeSubFolders>True</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
<!-- XUnit runner harness assemblies that we don't want to mix in with the framework in Core_Root -->
<RunTimeArtifactsIncludeFolders Include="xunit/" />
</ItemGroup>
<ItemGroup>
<!-- Add binary dependencies to copy-local items -->
<RunTimeDependencyCopyLocal
Condition="'%(RuntimeArtifactsIncludeFolders.IncludeSubFolders)' != 'True'"
Include="$(CoreCLRArtifactsPath)%(RunTimeArtifactsIncludeFolders.Identity)*"
Exclude="@(RunTimeArtifactsExcludeFiles -> '$(CoreCLRArtifactsPath)%(Identity)')"
TargetDir="%(RunTimeArtifactsIncludeFolders.Identity)" />
<RunTimeDependencyCopyLocal
Condition="'%(RuntimeArtifactsIncludeFolders.IncludeSubFolders)' == 'True'"
Include="$(CoreCLRArtifactsPath)%(RunTimeArtifactsIncludeFolders.Identity)**/*"
Exclude="@(RunTimeArtifactsExcludeFiles -> '$(CoreCLRArtifactsPath)%(Identity)')"
TargetDir="%(RunTimeArtifactsIncludeFolders.Identity)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetArchitecture)' == 'wasm'">
<RunTimeDependencyCopyLocal
Include="@(RuntimeFiles)"
TargetDir="runtimepack/native/"/>
<!-- This throws everything in 'native', include many non-native assemblies.
This is done because LibrariesRuntimeFiles includes some .js files that
WasmAppBuilder expects in native/-->
<RunTimeDependencyCopyLocal
Include="@(LibrariesRuntimeFiles)"
TargetDir="runtimepack/native/"/>
<RunTimeDependencyCopyLocal
Include="$(ArtifactsDir)\TargetingPack\**"
TargetDir="TargetingPack/"/>
<!-- Wasm App Builder always builds in Debug -->
<RunTimeDependencyCopyLocal
Include="$(ArtifactsBinDir)\WasmAppBuilder\Debug\$(NetCoreAppToolCurrent)\**"
TargetDir="WasmAppBuilder/"/>
<!-- MonoAOTCompiler always builds in Debug -->
<RunTimeDependencyCopyLocal
Include="$(ArtifactsBinDir)\MonoAOTCompiler\Debug\$(NetCoreAppToolCurrent)\**"
TargetDir="MonoAOTCompiler/"/>
<!-- MonoTargetsTasks always builds in Debug -->
<RunTimeDependencyCopyLocal
Include="$(ArtifactsBinDir)\MonoTargetsTasks\Debug\$(NetCoreAppToolCurrent)\**"
TargetDir="MonoTargetsTasks/"/>
<RunTimeDependencyCopyLocal
Include="$(RepoRoot)\src\tests\Common\wasm-test-runner\WasmTestRunner.proj"
TargetDir="wasm-test-runner/"/>
<RunTimeDependencyCopyLocal
Include="$(MonoProjectRoot)\wasm\test-main.js"
TargetDir="runtime-test/"/>
<RunTimeDependencyCopyLocal
Include="$(MonoProjectRoot)\wasm\build\*"
TargetDir="build/"/>
</ItemGroup>
<Copy
SourceFiles="@(RunTimeDependencyCopyLocal)"
DestinationFiles="@(RunTimeDependencyCopyLocal -> '$(CORE_ROOT)/%(TargetDir)%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
</Copy>
</Target>
<Target Name="GetProjectsWithDisabledBuild" Returns="@(ProjectWithDisabledBuild)">
<ItemGroup Condition="'$(_WillCLRTestProjectBuild)' != 'true'">
<ProjectWithDisabledBuild Include="$(MSBuildProjectFullPath)" />
</ItemGroup>
</Target>
<Target Name="GetRequiresProcessIsolation" Returns="@(ProjectRequiringProcessIsolation)">
<ItemGroup Condition="'$(RequiresProcessIsolation)' == 'true'">
<ProjectRequiringProcessIsolation Include="$(MSBuildProjectFullPath)" />
</ItemGroup>
</Target>
<Target Name="DiscoverProcessIsolatedTestProjectReferences" BeforeTargets="AssignProjectConfiguration" Condition="'$(IsMergedTestRunnerAssembly)' == 'true'">
<MSBuild Projects="@(ProjectReference)" Targets="GetRequiresProcessIsolation" SkipNonexistentTargets="true">
<Output TaskParameter="TargetOutputs" ItemName="ReferencedProjectRequiringProcessIsolation" />
</MSBuild>
<ItemGroup>
<ProjectReference Remove="@(ReferencedProjectRequiringProcessIsolation->'%(OriginalItemSpec)')" />
<ProjectReference Include="@(ReferencedProjectRequiringProcessIsolation->'%(OriginalItemSpec)')" OutputItemType="OutOfProcessTests" BuildReference="true" ReferenceOutputAssembly="false" />
</ItemGroup>
</Target>
<PropertyGroup Condition="'$(Language)' == 'C#' and ('$(BuildAsStandalone)' == 'true' or '$(RequiresProcessIsolation)' == 'true' or '$(IsMergedTestRunnerAssembly)' == 'true')">
<ReferenceXUnitWrapperGenerator Condition="'$(ReferenceXUnitWrapperGenerator)' == ''">true</ReferenceXUnitWrapperGenerator>
</PropertyGroup>
<ItemGroup Condition="'$(ReferenceXUnitWrapperGenerator)' == 'true'">
<ProjectReference Include="$(RepoRoot)/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(IsMergedTestRunnerAssembly)' == 'true'">
<ProjectReference Include="$(RepoRoot)/src/tests/Common/XUnitWrapperLibrary/XUnitWrapperLibrary.csproj" />
</ItemGroup>
<Import Project="$(RepoRoot)/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.props" />
<Import Project="$(RepoRoot)eng/liveBuilds.targets" />
<Import Project="$(MSBuildProjectFullPath).targets" Condition="Exists('$(MSBuildProjectFullPath).targets')"/>
<Import Project="$(RepoRoot)/src/tests/Common/mergedrunner.targets" Condition="'$(IsMergedTestRunnerAssembly)' == 'true'" />
<Target Name="GetBinPlaceTargetFramework" />
<Import Project="$(RepoRoot)src\coreclr\clr.featuredefines.props" />
<!-- if we have determined that there is nothing to build, overwrite the build targets so that nothing happens -->
<Import Project="$(MSBuildThisFileDirectory)Common\nobuild.targets" Condition="'$(_WillCLRTestProjectBuild)' == 'false'" />
<!-- RunOnly projects have a special build for dependent projects -->
<Import Project="$(MSBuildThisFileDirectory)Common\runonly.targets" Condition="'$(CLRTestKind)' == 'RunOnly'" />
<PropertyGroup Condition="'$(TestBuildMode)' == 'nativeaot'">
<!-- NativeAOT compiled output is placed into a 'native' subdirectory: we need to tweak
rpath so that the test can load its native library dependencies if there's any -->
<IlcRPath Condition="'$(TargetOS)' != 'OSX'">$ORIGIN/..</IlcRPath>
<IlcRPath Condition="'$(TargetOS)' == 'OSX'">@executable_path/..</IlcRPath>
<!-- Works around "Error: Native compilation can run on x64 and arm64 hosts only"
Microsoft.NETCore.Native.targets expect IlcHostArch to be set but it doesn't have to -->
<DisableUnsupportedError>true</DisableUnsupportedError>
<IlcToolsPath>$(CoreCLRILCompilerDir)</IlcToolsPath>
<IlcBuildTasksPath>$(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll</IlcBuildTasksPath>
<IlcSdkPath>$(CoreCLRAotSdkDir)</IlcSdkPath>
<IlcFrameworkPath>$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)</IlcFrameworkPath>
<IlcFrameworkNativePath>$(MicrosoftNetCoreAppRuntimePackNativeDir)</IlcFrameworkNativePath>
<RuntimeIdentifier>$(OutputRid)</RuntimeIdentifier>
<BuildNativeAotFrameworkObjects Condition="'$(IlcMultiModule)' == 'true'">true</BuildNativeAotFrameworkObjects>
<DisableFrameworkLibGeneration Condition="'$(BuildNativeAotFrameworkObjects)' == 'true'">true</DisableFrameworkLibGeneration>
<FrameworkLibPath Condition="'$(BuildNativeAotFrameworkObjects)' == 'true'">$(IlcSdkPath)</FrameworkLibPath>
<!-- Forced by ILLink targets; we should fix the SDK -->
<SelfContained>true</SelfContained>
<HasRuntimeOutput>false</HasRuntimeOutput>
<_UsingDefaultForHasRuntimeOutput>false</_UsingDefaultForHasRuntimeOutput>
</PropertyGroup>
<ItemGroup Condition="'$(TestBuildMode)' == 'nativeaot'">
<IlcReference Include="$(TargetingPackPath)/*.dll" />
</ItemGroup>
<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.NETCore.Native.targets" Condition="'$(TestBuildMode)' == 'nativeaot'" />
<Target Name="BuildNativeAot"
DependsOnTargets="Build;LinkNativeIfBuildAndRun" />
<Target Name="LinkNativeIfBuildAndRun"
Condition="'$(_WillCLRTestProjectBuild)' == 'true' and '$(CLRTestKind)' == 'BuildAndRun'"
DependsOnTargets="ComputeResolvedFilesToPublishList;LinkNative" />
</Project>