Skip to content

Commit 34e4cee

Browse files
After the rebase to master, made minimum changes needed to
NuGet.Client.CommandLine to get it to build
1 parent 05f13b2 commit 34e4cee

File tree

6 files changed

+55
-14
lines changed

6 files changed

+55
-14
lines changed

src/V3/NuGet.Client.CommandLine/Commands/InstallCommand.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,32 +120,32 @@ private async Task InstallPackage(
120120
DependencyBehavior = DependencyBehavior,
121121
});
122122

123-
var actions = await actionResolver.ResolveActionsAsync(new PackageIdentity(packageId, version),
123+
var packageActions = await actionResolver.ResolveActionsAsync(new PackageIdentity(packageId, version),
124124
PackageActionType.Install,
125125
new FilesystemInstallationTarget(packageManager));
126126

127127
if (Verbosity == NuGet.Verbosity.Detailed)
128128
{
129129
Console.WriteLine("Actions returned by resolver");
130-
foreach (var action in actions)
130+
foreach (var action in packageActions)
131131
{
132132
Console.WriteLine(action.ActionType.ToString() + "-" + action.PackageIdentity.ToString());
133133
}
134134
}
135135

136-
actions = actions.Where(a => a.ActionType == PackageActionType.Download || a.ActionType == PackageActionType.Purge);
136+
packageActions = packageActions.Where(a => a.ActionType == PackageActionType.Download || a.ActionType == PackageActionType.Purge);
137137

138138
if (Verbosity == NuGet.Verbosity.Detailed)
139139
{
140140
Console.WriteLine("After reducing actions to just Download and Purge");
141-
foreach (var action in actions)
141+
foreach (var action in packageActions)
142142
{
143143
Console.WriteLine(action.ActionType.ToString() + "-" + action.PackageIdentity.ToString());
144144
}
145145
}
146146

147147
var actionExecutor = new ActionExecutor();
148-
await actionExecutor.ExecuteActionsAsync(actions, Console, CancellationToken.None);
148+
actionExecutor.ExecuteActions(packageActions, Console);
149149
}
150150
}
151151
}

src/V3/NuGet.Client.CommandLine/Commands/RestoreCommand.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,15 @@ private bool RestorePackage(
315315
return true;
316316
}
317317

318-
var packageAction = new NewPackageAction(Client.Resolution.PackageActionType.Download,
318+
var packageAction = new NewPackageAction(NuGet.Client.PackageActionType.Download,
319319
packageIdentity, packageJSON, filesystemInstallationTarget, SourceRepository, null);
320320

321321
// BUGBUG: See PackageExtractor.cs for locking mechanism used to handle concurrency
322322
NuGet.Client.Installation.ActionExecutor actionExecutor = new Client.Installation.ActionExecutor();
323323

324324
// BUGBUG: This is likely inefficient. Consider collecting all actions first and executing them in 1 shot
325325
var packageActions = new List<NewPackageAction>() { packageAction };
326-
actionExecutor.ExecuteActionsAsync(packageActions, Console, CancellationToken.None).Wait();
326+
actionExecutor.ExecuteActions(packageActions, Console);
327327
return true;
328328
}
329329
}
@@ -402,12 +402,12 @@ private bool InstallSatellitePackages(IFileSystem packagesFolderFileSystem, Conc
402402

403403
var packageManager = CreatePackageManager(packagesFolderFileSystem, useSideBySidePaths: true);
404404
var filesystemInstallationTarget = new FilesystemInstallationTarget(packageManager);
405-
var packageAction = satellitePackages.Select(packageJSON => new NewPackageAction(Client.Resolution.PackageActionType.Download,
405+
var packageActions = satellitePackages.Select(packageJSON => new NewPackageAction(NuGet.Client.PackageActionType.Download,
406406
new PackageIdentity(packageJSON[Properties.PackageId].ToString(), new NuGetVersion (packageJSON[Properties.Version].ToString())), packageJSON, filesystemInstallationTarget, SourceRepository, null));
407407

408408
// BUGBUG: See PackageExtractor.cs for locking mechanism used to handle concurrency
409409
NuGet.Client.Installation.ActionExecutor actionExecutor = new Client.Installation.ActionExecutor();
410-
actionExecutor.ExecuteActionsAsync(packageAction, CancellationToken.None).Wait();
410+
actionExecutor.ExecuteActions(packageActions, Console);
411411

412412
return true;
413413
}

src/V3/NuGet.Client.CommandLine/Common/Console.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,5 +384,15 @@ FileConflictAction IExecutionLogger.ResolveFileConflict(string message)
384384
}
385385
}
386386
}
387+
388+
public void ExecuteScript(string packageInstallPath, string scriptRelativePath, object package, Client.Installation.InstallationTarget target)
389+
{
390+
// no-op
391+
}
392+
393+
public void OpenFile(string fullPath)
394+
{
395+
// no-op
396+
}
387397
}
388398
}

src/V3/NuGet.Client.CommandLine/Common/IConsole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace NuGet.Common
66
{
7-
public interface IConsole : IExecutionLogger, ILogger
7+
public interface IConsole : IExecutionContext, ILogger
88
{
99
int CursorLeft { get; set; }
1010
int WindowWidth { get; set; }

src/V3/NuGet.Client.CommandLine/NuGet.Client.CommandLine.csproj

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,39 @@
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
3434
<ItemGroup>
35+
<Reference Include="JsonLD">
36+
<HintPath>..\..\..\packages\json-ld.net.1.0.4\lib\net40-Client\JsonLD.dll</HintPath>
37+
</Reference>
3538
<Reference Include="Microsoft.Build" />
3639
<Reference Include="Microsoft.Build.Engine" />
3740
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
3841
<SpecificVersion>False</SpecificVersion>
3942
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
4043
</Reference>
44+
<Reference Include="NuGet.Client.BaseTypes">
45+
<HintPath>..\..\..\packages\NuGet.Client.BaseTypes.0.1.0-master-43530230\lib\net45\NuGet.Client.BaseTypes.dll</HintPath>
46+
</Reference>
47+
<Reference Include="NuGet.Client.V3">
48+
<HintPath>..\..\..\packages\NuGet.Client.V3.1.0.0-master-43530237\lib\net45\NuGet.Client.V3.dll</HintPath>
49+
</Reference>
50+
<Reference Include="NuGet.Data">
51+
<HintPath>..\..\..\packages\NuGet.Client.V3.1.0.0-master-43530237\lib\net45\NuGet.Data.dll</HintPath>
52+
</Reference>
53+
<Reference Include="NuGet.Versioning">
54+
<HintPath>..\..\..\packages\NuGet.Versioning.1.0.3\lib\portable-net40+win\NuGet.Versioning.dll</HintPath>
55+
</Reference>
4156
<Reference Include="System" />
4257
<Reference Include="System.ComponentModel.Composition" />
4358
<Reference Include="System.Core" />
4459
<Reference Include="Microsoft.CSharp" />
60+
<Reference Include="System.Net.Http" />
61+
<Reference Include="System.Net.Http.Extensions">
62+
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
63+
</Reference>
64+
<Reference Include="System.Net.Http.Primitives">
65+
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
66+
</Reference>
67+
<Reference Include="System.Net.Http.WebRequest" />
4568
<Reference Include="System.XML" />
4669
<Reference Include="System.Xml.Linq" />
4770
</ItemGroup>
@@ -125,16 +148,17 @@
125148
<Project>{f879f274-efa0-4157-8404-33a19b4e6aec}</Project>
126149
<Name>Core</Name>
127150
</ProjectReference>
128-
<ProjectReference Include="..\..\Versioning\Versioning.csproj">
129-
<Project>{0333984f-e0a3-44fb-afe9-a1207da1e975}</Project>
130-
<Name>Versioning</Name>
131-
</ProjectReference>
132151
<ProjectReference Include="..\NuGet.Client\NuGet.Client.csproj">
133152
<Project>{56ef26e3-35fe-4857-bce3-438089339c83}</Project>
134153
<Name>NuGet.Client</Name>
135154
</ProjectReference>
136155
</ItemGroup>
137156
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
157+
<Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
158+
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
159+
<Error Condition="!Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
160+
<Error Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
161+
</Target>
138162
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
139163
Other similar extension points exist, see Microsoft.Common.targets.
140164
<Target Name="BeforeBuild">
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="json-ld.net" version="1.0.4" targetFramework="net45" />
4+
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
5+
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
6+
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
37
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
8+
<package id="NuGet.Client.BaseTypes" version="0.1.0-master-43530230" targetFramework="net45" />
9+
<package id="NuGet.Client.V3" version="1.0.0-master-43530237" targetFramework="net45" />
10+
<package id="NuGet.Versioning" version="1.0.3" targetFramework="net45" />
411
</packages>

0 commit comments

Comments
 (0)