[Tizen] Add BuildTools 2.1.0-rc1-02804-05
[platform/upstream/coreclr.git] / Tools / dotnetcli / sdk / 2.1.2 / NuGet.targets
1 <!--
2 ***********************************************************************************************
3 NuGet.targets
4
5 WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
6           created a backup copy.  Incorrect changes to this file will make it
7           impossible to load or build your projects from the command-line or the IDE.
8
9 Copyright (c) .NET Foundation. All rights reserved.
10 ***********************************************************************************************
11
12   This target file contains the NuGet Restore target for walking the project and reference graph
13   and restoring dependencies from the graph.
14
15   Ways to use this targets file:
16   1. Invoke it directly and provide project file paths using $(RestoreGraphProjectInput).
17   2. With a solution this may be used as a target in the metaproj.
18   3. Import the targets file from a project.
19
20   Restore flow summary:
21   1. Top level projects (entry points) are determined.
22   2. Each project and all of its project references are walked recursively.
23   3. The project is evaluated for each $(TargetFramework). Items are created
24      for project properties and dependencies. Each item is marked
25      with the project it came from so that it can be matched up later.
26   4. All restore items generated by the walk are grouped together by
27      project and convert into a project spec.
28
29   The result file contains:
30   1. A list of projects to restore.
31   2. The complete closure of all projects referenced (Includes project references that are not being restored directly).
32   3. Package and project dependencies for each project.
33   4. DotnetCliTool references
34   -->
35 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
36   <PropertyGroup>
37     <!-- Mark that this target file has been loaded.  -->
38     <IsRestoreTargetsFileLoaded>true</IsRestoreTargetsFileLoaded>
39     <!-- Load NuGet.Build.Tasks.dll, this can be overridden to use a different version with $(RestoreTaskAssemblyFile) -->
40     <RestoreTaskAssemblyFile Condition=" '$(RestoreTaskAssemblyFile)' == '' ">NuGet.Build.Tasks.dll</RestoreTaskAssemblyFile>
41     <!-- Do not hide errors and warnings by default -->
42     <HideWarningsAndErrors Condition=" '$(HideWarningsAndErrors)' == '' ">false</HideWarningsAndErrors>
43     <!-- Recurse by default -->
44     <RestoreRecursive Condition=" '$(RestoreRecursive)' == '' ">true</RestoreRecursive>
45     <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
46     <!-- RuntimeIdentifier compatibility check -->
47     <ValidateRuntimeIdentifierCompatibility Condition=" '$(ValidateRuntimeIdentifierCompatibility)' == '' ">false</ValidateRuntimeIdentifierCompatibility>
48     <!-- Error handling while walking projects -->
49     <RestoreContinueOnError Condition=" '$(RestoreContinueOnError)' == '' ">WarnAndContinue</RestoreContinueOnError>
50   </PropertyGroup>
51
52   <PropertyGroup>
53     <!-- Generate a restore graph for each entry point project. -->
54     <_GenerateRestoreGraphProjectEntryInputProperties>
55       RestoreUseCustomAfterTargets=$(RestoreUseCustomAfterTargets);
56       NuGetRestoreTargets=$(MSBuildThisFileFullPath);
57       BuildProjectReferences=false;
58       ExcludeRestorePackageImports=true;
59     </_GenerateRestoreGraphProjectEntryInputProperties>
60
61     <!-- Standalone mode
62          This is used by NuGet.exe to inject targets into the project that will be
63          walked next. In normal /t:Restore mode this causes a duplicate import
64          since NuGet.targets it loaded as part of MSBuild, there is should be
65          skipped. -->
66     <_GenerateRestoreGraphProjectEntryInputProperties Condition=" '$(RestoreUseCustomAfterTargets)' == 'true' ">
67       $(_GenerateRestoreGraphProjectEntryInputProperties);
68       CustomAfterMicrosoftCommonCrossTargetingTargets=$(MSBuildThisFileFullPath);
69       CustomAfterMicrosoftCommonTargets=$(MSBuildThisFileFullPath);
70     </_GenerateRestoreGraphProjectEntryInputProperties>
71   </PropertyGroup>
72
73   <!-- Tasks -->
74   <UsingTask TaskName="NuGet.Build.Tasks.RestoreTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
75   <UsingTask TaskName="NuGet.Build.Tasks.WriteRestoreGraphTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
76   <UsingTask TaskName="NuGet.Build.Tasks.GetRestoreProjectJsonPathTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
77   <UsingTask TaskName="NuGet.Build.Tasks.GetRestoreProjectReferencesTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
78   <UsingTask TaskName="NuGet.Build.Tasks.GetRestorePackageReferencesTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
79   <UsingTask TaskName="NuGet.Build.Tasks.GetRestoreDotnetCliToolsTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
80   <UsingTask TaskName="NuGet.Build.Tasks.GetProjectTargetFrameworksTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
81   <UsingTask TaskName="NuGet.Build.Tasks.GetRestoreSolutionProjectsTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
82   <UsingTask TaskName="NuGet.Build.Tasks.GetRestoreSettingsTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
83   <UsingTask TaskName="NuGet.Build.Tasks.WarnForInvalidProjectsTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
84   <UsingTask TaskName="NuGet.Build.Tasks.GetReferenceNearestTargetFrameworkTask" AssemblyFile="$(RestoreTaskAssemblyFile)" />
85
86   <!--
87     ============================================================
88     Restore
89     Main entry point for restoring packages
90     ============================================================
91   -->
92   <Target Name="Restore" DependsOnTargets="_GenerateRestoreGraph">
93
94     <!-- Drop any duplicate items -->
95     <RemoveDuplicates
96       Inputs="@(_RestoreGraphEntry)">
97       <Output
98           TaskParameter="Filtered"
99           ItemName="_RestoreGraphEntryFiltered" />
100     </RemoveDuplicates>
101
102     <!-- Call restore -->
103     <RestoreTask
104       RestoreGraphItems="@(_RestoreGraphEntryFiltered)"
105       RestoreDisableParallel="$(RestoreDisableParallel)"
106       RestoreNoCache="$(RestoreNoCache)"
107       RestoreIgnoreFailedSources="$(RestoreIgnoreFailedSources)"
108       RestoreRecursive="$(RestoreRecursive)"
109       RestoreForce="$(RestoreForce)"
110       HideWarningsAndErrors="$(HideWarningsAndErrors)"/>
111   </Target>
112
113   <!--
114     ============================================================
115     GenerateRestoreGraphFile
116     Writes the output of _GenerateRestoreGraph to disk
117     ============================================================
118   -->
119   <Target Name="GenerateRestoreGraphFile" DependsOnTargets="_GenerateRestoreGraph">
120     <!-- Validate  -->
121     <Error Condition="$(RestoreGraphOutputPath) == ''" Text="Missing RestoreGraphOutputPath property!" />
122
123     <!-- Drop any duplicate items -->
124     <RemoveDuplicates
125         Inputs="@(_RestoreGraphEntry)">
126       <Output
127           TaskParameter="Filtered"
128           ItemName="_RestoreGraphEntryFiltered" />
129     </RemoveDuplicates>
130
131     <!-- Write file -->
132     <WriteRestoreGraphTask
133       RestoreGraphItems="@(_RestoreGraphEntryFiltered)"
134       RestoreGraphOutputPath="$(RestoreGraphOutputPath)"
135       RestoreRecursive="$(RestoreRecursive)" />
136   </Target>
137
138   <!--
139     ============================================================
140     CollectPackageReferences
141     Gathers all PackageReference items from the project.
142     This target may be used as an extension point to modify
143     package references before NuGet reads them.
144     ============================================================
145   -->
146   <Target Name="CollectPackageReferences" Returns="@(PackageReference)" />
147
148   <!--
149     ============================================================
150     _LoadRestoreGraphEntryPoints
151     Find project entry points and load them into items.
152     ============================================================
153   -->
154   <Target Name="_LoadRestoreGraphEntryPoints" Returns="@(RestoreGraphProjectInputItems)">
155
156     <!-- Allow overriding items with RestoreGraphProjectInput -->
157     <ItemGroup Condition=" @(RestoreGraphProjectInputItems) == '' ">
158       <RestoreGraphProjectInputItems Include="$(RestoreGraphProjectInput)" />
159     </ItemGroup>
160
161     <!-- Project case -->
162     <ItemGroup Condition=" $(MSBuildProjectFullPath.EndsWith('.metaproj')) != 'true' AND @(RestoreGraphProjectInputItems) == '' ">
163       <RestoreGraphProjectInputItems Include="$(MSBuildProjectFullPath)" />
164     </ItemGroup>
165
166     <!-- Solution case -->
167     <GetRestoreSolutionProjectsTask
168       Condition=" $(MSBuildProjectFullPath.EndsWith('.metaproj')) == 'true' AND @(RestoreGraphProjectInputItems) == '' "
169       ProjectReferences="@(ProjectReference)"
170       SolutionFilePath="$(MSBuildProjectFullPath)">
171       <Output
172         TaskParameter="OutputProjectReferences"
173         ItemName="RestoreGraphProjectInputItems" />
174     </GetRestoreSolutionProjectsTask>
175   </Target>
176
177   <!--
178     ============================================================
179     _FilterRestoreGraphProjectInputItems"
180     Filter out unsupported project entry points.
181     ============================================================
182   -->
183   <Target Name="_FilterRestoreGraphProjectInputItems" DependsOnTargets="_LoadRestoreGraphEntryPoints"
184     Returns="@(FilteredRestoreGraphProjectInputItems)">
185
186     <PropertyGroup>
187       <RestoreProjectFilterMode Condition=" '$(RestoreProjectFilterMode)' == '' ">exclusionlist</RestoreProjectFilterMode>
188     </PropertyGroup>
189
190     <!-- Filter to a list of known supported types -->
191     <ItemGroup Condition=" '$(RestoreProjectFilterMode)' == 'inclusionlist' ">
192       <_FilteredRestoreGraphProjectInputItemsTmp
193        Include="@(RestoreGraphProjectInputItems)"
194        Condition=" '%(RestoreGraphProjectInputItems.Extension)' == '.csproj' Or
195                    '%(RestoreGraphProjectInputItems.Extension)' == '.vbproj' Or
196                    '%(RestoreGraphProjectInputItems.Extension)' == '.fsproj' Or
197                    '%(RestoreGraphProjectInputItems.Extension)' == '.nuproj' Or
198                    '%(RestoreGraphProjectInputItems.Extension)' == '.msbuildproj' Or
199                    '%(RestoreGraphProjectInputItems.Extension)' == '.vcxproj' " />
200     </ItemGroup>
201
202     <!-- Filter out disallowed types -->
203     <ItemGroup Condition=" '$(RestoreProjectFilterMode)' == 'exclusionlist' ">
204       <_FilteredRestoreGraphProjectInputItemsTmp
205        Include="@(RestoreGraphProjectInputItems)"
206        Condition=" '%(RestoreGraphProjectInputItems.Extension)' != '.metaproj'
207                    AND '%(RestoreGraphProjectInputItems.Extension)' != '.shproj'
208                    AND '%(RestoreGraphProjectInputItems.Extension)' != '.vcxitems'
209                    AND '%(RestoreGraphProjectInputItems.Extension)' != '' " />
210     </ItemGroup>
211
212     <!-- No filtering -->
213     <ItemGroup Condition=" '$(RestoreProjectFilterMode)' != 'exclusionlist' AND '$(RestoreProjectFilterMode)' != 'inclusionlist' ">
214       <_FilteredRestoreGraphProjectInputItemsTmp
215         Include="@(RestoreGraphProjectInputItems)" />
216     </ItemGroup>
217
218     <!-- Remove duplicates -->
219     <RemoveDuplicates
220       Inputs="@(_FilteredRestoreGraphProjectInputItemsTmp)">
221       <Output
222           TaskParameter="Filtered"
223           ItemName="FilteredRestoreGraphProjectInputItemsWithoutDuplicates" />
224     </RemoveDuplicates>
225
226     <!-- Remove projects that do not support restore. -->
227     <MsBuild
228         Projects="@(FilteredRestoreGraphProjectInputItemsWithoutDuplicates)"
229         Targets="_IsProjectRestoreSupported"
230         ContinueOnError="$(RestoreContinueOnError)"
231         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
232                     %(_MSBuildProjectReferenceExistent.SetPlatform);
233                     $(_GenerateRestoreGraphProjectEntryInputProperties)"
234         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
235
236       <Output
237           TaskParameter="TargetOutputs"
238           ItemName="FilteredRestoreGraphProjectInputItems" />
239     </MsBuild>
240
241     <!-- Warn for projects that do not support restore. -->
242     <WarnForInvalidProjectsTask
243       Condition=" '$(DisableWarnForInvalidRestoreProjects)' != 'true' "
244       AllProjects="@(FilteredRestoreGraphProjectInputItemsWithoutDuplicates)"
245       ValidProjects="@(FilteredRestoreGraphProjectInputItems)" />
246   </Target>
247
248   <!--
249     ============================================================
250     _GenerateRestoreGraph
251     Entry point for creating the project to project restore graph.
252     ============================================================
253   -->
254   <Target Name="_GenerateRestoreGraph"
255         DependsOnTargets="_FilterRestoreGraphProjectInputItems;_GetAllRestoreProjectPathItems"
256         Returns="@(_RestoreGraphEntry)">
257     <Message Text="Generating dg file" Importance="low" />
258     <Message Text="%(_RestoreProjectPathItems.Identity)" Importance="low" />
259
260     <!-- Use all projects if RestoreRecursive is true. Otherwise use only the top level projects. -->
261     <ItemGroup>
262       <_GenerateRestoreGraphProjectEntryInput Include="@(FilteredRestoreGraphProjectInputItems)" Condition=" '$(RestoreRecursive)' != 'true' " />
263       <_GenerateRestoreGraphProjectEntryInput Include="@(_RestoreProjectPathItems)" Condition=" '$(RestoreRecursive)' == 'true' " />
264     </ItemGroup>
265
266     <!-- Process top level projects. -->
267     <MsBuild
268         Projects="@(_GenerateRestoreGraphProjectEntryInput)"
269         Targets="_GenerateRestoreGraphProjectEntry"
270         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
271                     %(_MSBuildProjectReferenceExistent.SetPlatform);
272                     $(_GenerateRestoreGraphProjectEntryInputProperties)"
273         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
274
275       <Output
276           TaskParameter="TargetOutputs"
277           ItemName="_RestoreGraphEntry" />
278     </MsBuild>
279
280     <!-- Generate a spec for every project including dependencies. -->
281     <MsBuild
282         Projects="@(_RestoreProjectPathItems)"
283         Targets="_GenerateProjectRestoreGraph"
284         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
285                     %(_MSBuildProjectReferenceExistent.SetPlatform);
286                     $(_GenerateRestoreGraphProjectEntryInputProperties)"
287         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
288
289       <Output
290           TaskParameter="TargetOutputs"
291           ItemName="_RestoreGraphEntry" />
292     </MsBuild>
293   </Target>
294
295   <!--
296     ============================================================
297     _GenerateRestoreGraphProjectEntry
298     Top level entry point within a project.
299     ============================================================
300   -->
301   <Target Name="_GenerateRestoreGraphProjectEntry"
302           DependsOnTargets="_GenerateRestoreSpecs;_GenerateDotnetCliToolReferenceSpecs"
303           Returns="@(_RestoreGraphEntry)">
304     <!-- Returns restore graph entries for the project and all dependencies -->
305   </Target>
306
307   <!--
308     ============================================================
309     _GenerateRestoreSpecs
310     Mark entry points for restore.
311     ============================================================
312   -->
313   <Target Name="_GenerateRestoreSpecs"
314       DependsOnTargets="_GetRestoreProjectStyle"
315       Returns="@(_RestoreGraphEntry)">
316     <Message Text="Restore entry point $(MSBuildProjectFullPath)" Importance="low" />
317
318     <!-- Mark entry point -->
319     <ItemGroup Condition=" '$(RestoreProjects)' == '' OR '$(RestoreProjects)' == 'true' ">
320       <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())" Condition=" '$(RestoreProjectStyle)' != 'Unknown' ">
321         <Type>RestoreSpec</Type>
322         <ProjectUniqueName>$(MSBuildProjectFullPath)</ProjectUniqueName>
323       </_RestoreGraphEntry>
324     </ItemGroup>
325   </Target>
326
327   <!--
328     ============================================================
329     _GenerateDotnetCliToolReferenceSpecs
330     Collect DotnetCliToolReferences
331     ============================================================
332   -->
333   <Target Name="_GenerateDotnetCliToolReferenceSpecs"
334       DependsOnTargets="_GetRestoreSettings"
335       Returns="@(_RestoreGraphEntry)">
336
337     <PropertyGroup>
338       <DotnetCliToolTargetFramework Condition=" '$(DotnetCliToolTargetFramework)' == '' ">netcoreapp1.0</DotnetCliToolTargetFramework>
339     </PropertyGroup>
340
341     <!-- Write out tool references -->
342     <GetRestoreDotnetCliToolsTask
343       Condition=" '$(RestoreDotnetCliToolReferences)' == '' OR '$(RestoreDotnetCliToolReferences)' == 'true' "
344       ProjectPath="$(MSBuildProjectFullPath)"
345       ToolFramework="$(DotnetCliToolTargetFramework)"
346       RestorePackagesPath="$(_OutputPackagesPath)"
347       RestoreFallbackFolders="$(_OutputFallbackFolders)"
348       RestoreSources="$(_OutputSources)"
349       RestoreConfigFilePaths="$(_OutputConfigFilePaths)"
350       DotnetCliToolReferences="@(DotnetCliToolReference)">
351
352       <Output
353         TaskParameter="RestoreGraphItems"
354         ItemName="_RestoreGraphEntry" />
355     </GetRestoreDotnetCliToolsTask>
356
357   </Target>
358
359   <!--
360     ============================================================
361     _GetProjectJsonPath
362     Discover the project.json path if one exists for the project.
363     ============================================================
364   -->
365   <Target Name="_GetProjectJsonPath"
366     Returns="$(_CurrentProjectJsonPath)">
367     <!-- Get project.json path -->
368     <!-- Skip this if the project style is already set. -->
369     <GetRestoreProjectJsonPathTask
370       ProjectPath="$(MSBuildProjectFullPath)"
371       Condition=" '$(RestoreProjectStyle)' == 'ProjectJson' OR '$(RestoreProjectStyle)' == '' ">
372       <Output TaskParameter="ProjectJsonPath" PropertyName="_CurrentProjectJsonPath" />
373     </GetRestoreProjectJsonPathTask>
374   </Target>
375
376   <!--
377     ============================================================
378     _GetRestoreProjectStyle
379     Determine the project restore type.
380     ============================================================
381   -->
382   <Target Name="_GetRestoreProjectStyle"
383     DependsOnTargets="_GetProjectJsonPath;CollectPackageReferences"
384     Returns="$(RestoreProjectStyle)">
385     <!-- This may be overridden by setting RestoreProjectStyle in the project. -->
386     <PropertyGroup>
387       <!-- If any PackageReferences exist treat it as PackageReference. This has priority over project.json. -->
388       <RestoreProjectStyle Condition=" '$(RestoreProjectStyle)' == '' AND @(PackageReference) != '' ">PackageReference</RestoreProjectStyle>
389       <!-- If this is not a PackageReference project check if project.json or projectName.project.json exists. -->
390       <RestoreProjectStyle Condition=" '$(RestoreProjectStyle)' == '' AND '$(_CurrentProjectJsonPath)' != '' ">ProjectJson</RestoreProjectStyle>
391       <!-- This project is either a packages.config project or one that does not use NuGet at all. -->
392       <RestoreProjectStyle Condition=" '$(RestoreProjectStyle)' == '' ">Unknown</RestoreProjectStyle>
393     </PropertyGroup>
394   </Target>
395
396   <!--
397     ============================================================
398     _GetRestoreTargetFrameworksOutput
399     Read target frameworks from the project.
400     ============================================================
401   -->
402   <Target Name="_GetRestoreTargetFrameworksOutput"
403     DependsOnTargets="_GetRestoreProjectStyle"
404     Returns="@(_RestoreTargetFrameworksOutputFiltered)">
405
406     <PropertyGroup>
407       <_RestoreProjectFramework></_RestoreProjectFramework>
408     </PropertyGroup>
409
410     <!-- For project.json projects target frameworks will be read from project.json. -->
411     <GetProjectTargetFrameworksTask
412       Condition=" '$(RestoreProjectStyle)' != 'ProjectJson' "
413       ProjectPath="$(MSBuildProjectFullPath)"
414       TargetFrameworks="$(TargetFrameworks)"
415       TargetFramework="$(TargetFramework)"
416       TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
417       TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
418       TargetPlatformVersion="$(TargetPlatformVersion)"
419       TargetPlatformMinVersion="$(TargetPlatformMinVersion)">
420       <Output
421         TaskParameter="ProjectTargetFrameworks"
422         PropertyName="_RestoreProjectFramework" />
423     </GetProjectTargetFrameworksTask>
424
425     <ItemGroup Condition=" '$(_RestoreProjectFramework)' != '' ">
426       <_RestoreTargetFrameworksOutputFiltered Include="$(_RestoreProjectFramework.Split(';'))" />
427     </ItemGroup>
428   </Target>
429
430   <!--
431     ============================================================
432     _GetRestoreTargetFrameworksAsItems
433     Get the set of $(TargetFramework) and $(TargetFrameworks)
434     values that should be used for inner builds.
435     ============================================================
436   -->
437   <Target Name="_GetRestoreTargetFrameworksAsItems"
438     DependsOnTargets="_GetRestoreProjectStyle;_GetRestoreTargetFrameworksOutput"
439     Returns="@(_RestoreTargetFrameworkItems)">
440
441     <PropertyGroup>
442       <_RestoreTargetFrameworkItemsHasValues Condition=" '$(TargetFramework)' != '' OR '$(TargetFrameworks)' != '' ">true</_RestoreTargetFrameworkItemsHasValues>
443     </PropertyGroup>
444
445     <!-- Only return values for NETCore PackageReference projects -->
446     <ItemGroup Condition=" '$(RestoreProjectStyle)' == 'PackageReference' AND '$(_RestoreTargetFrameworkItemsHasValues)' == 'true' ">
447       <_RestoreTargetFrameworkItems Include="@(_RestoreTargetFrameworksOutputFiltered)" />
448     </ItemGroup>
449   </Target>
450
451   <!--
452     ============================================================
453     _GetRestoreSettings
454     ============================================================
455   -->
456   <Target Name="_GetRestoreSettings"
457           DependsOnTargets="_GetRestoreProjectStyle;_GetRestoreSettingsOverrides;_GetRestoreTargetFrameworksAsItems"
458           Returns="$(_OutputSources);$(_OutputPackagesPath);$(_OutputFallbackFolders);$(_OutputConfigFilePaths)">
459
460     <!-- Read additional sources and fallback folders for each framework  -->
461     <MSBuild
462       Condition=" '$(RestoreProjectStyle)' == 'PackageReference' "
463       Projects="$(MSBuildProjectFullPath)"
464       Targets="_GetRestoreSettingsPerFramework"
465       Properties="TargetFramework=%(_RestoreTargetFrameworkItems.Identity);
466                   %(_MSBuildProjectReferenceExistent.SetConfiguration);
467                   %(_MSBuildProjectReferenceExistent.SetPlatform);
468                   $(_GenerateRestoreGraphProjectEntryInputProperties)"
469       RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
470
471       <Output
472           TaskParameter="TargetOutputs"
473           ItemName="_RestoreSettingsPerFramework" />
474     </MSBuild>
475
476     <!-- For transitive project styles, we rely on evaluating all the settings and including them in the dg spec to faciliate no-op restore-->
477     <GetRestoreSettingsTask Condition=" '$(RestoreProjectStyle)' == 'PackageReference' OR '$(RestoreProjectStyle)' == 'ProjectJson' "
478      ProjectUniqueName="$(MSBuildProjectFullPath)"
479      RestoreSources="$(RestoreSources)"
480      RestorePackagesPath="$(RestorePackagesPath)"
481      RestoreFallbackFolders="$(RestoreFallbackFolders)"
482      RestoreConfigFile="$(RestoreConfigFile)"
483      RestoreSolutionDirectory="$(RestoreSolutionDirectory)"
484      RestoreSettingsPerFramework="@(_RestoreSettingsPerFramework)"
485      RestorePackagesPathOverride="$(_RestorePackagesPathOverride)"
486      RestoreSourcesOverride="$(_RestoreSourcesOverride)"
487      RestoreFallbackFoldersOverride="$(_RestoreFallbackFoldersOverride)"
488      MSBuildStartupDirectory="$(MSBuildStartupDirectory)">
489       <Output
490         TaskParameter="OutputSources"
491         PropertyName="_OutputSources" />
492       <Output
493         TaskParameter="OutputPackagesPath"
494         PropertyName="_OutputPackagesPath" />
495       <Output
496         TaskParameter="OutputFallbackFolders"
497         PropertyName="_OutputFallbackFolders" />
498       <Output
499         TaskParameter="OutputConfigFilePaths"
500         PropertyName="_OutputConfigFilePaths" />
501     </GetRestoreSettingsTask>
502   </Target>
503
504   <!--
505     ============================================================
506     _GetRestoreSettingsPerFramework
507     Generate items with framework specific settings.
508     ============================================================
509   -->
510   <Target Name="_GetRestoreSettingsPerFramework"
511     Returns="@(_RestoreSettingsPerFramework)">
512
513     <ItemGroup>
514       <_RestoreSettingsPerFramework Include="$([System.Guid]::NewGuid())">
515         <RestoreAdditionalProjectSources>$(RestoreAdditionalProjectSources)</RestoreAdditionalProjectSources>
516         <RestoreAdditionalProjectFallbackFolders>$(RestoreAdditionalProjectFallbackFolders)</RestoreAdditionalProjectFallbackFolders>
517         <RestoreAdditionalProjectFallbackFoldersExcludes>$(RestoreAdditionalProjectFallbackFoldersExcludes)</RestoreAdditionalProjectFallbackFoldersExcludes>
518       </_RestoreSettingsPerFramework>
519     </ItemGroup>
520   </Target>
521
522   <!--
523     ============================================================
524     _GenerateRestoreProjectSpec
525     Generate a restore project spec for the current project.
526     ============================================================
527   -->
528   <Target Name="_GenerateRestoreProjectSpec"
529     DependsOnTargets="_GetRestoreProjectStyle;_GetRestoreTargetFrameworksOutput;_GetRestoreSettings"
530     Returns="@(_RestoreGraphEntry)">
531
532     <!-- Determine the restore output path -->
533     <PropertyGroup Condition=" '$(RestoreProjectStyle)' == 'PackageReference' OR '$(RestoreProjectStyle)' == 'ProjectJson' ">
534       <RestoreOutputPath Condition=" '$(RestoreOutputPath)' == '' " >$(BaseIntermediateOutputPath)</RestoreOutputPath>
535     </PropertyGroup>
536
537     <ConvertToAbsolutePath Paths="$(RestoreOutputPath)" Condition=" '$(RestoreProjectStyle)' == 'PackageReference' OR '$(RestoreProjectStyle)' == 'ProjectJson'">
538       <Output TaskParameter="AbsolutePaths" PropertyName="RestoreOutputAbsolutePath" />
539     </ConvertToAbsolutePath>
540
541     <!--
542       Determine project name for the assets file.
543       Highest priority: PackageId
544       If PackageId does not exist use: AssemblyName
545       If AssemblyName does not exist fallback to the project file name without the extension: $(MSBuildProjectName)
546
547       For non-NETCore projects use only: $(MSBuildProjectName)
548     -->
549     <PropertyGroup>
550       <_RestoreProjectName>$(MSBuildProjectName)</_RestoreProjectName>
551       <_RestoreProjectName Condition=" '$(RestoreProjectStyle)' == 'PackageReference' AND '$(AssemblyName)' != '' ">$(AssemblyName)</_RestoreProjectName>
552       <_RestoreProjectName Condition=" '$(RestoreProjectStyle)' == 'PackageReference' AND '$(PackageId)' != '' ">$(PackageId)</_RestoreProjectName>
553     </PropertyGroup>
554
555     <!--
556       Determine project version for .NETCore projects
557       Default to 1.0.0
558       Use Version if it exists
559       Override with PackageVersion if it exists (same as pack)
560     -->
561     <PropertyGroup Condition=" '$(RestoreProjectStyle)' == 'PackageReference' ">
562       <_RestoreProjectVersion>1.0.0</_RestoreProjectVersion>
563       <_RestoreProjectVersion Condition=" '$(Version)' != '' ">$(Version)</_RestoreProjectVersion>
564       <_RestoreProjectVersion Condition=" '$(PackageVersion)' != '' ">$(PackageVersion)</_RestoreProjectVersion>
565     </PropertyGroup>
566
567     <!-- Determine if this will use cross targeting -->
568     <PropertyGroup Condition=" '$(RestoreProjectStyle)' == 'PackageReference' AND '$(TargetFrameworks)' != '' ">
569       <_RestoreCrossTargeting>true</_RestoreCrossTargeting>
570     </PropertyGroup>
571
572     <!-- Determine if ContentFiles should be written by NuGet -->
573     <PropertyGroup Condition=" '$(RestoreProjectStyle)' == 'PackageReference' AND '$(_RestoreSkipContentFileWrite)' == '' ">
574       <_RestoreSkipContentFileWrite Condition=" '$(TargetFrameworks)' == '' AND '$(TargetFramework)' == '' ">true</_RestoreSkipContentFileWrite>
575     </PropertyGroup>
576
577     <!-- Write properties for the top level entry point -->
578     <ItemGroup Condition=" '$(RestoreProjectStyle)' == 'PackageReference' ">
579       <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())">
580         <Type>ProjectSpec</Type>
581         <Version>$(_RestoreProjectVersion)</Version>
582         <ProjectUniqueName>$(MSBuildProjectFullPath)</ProjectUniqueName>
583         <ProjectPath>$(MSBuildProjectFullPath)</ProjectPath>
584         <ProjectName>$(_RestoreProjectName)</ProjectName>
585         <Sources>$(_OutputSources)</Sources>
586         <FallbackFolders>$(_OutputFallbackFolders)</FallbackFolders>
587         <PackagesPath>$(_OutputPackagesPath)</PackagesPath>
588         <ProjectStyle>$(RestoreProjectStyle)</ProjectStyle>
589         <OutputPath>$(RestoreOutputAbsolutePath)</OutputPath>
590         <TargetFrameworks>@(_RestoreTargetFrameworksOutputFiltered)</TargetFrameworks>
591         <RuntimeIdentifiers>$(RuntimeIdentifiers);$(RuntimeIdentifier)</RuntimeIdentifiers>
592         <RuntimeSupports>$(RuntimeSupports)</RuntimeSupports>
593         <CrossTargeting>$(_RestoreCrossTargeting)</CrossTargeting>
594         <RestoreLegacyPackagesDirectory>$(RestoreLegacyPackagesDirectory)</RestoreLegacyPackagesDirectory>
595         <ValidateRuntimeAssets>$(ValidateRuntimeIdentifierCompatibility)</ValidateRuntimeAssets>
596         <SkipContentFileWrite>$(_RestoreSkipContentFileWrite)</SkipContentFileWrite>
597         <ConfigFilePaths>$(_OutputConfigFilePaths)</ConfigFilePaths>
598         <TreatWarningsAsErrors>$(TreatWarningsAsErrors)</TreatWarningsAsErrors>
599         <WarningsAsErrors>$(WarningsAsErrors)</WarningsAsErrors>
600         <NoWarn>$(NoWarn)</NoWarn>
601       </_RestoreGraphEntry>
602     </ItemGroup>
603
604     <!-- Use project.json -->
605     <ItemGroup Condition=" '$(RestoreProjectStyle)' == 'ProjectJson' ">
606       <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())">
607         <Type>ProjectSpec</Type>
608         <ProjectUniqueName>$(MSBuildProjectFullPath)</ProjectUniqueName>
609         <ProjectPath>$(MSBuildProjectFullPath)</ProjectPath>
610         <ProjectName>$(_RestoreProjectName)</ProjectName>
611         <Sources>$(_OutputSources)</Sources>
612         <OutputPath>$(RestoreOutputAbsolutePath)</OutputPath>
613         <FallbackFolders>$(_OutputFallbackFolders)</FallbackFolders>
614         <PackagesPath>$(_OutputPackagesPath)</PackagesPath>
615         <ProjectJsonPath>$(_CurrentProjectJsonPath)</ProjectJsonPath>
616         <ProjectStyle>$(RestoreProjectStyle)</ProjectStyle>
617         <ConfigFilePaths>$(_OutputConfigFilePaths)</ConfigFilePaths>
618       </_RestoreGraphEntry>
619     </ItemGroup>
620
621     <!-- Non-NuGet type -->
622     <ItemGroup Condition=" '$(RestoreProjectStyle)' == 'Unknown' ">
623       <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())">
624         <Type>ProjectSpec</Type>
625         <ProjectUniqueName>$(MSBuildProjectFullPath)</ProjectUniqueName>
626         <ProjectPath>$(MSBuildProjectFullPath)</ProjectPath>
627         <ProjectName>$(_RestoreProjectName)</ProjectName>
628         <ProjectStyle>$(RestoreProjectStyle)</ProjectStyle>
629         <TargetFrameworks>@(_RestoreTargetFrameworksOutputFiltered)</TargetFrameworks>
630       </_RestoreGraphEntry>
631     </ItemGroup>
632   </Target>
633
634   <!--
635     ============================================================
636     _GenerateRestoreDependencies
637     Generate items for package and project references.
638     ============================================================
639   -->
640   <Target Name="_GenerateRestoreDependencies"
641     DependsOnTargets="_GetRestoreProjectStyle;_GetRestoreTargetFrameworksAsItems"
642     Returns="@(_RestoreGraphEntry)">
643
644     <!-- Get project and package references  -->
645     <!-- Evaluate for each framework -->
646     <MSBuild
647       Projects="$(MSBuildProjectFullPath)"
648       Targets="_GenerateProjectRestoreGraphPerFramework"
649       Properties="TargetFramework=%(_RestoreTargetFrameworkItems.Identity);
650                   %(_MSBuildProjectReferenceExistent.SetConfiguration);
651                   %(_MSBuildProjectReferenceExistent.SetPlatform);
652                   $(_GenerateRestoreGraphProjectEntryInputProperties)"
653       RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
654
655       <Output
656           TaskParameter="TargetOutputs"
657           ItemName="_RestoreGraphEntry" />
658     </MSBuild>
659   </Target>
660
661   <!--
662     ============================================================
663     _GenerateProjectRestoreGraph
664     Recursively walk project to project references.
665     ============================================================
666   -->
667   <Target Name="_GenerateProjectRestoreGraph"
668       DependsOnTargets="
669       _GetRestoreProjectStyle;
670       _GetRestoreTargetFrameworksOutput;
671       _GenerateRestoreProjectSpec;
672       _GenerateRestoreDependencies"
673       Returns="@(_RestoreGraphEntry)">
674
675     <!-- Output from dependency targets -->
676   </Target>
677
678   <!--
679     ============================================================
680     _GenerateProjectRestoreGraphPerFramework
681     Walk dependencies using $(TargetFramework)
682     ============================================================
683   -->
684   <Target Name="_GenerateProjectRestoreGraphPerFramework"
685     DependsOnTargets="_GetRestoreProjectStyle;CollectPackageReferences"
686     Returns="@(_RestoreGraphEntry)">
687
688     <!-- Write out project references -->
689     <GetRestoreProjectReferencesTask
690       ProjectUniqueName="$(MSBuildProjectFullPath)"
691       ProjectReferences="@(ProjectReference)"
692       TargetFrameworks="$(TargetFramework)"
693       ParentProjectPath="$(MSBuildProjectFullPath)">
694
695       <Output
696         TaskParameter="RestoreGraphItems"
697         ItemName="_RestoreGraphEntry" />
698     </GetRestoreProjectReferencesTask>
699
700     <!-- Write out package references for NETCore -->
701     <GetRestorePackageReferencesTask
702       Condition=" '$(RestoreProjectStyle)' == 'PackageReference' "
703       ProjectUniqueName="$(MSBuildProjectFullPath)"
704       PackageReferences="@(PackageReference)"
705       TargetFrameworks="$(TargetFramework)">
706
707       <Output
708         TaskParameter="RestoreGraphItems"
709         ItemName="_RestoreGraphEntry" />
710     </GetRestorePackageReferencesTask>
711
712     <PropertyGroup>
713       <_CombinedFallbacks>$(PackageTargetFallback);$(AssetTargetFallback)</_CombinedFallbacks>
714     </PropertyGroup>
715
716     <!-- Write out target framework information -->
717     <ItemGroup Condition="  '$(RestoreProjectStyle)' == 'PackageReference' AND '$(_CombinedFallbacks)' != '' ">
718       <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())">
719         <Type>TargetFrameworkInformation</Type>
720         <ProjectUniqueName>$(MSBuildProjectFullPath)</ProjectUniqueName>
721         <PackageTargetFallback>$(PackageTargetFallback)</PackageTargetFallback>
722         <AssetTargetFallback>$(AssetTargetFallback)</AssetTargetFallback>
723         <TargetFramework>$(TargetFramework)</TargetFramework>
724       </_RestoreGraphEntry>
725     </ItemGroup>
726   </Target>
727
728   <!--
729     ============================================================
730     _GenerateRestoreProjectPathItemsPerFramework
731     Get absolute paths for all project references.
732     ============================================================
733   -->
734   <Target Name="_GenerateRestoreProjectPathItemsPerFramework"
735     Returns="@(_RestoreProjectPathItems)">
736
737     <!-- Get the absolute paths to all projects -->
738     <ConvertToAbsolutePath Paths="@(ProjectReference)">
739       <Output TaskParameter="AbsolutePaths" PropertyName="_RestoreGraphAbsoluteProjectPaths" />
740     </ConvertToAbsolutePath>
741
742     <ItemGroup>
743       <_RestoreProjectPathItems Include="$(_RestoreGraphAbsoluteProjectPaths)" />
744     </ItemGroup>
745   </Target>
746
747   <!--
748     ============================================================
749     _GenerateRestoreProjectPathItems
750     Get all project references regardless of framework
751     ============================================================
752   -->
753   <Target Name="_GenerateRestoreProjectPathItems"
754     DependsOnTargets="_GetRestoreTargetFrameworksOutput;_GetRestoreTargetFrameworksAsItems"
755     Returns="@(_CurrentRestoreProjectPathItems)">
756
757     <!-- Get all project references for the current project  -->
758     <MSBuild
759       Projects="$(MSBuildProjectFullPath)"
760       Targets="_GenerateRestoreProjectPathItemsPerFramework"
761       ContinueOnError="$(RestoreContinueOnError)"
762       Properties="TargetFramework=%(_RestoreTargetFrameworkItems.Identity);
763                   %(_MSBuildProjectReferenceExistent.SetConfiguration);
764                   %(_MSBuildProjectReferenceExistent.SetPlatform);
765                   $(_GenerateRestoreGraphProjectEntryInputProperties)"
766       RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
767
768       <Output
769           TaskParameter="TargetOutputs"
770           ItemName="_CurrentRestoreProjectPathItemsOutputs" />
771     </MSBuild>
772
773     <!-- Drop any duplicate items -->
774     <RemoveDuplicates
775       Inputs="@(_CurrentRestoreProjectPathItemsOutputs)">
776       <Output
777           TaskParameter="Filtered"
778           ItemName="_CurrentRestoreProjectPathItems" />
779     </RemoveDuplicates>
780   </Target>
781
782   <!--
783     ============================================================
784     _GenerateRestoreProjectPathWalk
785     Recursively walk projects
786     ============================================================
787   -->
788   <Target Name="_GenerateRestoreProjectPathWalk"
789     DependsOnTargets="_GenerateRestoreProjectPathItems;_GetRestoreTargetFrameworksAsItems"
790     Returns="@(_RestoreProjectPathItems)">
791
792     <!-- Walk project references  -->
793     <MSBuild
794       Projects="@(_CurrentRestoreProjectPathItems)"
795       Targets="_GenerateRestoreProjectPathWalk"
796       ContinueOnError="$(RestoreContinueOnError)"
797       Properties="TargetFramework=%(_RestoreTargetFrameworkItems.Identity);
798                   %(_MSBuildProjectReferenceExistent.SetConfiguration);
799                   %(_MSBuildProjectReferenceExistent.SetPlatform);
800                   $(_GenerateRestoreGraphProjectEntryInputProperties)"
801       RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
802
803       <Output
804           TaskParameter="TargetOutputs"
805           ItemName="_GenerateRestoreProjectPathWalkOutputs" />
806     </MSBuild>
807
808     <!-- Include the current project in the result -->
809     <ItemGroup>
810       <_GenerateRestoreProjectPathWalkOutputs Include="$(MSBuildProjectFullPath)" />
811     </ItemGroup>
812
813     <!-- Remove duplicates -->
814     <RemoveDuplicates
815       Inputs="@(_GenerateRestoreProjectPathWalkOutputs)">
816       <Output
817           TaskParameter="Filtered"
818           ItemName="_RestoreProjectPathItems" />
819     </RemoveDuplicates>
820   </Target>
821
822   <!--
823     ============================================================
824     _GetAllRestoreProjectPathItems
825     Get the full list of known projects.
826     This includes all child projects from all target frameworks.
827     ============================================================
828   -->
829   <Target Name="_GetAllRestoreProjectPathItems"
830           DependsOnTargets="_FilterRestoreGraphProjectInputItems"
831           Returns="@(_RestoreProjectPathItems)">
832
833     <!-- Walk projects -->
834     <MsBuild
835         Projects="@(FilteredRestoreGraphProjectInputItems)"
836         Targets="_GenerateRestoreProjectPathWalk"
837         ContinueOnError="$(RestoreContinueOnError)"
838         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
839                     %(_MSBuildProjectReferenceExistent.SetPlatform);
840                     $(_GenerateRestoreGraphProjectEntryInputProperties)"
841         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
842
843       <Output
844           TaskParameter="TargetOutputs"
845           ItemName="_RestoreProjectPathItemsOutputs" />
846     </MsBuild>
847
848     <!-- Remove duplicates -->
849     <RemoveDuplicates
850       Inputs="@(_RestoreProjectPathItemsOutputs)">
851       <Output
852           TaskParameter="Filtered"
853           ItemName="_RestoreProjectPathItemsWithoutDupes" />
854     </RemoveDuplicates>
855
856     <!-- Remove projects that do not support restore. -->
857     <MsBuild
858         Projects="@(_RestoreProjectPathItemsWithoutDupes)"
859         Targets="_IsProjectRestoreSupported"
860         ContinueOnError="$(RestoreContinueOnError)"
861         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
862                     %(_MSBuildProjectReferenceExistent.SetPlatform);
863                     $(_GenerateRestoreGraphProjectEntryInputProperties)"
864         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
865
866       <Output
867           TaskParameter="TargetOutputs"
868           ItemName="_RestoreProjectPathItems" />
869     </MsBuild>
870   </Target>
871
872   <!--
873     ============================================================
874     _GetRestoreSettingsOverrides
875     Get global property overrides that should be resolved
876     against the current working directory instead of the project.
877     This is done by calling into NuGet.targets in a new scope,
878     project properties will not be returned by the calls below.
879     ============================================================
880   -->
881   <Target Name="_GetRestoreSettingsOverrides"
882           Returns="$(_RestorePackagesPathOverride);$(_RestoreSourcesOverride);$(_RestoreFallbackFoldersOverride)">
883
884     <!-- RestorePackagesPathOverride -->
885     <MsBuild
886         Condition=" '$(RestorePackagesPath)' != '' "
887         Projects="$(MSBuildThisFileFullPath)"
888         Targets="_GetRestorePackagesPathOverride"
889         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
890                     %(_MSBuildProjectReferenceExistent.SetPlatform);"
891         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
892
893       <Output
894           TaskParameter="TargetOutputs"
895           PropertyName="_RestorePackagesPathOverride" />
896     </MsBuild>
897
898     <!-- RestoreSourcesOverride -->
899     <MsBuild
900         Condition=" '$(RestoreSources)' != '' "
901         Projects="$(MSBuildThisFileFullPath)"
902         Targets="_GetRestoreSourcesOverride"
903         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
904                     %(_MSBuildProjectReferenceExistent.SetPlatform);"
905         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
906
907       <Output
908           TaskParameter="TargetOutputs"
909           PropertyName="_RestoreSourcesOverride" />
910     </MsBuild>
911
912     <!-- RestoreFallbackFoldersOverride -->
913     <MsBuild
914         Condition=" '$(RestoreFallbackFolders)' != '' "
915         Projects="$(MSBuildThisFileFullPath)"
916         Targets="_GetRestoreFallbackFoldersOverride"
917         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration);
918                     %(_MSBuildProjectReferenceExistent.SetPlatform);"
919         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
920
921       <Output
922           TaskParameter="TargetOutputs"
923           PropertyName="_RestoreFallbackFoldersOverride" />
924     </MsBuild>
925   </Target>
926
927   <!--
928     ============================================================
929     _GetRestorePackagesPathOverride
930     ============================================================
931   -->
932   <Target Name="_GetRestorePackagesPathOverride"
933           Returns="$(_RestorePackagesPathOverride)">
934     <PropertyGroup>
935       <_RestorePackagesPathOverride>$(RestorePackagesPath)</_RestorePackagesPathOverride>
936     </PropertyGroup>
937   </Target>
938
939   <!--
940     ============================================================
941     _GetRestoreSourcesOverride
942     ============================================================
943   -->
944   <Target Name="_GetRestoreSourcesOverride"
945           Returns="$(_RestoreSourcesOverride)">
946     <PropertyGroup>
947       <_RestoreSourcesOverride>$(RestoreSources)</_RestoreSourcesOverride>
948     </PropertyGroup>
949   </Target>
950
951   <!--
952     ============================================================
953     _GetRestoreFallbackFoldersOverride
954     ============================================================
955   -->
956   <Target Name="_GetRestoreFallbackFoldersOverride"
957           Returns="$(_RestoreFallbackFoldersOverride)">
958     <PropertyGroup>
959       <_RestoreFallbackFoldersOverride>$(RestoreFallbackFolders)</_RestoreFallbackFoldersOverride>
960     </PropertyGroup>
961   </Target>
962
963   <!--
964     ============================================================
965     _IsProjectRestoreSupported
966     Verify restore targets exist in the project.
967     ============================================================
968   -->
969   <Target Name="_IsProjectRestoreSupported"
970           Returns="@(_ValidProjectsForRestore)">
971
972     <ItemGroup>
973       <_ValidProjectsForRestore Include="$(MSBuildProjectFullPath)" />
974     </ItemGroup>
975   </Target>
976
977 </Project>