forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.proj
More file actions
342 lines (298 loc) · 22.2 KB
/
Copy pathbuild.proj
File metadata and controls
342 lines (298 loc) · 22.2 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
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
<Project DefaultTargets="Build">
<Import Project="Common\dirs.proj" />
<Import Project="$(RepoRoot)/eng/testing/Android/AndroidNdkCompiler.props" Condition="'$(TargetOS)' == 'android' and '$(TestBuildMode)' == 'nativeaot'" />
<Import Project="Directory.Build.targets" />
<Import Project="$(MonoProjectRoot)\msbuild\apple\build\AppleBuild.props" />
<Import Project="$(MonoProjectRoot)\msbuild\apple\build\AppleBuild.InTree.targets" />
<Import Project="restore.projects.props" />
<PropertyGroup>
<XunitTestBinBase Condition="'$(XunitTestBinBase)'==''" >$(BaseOutputPathWithConfig)</XunitTestBinBase>
<XunitWrapperGeneratedCSDirBase>$(XunitTestBinBase)\TestWrappers\</XunitWrapperGeneratedCSDirBase>
<MSBuildEnableAllPropertyFunctions>1</MSBuildEnableAllPropertyFunctions>
<Language>C#</Language>
<RuntimeIdentifier>$(TargetRid)</RuntimeIdentifier>
<MobileAppBundleDirName Condition="'$(TargetsMobile)' == 'true' and '$(TargetsBrowser)' != 'true'">AppBundle</MobileAppBundleDirName>
<MobileAppBundleDirName Condition="'$(TargetsBrowser)' == 'true'">wwwroot</MobileAppBundleDirName>
</PropertyGroup>
<ItemGroup>
<DisabledTestDir Include="bin" />
<DisabledTestDir Include="Common" />
<DisabledTestDir Include="Tests" />
<DisabledTestDir Include="TestWrappers" />
</ItemGroup>
<ItemGroup>
<TestBuildSteps Include="RestorePackages" />
<TestBuildSteps Include="ManagedBuild" />
<TestBuildSteps Include="GenerateLayout" />
<TestBuildSteps Include="CrossgenFramework" />
<TestBuildSteps Include="BuildMonoAot" />
</ItemGroup>
<Target Name="Rebuild" />
<Target Name="MonoAotCompileTests" DependsOnTargets="GetListOfTestCmds">
<ItemGroup>
<AllTestScripts Condition="'@(MergedRunnableTestPaths)' != ''" Include="%(MergedRunnableTestPaths.RootDir)%(MergedRunnableTestPaths.Directory)*.dll" />
<AllTestScripts Condition="'@(OutOfProcessTestPaths)' != ''" Include="%(OutOfProcessTestPaths.RootDir)%(OutOfProcessTestPaths.Directory)*.sh" />
<TestScripts Include="@(AllTestScripts)" />
<TestAssemblyPaths Include="$([System.IO.Path]::ChangeExtension('%(TestScripts.Identity)', 'dll'))" />
<TestAssemblies Include="%(TestAssemblyPaths.Identity)" Condition="Exists(%(TestAssemblyPaths.Identity))" />
<TestDirsWithDuplicates Include="$([System.IO.Path]::GetDirectoryName('%(TestAssemblies.Identity)'))" />
</ItemGroup>
<Error
Text="No tests found for Mono AOT compilation. Make sure that the desired test cases are not excluded from AOT compilation."
Condition="!Exists(%(TestAssemblies.Identity))" />
<RemoveDuplicates Inputs="@(TestDirsWithDuplicates)">
<Output TaskParameter="Filtered" ItemName="TestDirs" />
</RemoveDuplicates>
<ItemGroup>
<TestsAndAssociatedAssemblies Include="%(TestDirs.Identity)/**/*.dll" Exclude="@(NoMonoAotAssemblyPaths)" />
<CoreRootDlls Include="$(CORE_ROOT)/*.dll" Exclude="$(CORE_ROOT)/xunit.performance.api.dll;$(CORE_ROOT)/Microsoft.CodeAnalysis.VisualBasic.dll" />
<AllDlls Condition="'$(MonoFullAot)' == 'true'" Include="@(TestsAndAssociatedAssemblies);@(CoreRootDlls)" />
<AllDlls Condition="'$(MonoFullAot)' != 'true'" Include="@(TestsAndAssociatedAssemblies)" />
</ItemGroup>
<PropertyGroup Condition="'$(CROSSCOMPILE)' == ''">
<AotCompiler Condition="'$(RunningOnUnix)' == 'true'">$(CORE_ROOT)/corerun</AotCompiler>
<AotCompiler Condition="'$(RunningOnUnix)' != 'true'">$(CORE_ROOT)\corerun.exe</AotCompiler>
<MonoLlvmPath>$(MonoBinDir)</MonoLlvmPath>
</PropertyGroup>
<PropertyGroup Condition="'$(CROSSCOMPILE)' != ''">
<AotCompiler>$(MonoBinDir)/cross/$(TargetRid)/mono-aot-cross</AotCompiler>
<MonoLlvmPath>$(MonoBinDir)/cross/$(TargetRid)</MonoLlvmPath>
</PropertyGroup>
<ItemGroup>
<MonoAotOption Condition="'$(MonoForceInterpreter)' == 'true'" Include="interp" />
<MonoAotOption Condition="'$(MonoFullAot)' == 'true'" Include="full" />
<MonoAotOption Condition="'$(MonoFullAot)' == 'true'" Include="nimt-trampolines=2000" />
<MonoAotOption Condition="'$(MonoFullAot)' == 'true'" Include="ntrampolines=80000" />
<MonoAotOption Condition="'$(MonoFullAot)' == 'true'" Include="nrgctx-fetch-trampolines=256" />
<MonoAotOption Condition="'$(MonoFullAot)' == 'true'" Include="ngsharedvt-trampolines=8400" />
<MonoAotOption Condition="'$(MonoFullAot)' == 'true'" Include="nftnptr-arg-trampolines=4000" />
<MonoAotOption Condition="'$(MonoFullAot)' == 'true'" Include="nrgctx-trampolines=21000" />
<MonoAotOption Condition="'$(RuntimeVariant)' == 'llvmaot' or '$(RuntimeVariant)' == 'llvmfullaot'" Include="llvm" />
<MonoAotOption Condition="'$(RuntimeVariant)' == 'llvmaot' or '$(RuntimeVariant)' == 'llvmfullaot'" Include="llvm-path=$(MonoLlvmPath)" />
<MonoAotOption Condition="'$(__MonoToolPrefix)' != ''" Include="tool-prefix=$(__MonoToolPrefix)" />
</ItemGroup>
<ItemGroup Condition="'$(MonoFullAot)' == 'true' and '$(TargetOS)' == 'linux'">
<MonoAotOption Include="as-name=clang" />
<MonoAotOption Include="as-options='-c -x assembler'" />
<MonoAotOption Include="tool-prefix=''" />
<MonoAotOption Include="ld-name=clang" />
<MonoAotOption Include="ld-options='-fuse-ld=lld'" />
</ItemGroup>
<ItemGroup Condition="'$(TargetArchitecture)' == 'arm64'">
<MonoAotOption Include="mattr=crc" />
<MonoAotOption Include="mattr=crypto" />
</ItemGroup>
<ItemGroup Condition="'$(TargetArchitecture)' == 'x64'">
<MonoAotOption Include="mattr=sse4.2" />
<MonoAotOption Include="mattr=popcnt" />
<MonoAotOption Include="mattr=lzcnt" />
<MonoAotOption Include="mattr=bmi" />
<MonoAotOption Include="mattr=bmi2" />
<MonoAotOption Include="mattr=pclmul" />
<MonoAotOption Include="mattr=aes" />
</ItemGroup>
<PropertyGroup>
<MonoAotOptions>@(MonoAotOption->'%(Identity)', ',')</MonoAotOptions>
<MonoPath>$(CORE_ROOT)</MonoPath>
</PropertyGroup>
<Message Importance="High" Text="Mono AOT options: $(MonoAotOptions)" />
<Message Importance="High" Text="Mono AOT MONO_PATH: $(MonoPath)" />
<ItemGroup>
<AotProject Include="../mono/msbuild/aot-compile.proj">
<Properties>_AotCompiler=$(AotCompiler);_TestDll=%(AllDlls.Identity);_MonoPath=$(MonoPath);_MonoAotOptions=$(MonoAotOptions)</Properties>
</AotProject>
</ItemGroup>
<MSBuild
Projects="@(AotProject)"
Targets="AotCompile"
Condition="@(AllDlls->Count()) > 0"
BuildInParallel="true"
/>
</Target>
<Target Name="GetListOfTestCmds">
<ItemGroup>
<SkipTestDirsPaths Include="$([System.IO.Path]::GetFullPath('$(XunitTestBinBase)%(DisabledTestDir.Identity)'))" />
<AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.$(TestScriptExtension)"/>
<AllRunnableTestPaths Remove="$(XunitTestBinBase)\**\run-v8.sh" Condition="'$(TargetArchitecture)' == 'wasm'" />
<AllRunnableTestPaths Remove="%(SkipTestDirsPaths.Identity)\**\*.$(TestScriptExtension)" />
<MergedAssemblyMarkerPaths Include="$(XunitTestBinBase)\**\*.MergedTestAssembly"/>
<MergedAssemblyMarkerPaths Include="$(XunitTestBinBase)\**\*.MergedTestAssemblyForStress"/>
<MergedAssemblyFolders Include="$([System.IO.Path]::GetDirectoryName('%(MergedAssemblyMarkerPaths.Identity)'))" />
<MergedAssemblyParentFolders Include="$([System.IO.Path]::GetDirectoryName('%(MergedAssemblyFolders.Identity)'))" />
<AllRunnableTestPaths Remove="%(MergedAssemblyParentFolders.Identity)\**\*.$(TestScriptExtension)" Condition="'@(MergedAssemblyParentFolders)' != ''" />
<MergedRunnableTestPaths Include="$([System.IO.Path]::ChangeExtension('%(MergedAssemblyMarkerPaths.Identity)', '.$(TestScriptExtension)'))" Condition="'@(MergedAssemblyMarkerPaths)' != ''" />
<OutOfProcessTestMarkerPaths Include="$(XunitTestBinBase)\**\*.OutOfProcessTest"/>
<OutOfProcessTestPaths Include="$([System.IO.Path]::ChangeExtension('%(OutOfProcessTestMarkerPaths.Identity)', '.$(TestScriptExtension)'))" Condition="'@(OutOfProcessTestMarkerPaths)' != ''" />
<NoMonoAotMarkerPaths Include="$(XunitTestBinBase)\**\*.NoMonoAot" />
<NoMonoAotAssemblyPaths Include="$([System.IO.Path]::ChangeExtension('%(NoMonoAotMarkerPaths.Identity)', '.dll'))" Condition="'@(NoMonoAotMarkerPaths)' != ''" />
</ItemGroup>
<!-- Remove the cmd/sh scripts for merged test runner app bundles from our list. -->
<PropertyGroup Condition="'$(TargetsMobile)' == 'true'">
<MergedRunnableTestAppBundleScriptPathsPattern>@(MergedAssemblyMarkerPaths->'%(RootDir)%(Directory)$(MobileAppBundleDirName)/**/*.$(TestScriptExtension)')</MergedRunnableTestAppBundleScriptPathsPattern>
</PropertyGroup>
<ItemGroup>
<UnreferencedRunnableTestPaths Include="@(AllRunnableTestPaths)" Exclude="@(MergedRunnableTestPaths);@(OutOfProcessTestPaths);$(MergedRunnableTestAppBundleScriptPathsPattern)" />
</ItemGroup>
<Error Text="No merged runner found for test script %(UnreferencedRunnableTestPaths.Identity)"
Condition="@(UnreferencedRunnableTestPaths->Count()) > 0 and '$(BuildAllTestsAsStandalone)' != 'true'" />
</Target>
<Import Project="$(RepoRoot)/src/tests/Common/tests.targets" />
<Import Project="$(RepoRoot)/src/tests/Common/publishdependency.targets" />
<Target Name="CreateTestOverlay" DependsOnTargets="CopyDependencyToCoreRoot" />
<Target Name="Clean">
<RemoveDir Condition=" '$(BuildWrappers)'=='true'" Directories="$(MSBuildThisFileDirectory)../$(XunitWrapperGeneratedCSDirBase);" ContinueOnError="WarnAndContinue" />
</Target>
<Target Name="TestBuild" DependsOnTargets="@(TestBuildSteps)" />
<Target Name="BuildTargetingPack" AfterTargets="BatchRestorePackages">
<Message Text="$(MsgPrefix)Building Targeting Pack" Importance="High" />
<MSBuild Projects="Common\external\external.csproj"
Targets="Build" />
</Target>
<Target Name="BatchRestorePackages">
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages..." />
<PropertyGroup>
<_RestoreProperties>MSBuildRestoreSessionId=$([System.Guid]::NewGuid());TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture);Configuration=$(Configuration);CrossBuild=$(CrossBuild);SetTFMForRestore=true;RuntimeIdentifier=$(RuntimeIdentifier)</_RestoreProperties>
<_RestoreProperties Condition="'$(TargetOS)' == 'browser'">$(_RestoreProperties);EnableAppHostPackDownload=false;EnableTargetingPackDownload=false;EnableRuntimePackDownload=false</_RestoreProperties>
<_RestoreProperties Condition="'$(TargetsAppleMobile)' == 'true'">$(_RestoreProperties);RestoreUseStaticGraphEvaluation=false</_RestoreProperties>
<_RestoreProperties Condition="'$(UseBootstrap)' == 'true'">$(_RestoreProperties);UseBootstrap=true</_RestoreProperties>
</PropertyGroup>
<!-- Use a dedicated traversal project to restore all test dependencies in one graph invocation. -->
<MSBuild Projects="restore.proj"
Targets="Restore"
Properties="$(_RestoreProperties)" />
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages...Done." />
</Target>
<!-- Override RestorePackages from dir.traversal.targets and do a batch restore -->
<Target Name="RestorePackages"
DependsOnTargets="BatchRestorePackages"
Condition="'$(__SkipRestorePackages)' != '1'" />
<Target Name="ManagedBuild"
DependsOnTargets="BuildManagedTestGroups"
Condition="'$(__GenerateLayoutOnly)' != '1' and '$(__SkipManaged)' != '1' and !$(MonoAot) and !$(MonoFullAot)" />
<Target Name="BuildManagedTestGroups" DependsOnTargets="RestorePackages;ResolveDisabledProjects;BuildNativeAotFrameworkObjects">
<Message Importance="High" Text="$(MsgPrefix)Building managed test components" />
<Warning Text="Building the whole test suite with the BuildAsStandalone=true environment variable will cause some tests to be executed twice. Use the BuildAllTestsAsStandalone=true environment variable instead." Condition="'$(BuildAsStandalone)' == 'true'" />
<!-- Execute msbuild test build in stages - workaround for excessive data retention in MSBuild ConfigCache -->
<!-- See https://github.com/Microsoft/msbuild/issues/2993 -->
<!-- We need to build group #1 manually as it doesn't have a _GroupStartsWith item associated with it, see the comment in Common\dirs.proj -->
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="BuildManagedTestGroup" Properties="__TestGroupToBuild=1;__SkipRestorePackages=1" />
<!-- ActiveIssue https://github.com/dotnet/runtime/issues/114123
The groups 2..n are disabled for browser target because they get OOM kill in CI.
-->
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="BuildManagedTestGroup" Properties="__TestGroupToBuild=%(_GroupStartsWith.GroupNumber);__SkipRestorePackages=1"
Condition="'$(TargetOS)' != 'browser' or '$(ContinuousIntegrationBuild)' != 'true'"
/>
</Target>
<Target Name="BuildManagedTestGroup"
DependsOnTargets="ResolveDisabledProjects"
Condition="'$(__SkipManaged)' != '1'" >
<PropertyGroup>
<TargetToBuild>Build</TargetToBuild>
<!-- In split pipeline mode (in the lab) we're using the native component copying step to generate the test execution scripts -->
<TargetToBuild Condition="'$(__CopyNativeTestBinaries)' == '1'">CopyAllNativeTestProjectBinaries</TargetToBuild>
<GroupBuildCmd>$(DotNetCli) msbuild</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) $(MSBuildThisFileFullPath)</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) /t:$(TargetToBuild)</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:TargetArchitecture=$(TargetArchitecture)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:Configuration=$(Configuration)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:LibrariesConfiguration=$(LibrariesConfiguration)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:TasksConfiguration=$(TasksConfiguration)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:TargetOS=$(TargetOS)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:ToolsOS=$(ToolsOS)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:PackageOS=$(PackageOS)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:RuntimeFlavor=$(RuntimeFlavor)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:RuntimeVariant=$(RuntimeVariant)"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(UseBootstrap)' == 'true'">$(GroupBuildCmd) "/p:UseBootstrap=true"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(ServerGarbageCollection)' != ''">$(GroupBuildCmd) "/p:ServerGarbageCollection=$(ServerGarbageCollection)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:CLRTestBuildAllTargets=$(CLRTestBuildAllTargets)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:UseCodeFlowEnforcement=$(UseCodeFlowEnforcement)"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(ControlFlowGuard)' != ''">$(GroupBuildCmd) "/p:ControlFlowGuard=$(ControlFlowGuard)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:__TestGroupToBuild=$(__TestGroupToBuild)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:__SkipRestorePackages=1"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) /nodeReuse:false</GroupBuildCmd>
<GroupBuildCmd Condition="'$(TargetOS)' != 'browser' or '$(ContinuousIntegrationBuild)' != 'true'">$(GroupBuildCmd) /maxcpucount</GroupBuildCmd>
<!-- https://github.com/dotnet/runtime/issues/93134 -->
<GroupBuildCmd Condition="'$(TargetOS)' == 'browser' and '$(ContinuousIntegrationBuild)' == 'true'">$(GroupBuildCmd) /m:1</GroupBuildCmd>
<GroupBuildCmd Condition="'$(TargetOS)' == 'wasi'">$(GroupBuildCmd) /m:1</GroupBuildCmd>
<GroupBuildCmd Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos'">$(GroupBuildCmd) "/p:DevTeamProvisioning=-"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(UseMonoRuntime)' != ''">$(GroupBuildCmd) "/p:UseMonoRuntime=$(UseMonoRuntime)"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(UseNativeAOTRuntime)' != ''">$(GroupBuildCmd) "/p:UseNativeAOTRuntime=$(UseNativeAOTRuntime)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) /bl:$(ArtifactsDir)/log/$(Configuration)/InnerManagedTestBuild.$(__TestGroupToBuild).binlog</GroupBuildCmd>
<GroupBuildCmd Condition="'$(CrossBuild)' == 'true'">$(GroupBuildCmd) "/p:CrossBuild=true"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(CppCompilerAndLinker)' != ''">$(GroupBuildCmd) "/p:CppCompilerAndLinker=$(CppCompilerAndLinker)"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(TestBuildMode)' == 'nativeaot'">$(GroupBuildCmd) "/p:DefaultBuildAllTarget=BuildNativeAot"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(IlcMultiModule)' == 'true'">$(GroupBuildCmd) "/p:IlcMultiModule=true"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(IlcUseServerGc)' == 'false'">$(GroupBuildCmd) "/p:IlcUseServerGc=false"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(BuildNativeAotFrameworkObjects)' == 'true'">$(GroupBuildCmd) "/p:BuildNativeAotFrameworkObjects=true"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(ContinuousIntegrationBuild)' == 'true'">$(GroupBuildCmd) /p:ContinuousIntegrationBuild=true</GroupBuildCmd>
<GroupBuildCmd Condition="'$(BuildTestsOnHelix)' == 'true'">$(GroupBuildCmd) "/p:BuildTestsOnHelix=true"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(MonoForceInterpreter)' == 'true'">$(GroupBuildCmd) "/p:MonoForceInterpreter=true"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(RunAOTCompilation)' == 'true'">$(GroupBuildCmd) "/p:RunAOTCompilation=true"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(DevTeamProvisioning)' != ''">$(GroupBuildCmd) "/p:DevTeamProvisioning=$(DevTeamProvisioning)"</GroupBuildCmd>
</PropertyGroup>
<Message Importance="High" Text="$(MsgPrefix)Building managed test group $(__TestGroupToBuild): $(GroupBuildCmd)" />
<Exec Command="$(GroupBuildCmd)" />
</Target>
<Target Name="GenerateLayout"
DependsOnTargets="CreateTestOverlay"
AfterTargets="ManagedBuild;RestorePackages"
Condition="'$(__CopyNativeTestBinaries)' != '1' and '$(__SkipGenerateLayout)' != '1' and !$(MonoAot) and !$(MonoFullAot)">
<MSBuild
Projects="Common\XUnitLogChecker\XUnitLogChecker.csproj"
Targets="Publish"
Properties="_IsPublishing=true;Configuration=Release;CoreCLRConfiguration=$(CoreCLRConfiguration);LibrariesConfiguration=$(LibrariesConfiguration);TasksConfiguration=$(TasksConfiguration);ToolsConfiguration=$(ToolsConfiguration);PublishDir=$(XunitTestBinBase)/XUnitLogChecker;RuntimeIdentifier=$(RuntimeIdentifier);UseBootstrap=$(UseBootstrap)"
Condition="$(IsXUnitLogCheckerSupported)" />
</Target>
<Target Name="CrossgenFramework"
DependsOnTargets="GenerateLayout"
Condition="'$(__CopyNativeTestBinaries)' != '1' and '$(__TestBuildMode)' == 'crossgen2' and '$(TargetArchitecture)' != 'wasm' and !$(MonoAot) and !$(MonoFullAot)" >
<PropertyGroup>
<CrossgenOutputDir>$(__TestIntermediatesDir)\crossgen.out</CrossgenOutputDir>
<CrossgenCmd>$(DotNetCli)</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) "$(CORE_ROOT)\R2RTest\R2RTest.dll"</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) compile-framework</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) -cr "$(CORE_ROOT)"</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) --output-directory "$(CrossgenOutputDir)"</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) --release</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) --nocleanup</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) --target-arch $(TargetArchitecture)</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) -dop $(NUMBER_OF_PROCESSORS)</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) -m "$(CORE_ROOT)\StandardOptimizationData.mibc"</CrossgenCmd>
<CrossgenCmd Condition="'$(__CreatePdb)' != ''">$(CrossgenCmd) --pdb</CrossgenCmd>
<CrossgenCmd Condition="'$(__CreatePerfmap)' != '' and '$(TargetsAppleMobile)' != 'true'">$(CrossgenCmd) --perfmap --perfmap-format-version 1</CrossgenCmd>
<CrossgenCmd Condition="'$(__CompositeBuildMode)' != ''">$(CrossgenCmd) --composite</CrossgenCmd>
<CrossgenCmd Condition="'$(__CompositeBuildMode)' == ''">$(CrossgenCmd) --crossgen2-parallelism 1</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) --verify-type-and-field-layout</CrossgenCmd>
<CrossgenCmd>$(CrossgenCmd) --crossgen2-path "$(__BinDir)\$(BuildArchitecture)\crossgen2\crossgen2$(ExeSuffix)"</CrossgenCmd>
</PropertyGroup>
<Message Importance="High" Text="$(MsgPrefix)Compiling framework using Crossgen2: $(CrossgenCmd)" />
<Exec Command="$(CrossgenCmd)" />
<ItemGroup>
<CrossgenOutputFiles Include="$(CrossgenOutputDir)\*.dll" />
<CrossgenOutputFiles Include="$(CrossgenOutputDir)\*.ni.pdb" Condition="'$(__CreatePdb)' != ''" />
<CrossgenOutputFiles Include="$(CrossgenOutputDir)\*.ni.r2rmap" Condition="'$(__CreatePerfmap)' != ''" />
</ItemGroup>
<Move SourceFiles="@(CrossgenOutputFiles)" DestinationFolder="$(CORE_ROOT)" />
</Target>
<Target Name="BuildMonoAot"
DependsOnTargets="MonoAotCompileTests"
AfterTargets="ManagedBuild"
Condition="'$(__GenerateLayoutOnly)' != '1' and '$(__CopyNativeTestBinaries)' != '1' and ($(MonoAot) or $(MonoFullAot))" />
<Target Name="BuildNativeAotFrameworkObjects"
Condition="'$(BuildNativeAotFrameworkObjects)' == 'true' and '$(TestBuildMode)' == 'nativeaot'">
<ItemGroup>
<CreateLibProperty Include="IlcToolsPath=$(IlcToolsPath)" />
<CreateLibProperty Include="IlcBuildTasksPath=$(IlcBuildTasksPath)" />
<CreateLibProperty Include="IlcSdkPath=$(IlcSdkPath)" />
<CreateLibProperty Include="IlcFrameworkPath=$(IlcFrameworkPath)" />
<CreateLibProperty Include="IlcFrameworkNativePath=$(IlcFrameworkNativePath)" />
<CreateLibProperty Include="FrameworkLibPath=$(IlcSdkPath)" />
<CreateLibProperty Include="FrameworkObjPath=$(IntermediateOutputPath)/NativeAOTFX" />
<CreateLibProperty Condition="'$(Configuration)' == 'Checked' or '$(Configuration)' == 'Release'" Include="Optimize=true" />
<CreateLibProperty Include="NETCoreSdkVersion=6.0.0" />
</ItemGroup>
<MSBuild Projects="$(CoreCLRBuildIntegrationDir)/BuildFrameworkNativeObjects.proj"
Targets="CreateLib"
Properties="@(CreateLibProperty)" />
</Target>
</Project>