-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
Directory.Build.targets
241 lines (197 loc) · 11.8 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
<Project>
<!--
Common files don't take part in the root tests\src\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://learn.microsoft.com/visualstudio/msbuild/customize-your-build#directorybuildprops-and-directorybuildtargets
-->
<Import Project="$(MSBuildThisFileDirectory)/disableversioncheck.targets"
Condition="'$(DisableVersionCheckImported)' != 'true'" />
<Import Project="$(RepoRoot)eng/liveBuilds.targets" />
<Import Project="$(RepositoryEngineeringDir)toolAot.targets" />
<PropertyGroup>
<GCStressDependsOnCoreDisTools>false</GCStressDependsOnCoreDisTools>
<GCStressDependsOnCoreDisTools Condition="'$(TargetOS)' == 'windows' And ('$(TargetArchitecture)' == 'x64' Or '$(TargetArchitecture)' == 'x86')">true</GCStressDependsOnCoreDisTools>
<GCStressDependsOnCoreDisTools Condition="'$(TargetOS)' == 'linux' And '$(TargetArchitecture)' == 'x64'">true</GCStressDependsOnCoreDisTools>
<CopyCoreDisToolsToCoreRoot>false</CopyCoreDisToolsToCoreRoot>
<CopyCoreDisToolsToCoreRoot Condition="$(GCStressDependsOnCoreDisTools) And '$(DotNetBuildSourceOnly)' != 'true'">true</CopyCoreDisToolsToCoreRoot>
<!-- Non-desktop OS's use a custom dotnet host, instead of corerun -->
<IsDesktopOS Condition="'$(TargetsBrowser)' != 'true' and '$(TargetsAndroid)' != 'true' and '$(TargetstvOS)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetsMacCatalyst)' != 'true'">true</IsDesktopOS>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)coredistools.targets" Condition="$(CopyCoreDisToolsToCoreRoot)" />
<ItemGroup>
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
<KnownFrameworkReference Remove="Microsoft.WindowsDesktop.App" />
</ItemGroup>
<ItemDefinitionGroup>
<RunTimeArtifactsIncludeFolders>
<IncludeSubFolders>false</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
</ItemDefinitionGroup>
<Target Name="CopyDependencyToCoreRoot"
DependsOnTargets="ResolveAssemblyReferences;ResolveRuntimeFilesFromLocalBuild">
<ItemGroup>
<RunTimeDependencyCopyLocal Include="@(RuntimeCopyLocalItems)" />
<RunTimeDependencyCopyLocal Include="@(NativeCopyLocalItems)" />
<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/clrjit_*.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>
<!-- A sanitized DAC and DBI can't be loaded into a debugger process, so copy the non-sanitized versions instead -->
<ItemGroup Condition="'$(EnableNativeSanitizers)' != ''">
<SanitizedDiagnosticTools Include="$(CoreCLRArtifactsPath)/*mscordaccore*" />
<SanitizedDiagnosticTools Include="$(LibPrefix)mscordbi$(LibSuffix)" />
<SanitizedDiagnosticTools Include="$(LibPrefix)dbgshim$(LibSuffix)" />
<RunTimeArtifactsExcludeFiles Include="@(SanitizedDiagnosticTools->'%(FileName)%(Extension)')" />
<RunTimeArtifactsIncludeFolders Include="unsanitized/" TargetDir="/" />
</ItemGroup>
<ItemGroup Condition="'$(MinimalCoreRoot)' == 'true'">
<RunTimeArtifactsExcludeFiles Include="PDB/ilasm.pdb" />
<RunTimeArtifactsExcludeFiles Include="PDB/ildasm.pdb" />
</ItemGroup>
<ItemGroup>
<RunTimeArtifactsIncludeFolders Include="/" TargetDir="/" />
<!-- Experiment -->
<RunTimeArtifactsIncludeFolders Include="R2RDump/" TargetDir="R2RDump/" />
<!-- Used by the Crossgen comparison job -->
<RunTimeArtifactsIncludeFolders Include="IL/" TargetDir="IL/" />
<!-- Used for Crossgen2 R2R tests -->
<RunTimeArtifactsIncludeFolders Include="crossgen2-published/" TargetDir="crossgen2/">
<IncludeSubFolders>True</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
<!-- Used for NativeAOT tests -->
<RunTimeArtifactsIncludeFolders Include="ilc-published/" TargetDir="ilc-published/">
<IncludeSubFolders>True</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
<!-- Used for NativeAOT tests -->
<RunTimeArtifactsIncludeFolders Include="aotsdk/" TargetDir="aotsdk/">
<IncludeSubFolders>True</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
<!-- Used for NativeAOT tests -->
<RunTimeArtifactsIncludeFolders Include="build/" TargetDir="build/">
<IncludeSubFolders>True</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
<!-- Used for capturing symbolic stack traces using Watson -->
<RunTimeArtifactsIncludeFolders Include="PDB/" TargetDir="PDB/" />
<!-- Used by the coreroot_determinism test -->
<RunTimeArtifactsIncludeFolders Include="R2RTest/" TargetDir="R2RTest/">
<IncludeSubFolders>True</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
<!-- Used by tests checking PDB validity -->
<RunTimeArtifactsIncludeFolders Include="PdbChecker/" TargetDir="PdbChecker/" />
<!-- Used by disasm output verification tests -->
<RunTimeArtifactsIncludeFolders Include="SuperFileCheck/" TargetDir="SuperFileCheck/">
<IncludeSubFolders>True</IncludeSubFolders>
</RunTimeArtifactsIncludeFolders>
<!-- Used to determine if a file is a managed assembly or a managed assembly built with DEBUG -->
<RunTimeArtifactsIncludeFolders Include="AssemblyChecker/" TargetDir="AssemblyChecker/">
<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/" TargetDir="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.TargetDir)" />
<RunTimeDependencyCopyLocal
Condition="'%(RuntimeArtifactsIncludeFolders.IncludeSubFolders)' == 'True'"
Include="$(CoreCLRArtifactsPath)%(RunTimeArtifactsIncludeFolders.Identity)**\*"
Exclude="@(RunTimeArtifactsExcludeFiles -> '$(CoreCLRArtifactsPath)%(Identity)')"
TargetDir="%(RunTimeArtifactsIncludeFolders.TargetDir)" />
</ItemGroup>
<PropertyGroup>
<Crossgen2Dir />
<Crossgen2Dir Condition="('$(TargetArchitecture)' != 'x64' and '$(BuildArchitecture)' == 'x64') or '$(EnableNativeSanitizers)' != ''">$(CoreCLRArtifactsPath)x64/crossgen2</Crossgen2Dir>
</PropertyGroup>
<ItemGroup Condition="'$(Crossgen2Dir)' != ''">
<RunTimeDependencyCopyLocal
Include="
$(Crossgen2Dir)/$(LibPrefix)clrjit_*$(LibSuffix);
$(Crossgen2Dir)/$(LibPrefix)jitinterface_*$(LibSuffix);
$(Crossgen2Dir)/$(LibPrefix)Microsoft.DiaSymReader.Native.*$(LibSuffix)"
TargetDir="crossgen2/" />
</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/%(LibrariesRuntimeFiles.NativeSubDirectory)/"
Condition="'%(LibrariesRuntimeFiles.NativeSubDirectory)' != ''" />
<RunTimeDependencyCopyLocal
Include="@(LibrariesRuntimeFiles)"
TargetDir="runtimepack/native/"
Condition="'%(LibrariesRuntimeFiles.NativeSubDirectory)' == ''" />
<RunTimeDependencyCopyLocal
Include="$(ArtifactsDir)\TargetingPack\**"
TargetDir="TargetingPack/"/>
<!-- Wasm App Builder builds as part of tasks, using the corresponding TasksConfiguration -->
<RunTimeDependencyCopyLocal
Include="$(ArtifactsBinDir)\WasmAppBuilder\$(TasksConfiguration)\$(NetCoreAppToolCurrent)\**"
TargetDir="WasmAppBuilder/"/>
<RunTimeDependencyCopyLocal
Include="$(ArtifactsBinDir)\MonoTargetsTasks\$(TasksConfiguration)\$(NetCoreAppToolCurrent)\publish\**"
TargetDir="WasmAppBuilder/"/>
<RunTimeDependencyCopyLocal
Include="$(RepoRoot)\src\tests\Common\wasm-test-runner\WasmTestRunner.proj"
TargetDir="wasm-test-runner/"/>
<RunTimeDependencyCopyLocal
Include="$(BrowserProjectRoot)\test-main.js"
TargetDir="runtime-test/"/>
<RunTimeDependencyCopyLocal
Include="$(RepoRoot)\src\tests\Common\wasm-test-runner\index.html"
TargetDir="runtime-test/"/>
<RunTimeDependencyCopyLocal
Include="$(MonoProjectRoot)\wasm\build\*"
TargetDir="build/"/>
<RunTimeDependencyCopyLocal
Include="$(MonoProjectRoot)\browser\build\*"
TargetDir="build/"/>
</ItemGroup>
<ItemGroup>
<RunTimeDependencyCopyLocal Include="$(CoreDisToolsLibrary)" Condition="$(CopyCoreDisToolsToCoreRoot)" />
</ItemGroup>
<ItemGroup Condition="'$(RuntimeFlavor)' == 'mono' and '$(IsDesktopOS)' == 'true' " >
<!-- Copy the mono version of the coreclr library and SPCL instead of the corceclr one -->
<RuntimeDependencyCopyLocal Remove="$(CoreCLRArtifactsPath)$(LibPrefix)coreclr$(LibSuffix)" />
<RuntimeDependencyCopyLocal Remove="$(CoreCLRArtifactsPath)System.Private.CoreLib.dll" />
<RuntimeDependencyCopyLocal Include="$(MonoArtifactsPath)$(LibPrefix)coreclr$(LibSuffix)" TargetDir="" />
<RuntimeDependencyCopyLocal Include="$(MonoArtifactsPath)/libmono-component-*" TargetDir="" />
<RuntimeDependencyCopyLocal Include="$(MonoArtifactsPath)/*.dll" TargetDir="" />
<RuntimeDependencyCopyLocal Include="$(MonoArtifactsPath)/libc++.so.1" TargetDir="" Condition="Exists('$(MonoArtifactsPath)/libc++.so.1')" />
<RuntimeDependencyCopyLocal Include="$(MonoArtifactsPath)/libc++abi.so.1" TargetDir="" Condition="Exists('$(MonoArtifactsPath)/libc++abi.so.1')" />
</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>
<!-- At this point Common test dependencies don't have any native components -->
<Target Name="CopyAllNativeProjectReferenceBinaries" />
</Project>