Merge pull request #4406 from dotnet/emgarten/solutionRestore
Adding recursive restore and solution level restore
This commit is contained in:
commit
bc82b16a01
10 changed files with 49 additions and 18 deletions
|
@ -20,7 +20,7 @@
|
||||||
"System.Runtime.Serialization.Primitives": "4.1.1",
|
"System.Runtime.Serialization.Primitives": "4.1.1",
|
||||||
"System.Xml.XmlSerializer": "4.0.11",
|
"System.Xml.XmlSerializer": "4.0.11",
|
||||||
"WindowsAzure.Storage": "6.2.2-preview",
|
"WindowsAzure.Storage": "6.2.2-preview",
|
||||||
"NuGet.CommandLine.XPlat": "3.6.0-rc-1979",
|
"NuGet.CommandLine.XPlat": "3.6.0-rc-1984",
|
||||||
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00043-160929",
|
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00043-160929",
|
||||||
"Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933"
|
"Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933"
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<!--
|
||||||
|
***********************************************************************************************
|
||||||
|
Microsoft.NuGet.ImportAfter.targets
|
||||||
|
|
||||||
|
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
|
||||||
|
created a backup copy. Incorrect changes to this file will make it
|
||||||
|
impossible to load or build your projects from the command-line or the IDE.
|
||||||
|
|
||||||
|
Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
***********************************************************************************************
|
||||||
|
-->
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<!-- Import NuGet.targets for Restore -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NuGetRestoreTargets Condition="'$(NuGetRestoreTargets)'==''">$(MSBuildExtensionsPath)\NuGet.targets</NuGetRestoreTargets>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Condition="Exists('$(NuGetRestoreTargets)')" Project="$(NuGetRestoreTargets)" />
|
||||||
|
</Project>
|
|
@ -9,10 +9,10 @@
|
||||||
"target": "project"
|
"target": "project"
|
||||||
},
|
},
|
||||||
"Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933",
|
"Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933",
|
||||||
"NuGet.Versioning": "3.6.0-rc-1979",
|
"NuGet.Versioning": "3.6.0-rc-1984",
|
||||||
"NuGet.Packaging": "3.6.0-rc-1979",
|
"NuGet.Packaging": "3.6.0-rc-1984",
|
||||||
"NuGet.Frameworks": "3.6.0-rc-1979",
|
"NuGet.Frameworks": "3.6.0-rc-1984",
|
||||||
"NuGet.ProjectModel": "3.6.0-rc-1979"
|
"NuGet.ProjectModel": "3.6.0-rc-1984"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netstandard1.3": {
|
"netstandard1.3": {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"Microsoft.DotNet.Files": {
|
"Microsoft.DotNet.Files": {
|
||||||
"target": "project"
|
"target": "project"
|
||||||
},
|
},
|
||||||
"NuGet.ProjectModel": "3.6.0-rc-1979"
|
"NuGet.ProjectModel": "3.6.0-rc-1984"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netstandard1.3": {
|
"netstandard1.3": {
|
||||||
|
|
|
@ -8,10 +8,10 @@
|
||||||
"Microsoft.Extensions.DependencyModel": "1.0.1-beta-000933",
|
"Microsoft.Extensions.DependencyModel": "1.0.1-beta-000933",
|
||||||
"Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933",
|
"Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933",
|
||||||
"Newtonsoft.Json": "9.0.1",
|
"Newtonsoft.Json": "9.0.1",
|
||||||
"NuGet.Configuration": "3.6.0-rc-1979",
|
"NuGet.Configuration": "3.6.0-rc-1984",
|
||||||
"NuGet.Packaging": "3.6.0-rc-1979",
|
"NuGet.Packaging": "3.6.0-rc-1984",
|
||||||
"NuGet.RuntimeModel": "3.6.0-rc-1979",
|
"NuGet.RuntimeModel": "3.6.0-rc-1984",
|
||||||
"NuGet.ProjectModel": "3.6.0-rc-1979",
|
"NuGet.ProjectModel": "3.6.0-rc-1984",
|
||||||
"System.Reflection.Metadata": "1.4.1-beta-24410-02"
|
"System.Reflection.Metadata": "1.4.1-beta-24410-02"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
|
|
|
@ -60,6 +60,12 @@ namespace Microsoft.DotNet.Tools.Restore3
|
||||||
"Treat package source failures as warnings.",
|
"Treat package source failures as warnings.",
|
||||||
CommandOptionType.NoValue);
|
CommandOptionType.NoValue);
|
||||||
|
|
||||||
|
// Use a boolean argument instead of a switch to match nuget.exe
|
||||||
|
var recursive = cmd.Option(
|
||||||
|
"--recursive",
|
||||||
|
"Restore all dependency projects.",
|
||||||
|
CommandOptionType.BoolValue);
|
||||||
|
|
||||||
cmd.OnExecute(() =>
|
cmd.OnExecute(() =>
|
||||||
{
|
{
|
||||||
var msbuildArgs = new List<string>()
|
var msbuildArgs = new List<string>()
|
||||||
|
@ -69,7 +75,7 @@ namespace Microsoft.DotNet.Tools.Restore3
|
||||||
|
|
||||||
if (sourceOption.HasValue())
|
if (sourceOption.HasValue())
|
||||||
{
|
{
|
||||||
msbuildArgs.Add($"/p:RestoreSources={string.Join(";", sourceOption.Values)}");
|
msbuildArgs.Add($"/p:RestoreSources={string.Join("%3B", sourceOption.Values)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packagesOption.HasValue())
|
if (packagesOption.HasValue())
|
||||||
|
@ -97,6 +103,13 @@ namespace Microsoft.DotNet.Tools.Restore3
|
||||||
msbuildArgs.Add($"/p:RestoreIgnoreFailedSources=true");
|
msbuildArgs.Add($"/p:RestoreIgnoreFailedSources=true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// By default restore is recursive, if set to false turn it off.
|
||||||
|
// If the argument is not present use the default behavior.
|
||||||
|
if (recursive.BoolValue == false)
|
||||||
|
{
|
||||||
|
msbuildArgs.Add($"/p:RestoreRecursive=false");
|
||||||
|
}
|
||||||
|
|
||||||
// Add in arguments
|
// Add in arguments
|
||||||
msbuildArgs.AddRange(argRoot.Values);
|
msbuildArgs.AddRange(argRoot.Values);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"Microsoft.Build.Runtime": "15.1.316-preview5",
|
"Microsoft.Build.Runtime": "15.1.316-preview5",
|
||||||
"Microsoft.CodeAnalysis.Build.Tasks": "2.0.0-beta6-60922-08",
|
"Microsoft.CodeAnalysis.Build.Tasks": "2.0.0-beta6-60922-08",
|
||||||
"System.Runtime.Serialization.Xml": "4.1.1",
|
"System.Runtime.Serialization.Xml": "4.1.1",
|
||||||
"NuGet.Build.Tasks": "3.6.0-rc-1979",
|
"NuGet.Build.Tasks": "3.6.0-rc-1984",
|
||||||
"Microsoft.TestPlatform.CLI": "15.0.0-preview-20161005-01",
|
"Microsoft.TestPlatform.CLI": "15.0.0-preview-20161005-01",
|
||||||
"Microsoft.TestPlatform.Build": "15.0.0-preview-20161005-01"
|
"Microsoft.TestPlatform.Build": "15.0.0-preview-20161005-01"
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"type": "platform",
|
"type": "platform",
|
||||||
"version": "1.0.1"
|
"version": "1.0.1"
|
||||||
},
|
},
|
||||||
"NuGet.CommandLine.XPlat": "3.6.0-rc-1979"
|
"NuGet.CommandLine.XPlat": "3.6.0-rc-1984"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.0": {
|
"netcoreapp1.0": {
|
||||||
|
|
|
@ -30,10 +30,10 @@
|
||||||
},
|
},
|
||||||
"System.Diagnostics.TraceSource": "4.0.0",
|
"System.Diagnostics.TraceSource": "4.0.0",
|
||||||
"System.Runtime.Serialization.Primitives": "4.1.1",
|
"System.Runtime.Serialization.Primitives": "4.1.1",
|
||||||
"NuGet.Versioning": "3.6.0-rc-1979",
|
"NuGet.Versioning": "3.6.0-rc-1984",
|
||||||
"NuGet.Packaging": "3.6.0-rc-1979",
|
"NuGet.Packaging": "3.6.0-rc-1984",
|
||||||
"NuGet.Frameworks": "3.6.0-rc-1979",
|
"NuGet.Frameworks": "3.6.0-rc-1984",
|
||||||
"NuGet.ProjectModel": "3.6.0-rc-1979",
|
"NuGet.ProjectModel": "3.6.0-rc-1984",
|
||||||
"Microsoft.DotNet.ProjectModel": {
|
"Microsoft.DotNet.ProjectModel": {
|
||||||
"target": "project"
|
"target": "project"
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
},
|
},
|
||||||
"xunit": "2.2.0-beta3-build3330",
|
"xunit": "2.2.0-beta3-build3330",
|
||||||
"dotnet-test-xunit": "1.0.0-rc2-350904-49",
|
"dotnet-test-xunit": "1.0.0-rc2-350904-49",
|
||||||
"NuGet.ProjectModel": "3.6.0-rc-1979"
|
"NuGet.ProjectModel": "3.6.0-rc-1984"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.0": {
|
"netcoreapp1.0": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue