-
Notifications
You must be signed in to change notification settings - Fork 391
/
Copy pathMicrosoft.Managed.DesignTime.targets
579 lines (454 loc) · 30.9 KB
/
Microsoft.Managed.DesignTime.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
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information. -->
<!--
This file contains Visual Studio and designer-related properties and items for managed projects.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Turn off capabilities from Microsoft.Common.CurrentVersions.targets and explicitly include the ones we want. The list below
currently matches what is in common targets, but removes BuildWindowsDesktopTarget -->
<DefineCommonItemSchemas>false</DefineCommonItemSchemas>
<DefineCommonCapabilities>false</DefineCommonCapabilities>
<DefineCommonReferenceSchemas>false</DefineCommonReferenceSchemas>
<DefineCommonManagedCapabilities Condition=" '$(DefineCommonManagedCapabilities)' == '' ">true</DefineCommonManagedCapabilities>
<DefineCommonManagedItemSchemas Condition=" '$(DefineCommonManagedItemSchemas)' == '' ">true</DefineCommonManagedItemSchemas>
<DefineCommonManagedReferenceSchemas Condition=" '$(DefineCommonManagedReferenceSchemas)' == '' ">true</DefineCommonManagedReferenceSchemas>
<!--This property sets the default output types supported by the project system.-->
<SupportedOutputTypes Condition="'$(SupportedOutputTypes)' == ''">Exe;WinExe;Library</SupportedOutputTypes>
<SuppressOutOfDateMessageOnBuild Condition="'$(SuppressOutOfDateMessageOnBuild)' == ''">true</SuppressOutOfDateMessageOnBuild>
<!-- Tells CPS which target to run for the Package solution build type -->
<PackageAction Condition="'$(PackageAction)' == ''">Pack</PackageAction>
</PropertyGroup>
<!-- Specify NuGet packages that are known to not work with Build Acceleration. -->
<ItemGroup Condition="'$(EnableDefaultBuildAccelerationIncompatiblePackages)' != 'false'">
<!-- Disable Build Acceleration for VSIX projects -->
<BuildAccelerationIncompatiblePackage Include="Microsoft.VSSDK.BuildTools" />
<!-- Slow Cheetah doesn't support Build Acceleration -->
<BuildAccelerationIncompatiblePackage Include="Microsoft.VisualStudio.SlowCheetah" />
</ItemGroup>
<PropertyGroup Condition="'$(AssemblyReferenceTabs)' == '' And '$(UsingMicrosoftNETSdk)' == 'true'">
<!-- You cannot choose individual framework assemblies in .NET Core/.NET Standard, and AssemblyFoldersEx
is not supported, so completely opt out of the Assembly category in Reference Manager by default. -->
<AssemblyReferenceTabs>0</AssemblyReferenceTabs>
<!-- However, .NET Framework supports choosing individual framework assemblies, so opt into that tab -->
<AssemblyReferenceTabs Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">TAB_ASSEMBLY_FRAMEWORK</AssemblyReferenceTabs>
</PropertyGroup>
<!--
Rule files that don't need localization go in the neutral directory to save duplicating files into each language
-->
<PropertyGroup Condition="'$(ManagedXamlNeutralResourcesDirectory)' == ''">
<ManagedXamlNeutralResourcesDirectory>$(MSBuildThisFileDirectory)</ManagedXamlNeutralResourcesDirectory>
</PropertyGroup>
<!--
Locate the appropriate localized xaml resources based on the language ID or name.
The logic here matches the resource manager sufficiently to handle the fixed set of
possible VS languages and directories on disk.
We cannot respect the exact probe order of the resource manager as this has to evaluate statically
and we have only LangName and LangID and no access to System.Globalization API.
-->
<PropertyGroup Condition="'$(ManagedXamlResourcesDirectory)' == ''">
<!-- 1. Probe for exact match against LangName. (e.g. pt-BR) -->
<ManagedXamlResourcesDirectory>$(MSBuildThisFileDirectory)$(LangName)</ManagedXamlResourcesDirectory>
<!-- 2. Handle special cases of languages which would not match above or below. -->
<ManagedXamlResourcesDirectory Condition="!Exists('$(ManagedXamlResourcesDirectory)') and '$(LangID)' == '2052'">$(MSBuildThisFileDirectory)zh-Hans</ManagedXamlResourcesDirectory>
<ManagedXamlResourcesDirectory Condition="!Exists('$(ManagedXamlResourcesDirectory)') and '$(LangID)' == '1028'">$(MSBuildThisFileDirectory)zh-Hant</ManagedXamlResourcesDirectory>
<!-- 3. Probe for parent by taking portion the portion before the hyphen (e.g. fr-FR -> fr) -->
<ManagedXamlResourcesDirectory Condition="!Exists('$(ManagedXamlResourcesDirectory)')">$(MSBuildThisFileDirectory)$(LangName.Split('-')[0])</ManagedXamlResourcesDirectory>
<!-- 4. Fall back to neutral resources if all of the above fail -->
<ManagedXamlResourcesDirectory Condition="!Exists('$(ManagedXamlResourcesDirectory)')">$(ManagedXamlNeutralResourcesDirectory)</ManagedXamlResourcesDirectory>
</PropertyGroup>
<PropertyGroup>
<ManagedXamlResourcesDirectory Condition="!HasTrailingSlash('$(ManagedXamlResourcesDirectory)')">$(ManagedXamlResourcesDirectory)\</ManagedXamlResourcesDirectory>
<DebuggerFlavor Condition = "'$(DebuggerFlavor)' == ''">ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<!-- Project Capabilities -->
<!-- Capabilities shared between shared projects & binary-producing projects. -->
<ItemGroup>
<ProjectCapability Include=".NET" />
</ItemGroup>
<!-- Capabilities for binary producing projects -->
<ItemGroup Condition="'$(DefineCommonManagedCapabilities)' == 'true'">
<ProjectCapability Include="UseFileGlobs"/>
<ProjectCapability Include="DynamicDependentFile"/>
<ProjectCapability Include="ConfigurableFileNesting" />
<!-- DependenciesTree capability lights up a Dependencies tree node and its sub node providers-->
<ProjectCapability Include="DependenciesTree" />
<ProjectCapability Include="ProjectImportsTree" />
<ProjectCapability Include="LaunchProfiles" />
<ProjectCapability Include="NoGeneralDependentFileIcon" />
<ProjectCapability Include="ProjectPropertyInterception" />
<ProjectCapability Include="PackageReferences" Condition="'$(RestoreProjectStyle)' == 'PackageReference'" />
<!--
List of capabilities below is adding back common capabilities defined in imported targets.
We disabled them with the property DefineCommonCapabilities=false to get rid of default
References capability, but everything else we want back.
-->
<ProjectCapability Include="
AssemblyReferences;
ProjectReferences;
WinRTReferences;
OutputGroups;
AllTargetOutputGroups;
VisualStudioWellKnownOutputGroups;
SingleFileGenerators;
DeclaredSourceItems;
UserSourceItems;
SupportAvailableItemName;
IntegratedConsoleDebugging;
DisableBuiltInDebuggerServices;
PersistDesignTimeDataOutOfProject;" />
<!-- COM references are not supported in .NET Core before 3.0 -->
<ProjectCapability Include="COMReferences" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' Or ('$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(_TargetFrameworkVersionWithoutV)' >= '3.0')" />
<!-- Settings page capability -->
<ProjectCapability Include="AppSettings" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' Or '$(UseWPF)' == 'true' Or '$(UseWindowsForms)' == 'true' " />
<!-- Publish capability enables the Publish command for the Project -->
<ProjectCapability Include="Publish" />
<ProjectCapability Include="FolderPublish" />
<!-- All Microsoft.NET.Sdk Exe projects, except WPF and WinForms exes, can be published to app service -->
<ProjectCapability Include="AppServicePublish" Condition="'$(OutputType)' == 'Exe'" />
<!-- Capabilities for WPF and WinForms -->
<ProjectCapability Include="WPF" Condition="'$(UseWPF)' == 'true'" />
<ProjectCapability Include="WindowsForms" Condition="'$(UseWindowsForms)' == 'true'" />
<ProjectCapability Include="DataSourceWindow" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' Or ('$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(_TargetFrameworkVersionWithoutV)' >= '3.0')" />
</ItemGroup>
<!-- List of well known rule Contexts that determine which catalog the rule shows up in CPS:
File - Rules that apply at a per-item level, or at the project level to apply defaults to project items.
Project - Rules that apply only at the project level.
PropertySheet - Rules that apply only to property sheets.
ProjectSubscriptionService - Rules that are invisible except for purposes of programmatic subscribing to project data.
Invisible - A special rule catalog for purposes of programmatic subscribing to project data.
BrowseObject - Rules that describe properties that appear in the Properties tool window while an item is selected in Solution Explorer.
ConfiguredBrowseObject - Rules that describe configured project properties. This context currently only supports the Xaml rule to define
configuration related project level properties.-->
<!-- Common Project System rules that override rules defined in msbuild. These are exact copy of the rules defined in msbuild. -->
<ItemGroup Condition="'$(DefineCommonManagedItemSchemas)' == 'true'">
<!-- Files/Folders schema -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ProjectItemsSchema.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<!-- Files/Folders -->
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)Compile.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)Compile.BrowseObject.xaml">
<Context>BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)Resource.BrowseObject.xaml">
<Context>BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)Content.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)Content.BrowseObject.xaml">
<Context>BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)EmbeddedResource.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)EmbeddedResource.BrowseObject.xaml">
<Context>BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)Folder.xaml">
<Context>File;BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)None.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)Resource.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)PackageVersion.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)None.BrowseObject.xaml">
<Context>BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)DebuggerGeneral.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ApplicationPropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)BuildPropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)CodeAnalysisPropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)ConfigurationGeneralPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)DebugPropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)SettingsPropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResourcesPropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)PackagePropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ExecutableDebugPropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ProjectDebugPropertyPage.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)GeneralBrowseObject.xaml">
<Context>BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)GeneralConfiguredBrowseObject.xaml">
<Context>ConfiguredBrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)ProjectDebugger.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)SdkSupportedTargetPlatformIdentifier.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)SdkSupportedTargetPlatformVersion.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)SupportedTargetFrameworkAlias.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)SupportedNETCoreAppTargetFramework.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)SupportedNETStandardTargetFramework.xaml">
<Context>Project</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)SupportedNETFrameworkTargetFramework.xaml">
<Context>Project</Context>
</PropertyPageSchema>
</ItemGroup>
<ItemGroup Condition="'$(DefineCommonManagedReferenceSchemas)' == 'true'">
<!-- Assembly references -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)AssemblyReference.xaml">
<Context>Project;BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResolvedAssemblyReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<!-- COM references -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)COMReference.xaml">
<Context>Project;BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResolvedCOMReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<!-- Framework references -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)FrameworkReference.xaml">
<Context>Project;BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResolvedFrameworkReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<!-- Project references -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ProjectReference.xaml">
<Context>Project;BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResolvedProjectReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<!-- Sdk references -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)SdkReference.xaml">
<Context>Project;ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResolvedSdkReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<!-- Package references -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)PackageReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResolvedPackageReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<!-- Analyzer references -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)AnalyzerReference.xaml">
<Context>Project;ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResolvedAnalyzerReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>
</ItemGroup>
<!-- List of external files that trigger re-evaluation & design-time builds when they are added or removed, or edited -->
<ItemGroup>
<!-- Potential Editor config locations, we only want to trigger design-time builds on removal/addition and not edits -->
<AdditionalDesignTimeBuildInput Include="@(PotentialEditorConfigFiles)" ContentSensitive="false" />
</ItemGroup>
<!-- Find all potential locations of "global.json" starting from the Solution directory and walking backwards -->
<ItemGroup Condition="'$(UsingMicrosoftNETSdk)' == 'true' and '$(SolutionDir)' != ''">
<_GlobalJsonStartingDir Include="$(SolutionDir)" />
<_PotentialContainingGlobalJsonDir Include="@(_GlobalJsonStartingDir->GetPathsOfAllDirectoriesAbove())" />
<AdditionalDesignTimeBuildInput Include="@(_PotentialContainingGlobalJsonDir->Combine('global.json'))" ContentSensitive="true" />
</ItemGroup>
<!--
EmbeddedFiles are source files to be embedded to the PDB.
We need to set Visible to false in order to not display duplicate entries in project UI.
-->
<ItemDefinitionGroup>
<EmbeddedFiles>
<Visible>false</Visible>
</EmbeddedFiles>
</ItemDefinitionGroup>
<!-- Targets -->
<!-- For a newly created project with no packages restored, design-time builds complain that there is no ResolvePackageDependenciesDesignTime
target, that is available only after restoring the .NET Core SDK targets. This no-op target will satisfy the check and will get overriden
once the actual targets are available after package restore-->
<Target Name="ResolvePackageDependenciesDesignTime" />
<Target Name="CollectSDKReferencesDesignTime" />
<Target Name="CollectResolvedSDKReferencesDesignTime" />
<Target Name="ResolveFrameworkReferences" />
<Target
Name="ResolveProjectReferencesDesignTime2"
Returns="@(_ProjectReferencesFromRAR2);@(_ProjectReferencesWithoutOutputAssembly)"
DependsOnTargets="ResolveProjectReferences;ResolveAssemblyReferences">
<!-- This is similar to ResolveProjectReferencesDesignTime, except it also returns projects that do not get
resolved (hence do not appear in ReferencePath) because ReferenceOutputAssembly is set to false. -->
<ItemGroup>
<!-- We need to do this here because we only want project references which have passed through RAR and have
not been unresolved due to violating some multi-targeting rule which means we need to pull the project
references out of the referencepath item because they will only exist there if they were correctly
resolved. -->
<_ProjectReferencesFromRAR2 Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))">
<OriginalItemSpec>%(ReferencePath.ProjectReferenceOriginalItemSpec)</OriginalItemSpec>
</_ProjectReferencesFromRAR2>
<_ProjectReferencesWithoutOutputAssembly Include="@(ProjectReference->WithMetadataValue('ReferenceOutputAssembly', 'false'))">
<OriginalItemSpec>%(ProjectReference.Identity)</OriginalItemSpec>
</_ProjectReferencesWithoutOutputAssembly>
</ItemGroup>
</Target>
<Target
Name="ResolveFrameworkReferencesDesignTime"
Returns="@(ResolvedFrameworkReference)"
DependsOnTargets="ResolveFrameworkReferences" />
<!-- This target is used to collect the PackageReferences in the project. This target can be overriden to add\remove packagereferences before they are
sent to NuGet to be restored.-->
<Target Name="CollectPackageReferences" Returns="@(PackageReference)" />
<!-- This target is used to collect the NuGet audit supression items. It is defined by the .NET SDK starting in version 8.0.400, but we need this no-op
implementation when using older SDKs that don't have it; otherwise our design-time builds will fail. The NuGet.targets file in the SDK is imported
_after_ this file, and will override this implementation with the real one (when present).
This can (and should) be removed when we no longer need to support SDKs older than 8.0.400. -->
<Target Name="CollectNuGetAuditSuppressions" Returns="@(NuGetAuditSuppress)" />
<!-- This target is used to collect the SuggestedWorkload items in the project.-->
<Target Name="CollectSuggestedWorkloads"
Returns="@(SuggestedWorkload)"
DependsOnTargets="GetSuggestedWorkloads"
Condition="'@(MissingWorkloadPack)' != '' And '$(UsingMicrosoftNETSdk)' == 'true'" />
<!-- Validates that the correct properties have been set for design-time compiles -->
<Target Name="_CheckCompileDesignTimePrerequisite">
<Error Condition="'$(SkipCompilerExecution)|$(ProvideCommandLineArgs)' != 'true|true'"
Text="SkipCompilerExecution and ProvideCommandLineArgs should be set before calling the CompileDesignTime target"
/>
</Target>
<!-- This target collects all Analyzers in the project. -->
<Target Name="CollectAnalyzersDesignTime" DependsOnTargets="CompileDesignTime" Returns="@(Analyzer)" />
<!-- This target collects all the resolved references that are used to actually compile. -->
<Target Name="CollectResolvedCompilationReferencesDesignTime" DependsOnTargets="CompileDesignTime" Returns="@(ReferencePathWithRefAssemblies)" />
<PropertyGroup Condition="'$(CollectUpToDateCheckInputDesignTimeDependsOn)' == ''">
<CollectUpToDateCheckInputDesignTimeDependsOn>CompileDesignTime</CollectUpToDateCheckInputDesignTimeDependsOn>
<!-- F# projects do not have the ResolveCodeAnalysisRuleSet target. -->
<CollectUpToDateCheckInputDesignTimeDependsOn Condition="'$(Language)' == 'C#' or '$(Language)' == 'VB'">$(CollectUpToDateCheckInputDesignTimeDependsOn);ResolveCodeAnalysisRuleSet</CollectUpToDateCheckInputDesignTimeDependsOn>
</PropertyGroup>
<!-- This target collects all the extra inputs for the up to date check. -->
<Target Name="CollectUpToDateCheckInputDesignTime" DependsOnTargets="$(CollectUpToDateCheckInputDesignTimeDependsOn)" Returns="@(UpToDateCheckInput)">
<ItemGroup>
<!-- app.manifest, if any -->
<UpToDateCheckInput Condition=" '$(ApplicationManifest)' != '' " Include="$(ApplicationManifest)" />
<!-- .ruleset file, if any -->
<UpToDateCheckInput Condition=" '$(ResolvedCodeAnalysisRuleSet)' != '' " Include="$(ResolvedCodeAnalysisRuleSet)" />
</ItemGroup>
</Target>
<PropertyGroup Condition="'$(CollectUpToDateCheckOutputDesignTimeDependsOn)' == ''">
<CollectUpToDateCheckOutputDesignTimeDependsOn>CompileDesignTime</CollectUpToDateCheckOutputDesignTimeDependsOn>
</PropertyGroup>
<!-- This target collects all the extra outputs for the up to date check. -->
<Target Name="CollectUpToDateCheckOutputDesignTime" DependsOnTargets="$(CollectUpToDateCheckOutputDesignTimeDependsOn)" Returns="@(UpToDateCheckOutput)" />
<PropertyGroup Condition="'$(CollectUpToDateCheckBuiltDesignTimeDependsOn)' == ''">
<CollectUpToDateCheckBuiltDesignTimeDependsOn>CompileDesignTime</CollectUpToDateCheckBuiltDesignTimeDependsOn>
</PropertyGroup>
<!-- This target collects all the things built by the project for the up to date check. -->
<!-- See CopyFileToOutputDirectory target -->
<Target Name="CollectUpToDateCheckBuiltDesignTime" DependsOnTargets="$(CollectUpToDateCheckBuiltDesignTimeDependsOn)" Returns="@(UpToDateCheckBuilt)">
<ItemGroup>
<!-- Assembly output, bin and obj -->
<UpToDateCheckBuilt Condition="'$(CopyBuildOutputToOutputDirectory)' != 'false' and '$(SkipCopyBuildProduct)' != 'true'" Include="$(TargetPath)" />
<UpToDateCheckBuilt Include="@(IntermediateAssembly)" />
<!-- Documentation file, bin and obj -->
<UpToDateCheckBuilt Condition="'$(_DocumentationFileProduced)'=='true'" Include="@(FinalDocFile)" />
<UpToDateCheckBuilt Condition="'$(_DocumentationFileProduced)'=='true'" Include="@(DocFileItem)" />
<!-- Symbols, bin and obj -->
<UpToDateCheckBuilt Condition="'$(_DebugSymbolsProduced)'=='true'" Include="@(_DebugSymbolsIntermediatePath)" />
<UpToDateCheckBuilt Condition="'$(_DebugSymbolsProduced)'=='true' and '$(SkipCopyingSymbolsToOutputDirectory)' != 'true' and '$(CopyOutputSymbolsToOutputDirectory)' != 'false'" Include="@(_DebugSymbolsOutputPath)" />
<!-- app.config -->
<!-- The property AppConfig, created in PrepareForBuild, is used instead of AppConfigWithTargetPath because GenerateSupportedRuntime
rewrites AppConfigWithTargetPath to point to the intermediate filename. This is needed because Fast up-to-date needs to compare
the timestamp of the source filename (AppConfig) with destination filename.
https://github.com/dotnet/msbuild/blob/d2f9dbccd913c5612fd3a3cb78b2524fbcb023da/src/Tasks/Microsoft.Common.CurrentVersion.targets#L1152-L1165
We skip this check if AppConfig is empty, which occurs for .NET Framework console apps. See https://github.com/dotnet/project-system/issues/6758.
-->
<UpToDateCheckBuilt Condition=" '@(AppConfigWithTargetPath)' != '' and '$(AppConfig)' != '' " Include="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')" Original="$(AppConfig)" />
</ItemGroup>
</Target>
<!-- Collect packages that are incompatible with Build Acceleration. -->
<PropertyGroup Condition="'$(CollectBuildAccelerationIncompatiblePackageDesignTimeDependsOn)' == ''">
<CollectBuildAccelerationIncompatiblePackageDesignTimeDependsOn></CollectBuildAccelerationIncompatiblePackageDesignTimeDependsOn>
</PropertyGroup>
<Target Name="CollectBuildAccelerationIncompatiblePackageDesignTime" DependsOnTargets="$(CollectBuildAccelerationIncompatiblePackageDesignTimeDependsOn)" Returns="@(BuildAccelerationIncompatiblePackage)" />
<!-- This target collects all the items this project contributes to output directories of referencing projects.
Ideally, it excludes any transitive dependencies.
-->
<Target
Name="CollectCopyToOutputDirectoryItemDesignTime"
DependsOnTargets="PrepareResourceNames;ComputeIntermediateSatelliteAssemblies;ResolveAssemblyReferences;CompileDesignTime;_GetCopyToOutputDirectoryItemsFromThisProject"
Returns="@(_CollectedCopyToOutputDirectoryItem)">
<ItemGroup>
<_CollectedCopyToOutputDirectoryItem Include="@(_ThisProjectItemsToCopyToOutputDirectory)">
<BuildAccelerationOnly>false</BuildAccelerationOnly>
</_CollectedCopyToOutputDirectoryItem>
<!-- Output assembly -->
<_CollectedCopyToOutputDirectoryItem Include="$(TargetPath)">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>$([System.IO.Path]::GetFileName('$(TargetPath)'))</TargetPath>
<BuildAccelerationOnly>true</BuildAccelerationOnly>
</_CollectedCopyToOutputDirectoryItem>
<!-- Debug symbols -->
<_CollectedCopyToOutputDirectoryItem Include="@(_DebugSymbolsOutputPath->'%(FullPath)')" Condition="'$(_DebugSymbolsProduced)' == 'true' and '$(SkipCopyingSymbolsToOutputDirectory)' != 'true' and '$(CopyOutputSymbolsToOutputDirectory)' != 'false'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>$([System.IO.Path]::GetFileName('%(Identity)'))</TargetPath>
<BuildAccelerationOnly>true</BuildAccelerationOnly>
</_CollectedCopyToOutputDirectoryItem>
<!-- ReferenceCopyLocalPaths
These come from two different sources, hence projecting twice here.
We filter out items that come from NuGet packages as there can be very many of them, and we exclude
them in the project system anyway, so it's better to drop them here (at the source). These items are
expected to be copied during an actual build, and need updating during subsequent incremental builds.
-->
<_CollectedCopyToOutputDirectoryItem Include="@(ReferenceCopyLocalPaths->'%(Identity)')" Condition="'%(ReferenceCopyLocalPaths.ReferenceSourceTarget)' != 'ProjectReference' AND '%(ReferenceCopyLocalPaths.DestinationSubPath)' != ''">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>%(ReferenceCopyLocalPaths.DestinationSubPath)</TargetPath>
<BuildAccelerationOnly>true</BuildAccelerationOnly>
</_CollectedCopyToOutputDirectoryItem>
<_CollectedCopyToOutputDirectoryItem Include="@(ReferenceCopyLocalPaths->'%(Identity)')" Condition="'%(ReferenceCopyLocalPaths.ReferenceSourceTarget)' != 'ProjectReference' AND '%(ReferenceCopyLocalPaths.DestinationSubPath)' == ''">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>$([System.IO.Path]::GetFileName('%(Identity)'))</TargetPath>
<BuildAccelerationOnly>true</BuildAccelerationOnly>
</_CollectedCopyToOutputDirectoryItem>
<!-- Documentation file -->
<_CollectedCopyToOutputDirectoryItem Include="@(FinalDocFile->'%(FullPath)')" Condition="'$(_DocumentationFileProduced)' == 'true'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>$([System.IO.Path]::GetFileName('%(Identity)'))</TargetPath>
<BuildAccelerationOnly>true</BuildAccelerationOnly>
</_CollectedCopyToOutputDirectoryItem>
<!-- Satellite assemblies -->
<_CollectedCopyToOutputDirectoryItem Include="@(IntermediateSatelliteAssembliesWithTargetPath->'$(TargetDir)%(Culture)\$(TargetName).resources.dll')" Condition="'@(IntermediateSatelliteAssembliesWithTargetPath)' != ''">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>%(IntermediateSatelliteAssembliesWithTargetPath.Culture)\$(TargetName).resources.dll</TargetPath>
<BuildAccelerationOnly>true</BuildAccelerationOnly>
</_CollectedCopyToOutputDirectoryItem>
</ItemGroup>
</Target>
</Project>