-
-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH1743: Implements functionality for downloading NuGet packages #1768
Conversation
{ | ||
switch (level) | ||
{ | ||
case MessageLevel.Info: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit chatty now by default, I wonder if we should have Verbose for info.
{ | ||
private static readonly string[] _defaultSources = | ||
{ | ||
"https://api.nuget.org/v3/index.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mholo65 should this come from the cake.config
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should!
522793b
to
0901ef4
Compare
|
||
// Then | ||
fixture.Registrar.Received(1).RegisterType<Install.NuGetPackageInstaller>(); | ||
fixture.Builder.Received(1).As<INuGetPackageInstaller>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cake-build/cake-team can anyone tell me why this test is failing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mholo65 Could you please sort the merge conflicts and rebase against latest develop.
a54fd42
to
a509ffc
Compare
@devlead rebased. |
public void Should_Register_The_In_Process_NuGet_Package_Installer_If_Set_In_Configuration() | ||
{ | ||
// Given | ||
var fixture = new NuGetModuleFixture<NuGetPackageInstaller>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
var fixture = new NuGetModuleFixture<Install.NuGetPackageInstaller>();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ofc, stupid me looking at wrong place! Thank you!
|
||
// Then | ||
fixture.Registrar.Received(1).RegisterType<Install.NuGetPackageInstaller>(); | ||
fixture.Builder.Received(1).As<INuGetPackageInstaller>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above comment
a509ffc
to
ee38213
Compare
@devlead fixed |
ee38213
to
c298b02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I'll take it for a final spin, if all good I'll mere this one.
c298b02
to
a8e315b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got an exception on my Linux machine will investigate on Windows and see if I get same error and then rerun tests on Linux if all's good on WIndows
Error: System.ArgumentException: Path cannot be empty.
Parameter name: path
at Cake.Core.IO.Path..ctor (System.String path) <0x400fd040 + 0x0048f> in <filename unknown>:0
at Cake.Core.IO.FilePath..ctor (System.String path) <0x400fc030 + 0x00013> in <filename unknown>:0
at Cake.NuGet.Install.NugetFolderProject.GetFiles (Cake.Core.IO.DirectoryPath directoryPath, Cake.Core.Packaging.PackageReference packageReference, PackageType type) <0x402bb980 + 0x002af> in <filename unknown>:0
at Cake.NuGet.Install.NuGetPackageInstaller.Install (Cake.Core.Packaging.PackageReference package, PackageType type, Cake.Core.IO.DirectoryPath path) <0x401632e0 + 0x00443> in <filename unknown>:0
at Cake.Core.Scripting.ScriptProcessor.InstallTools (IReadOnlyCollection`1 tools, Cake.Core.IO.DirectoryPath installPath) <0x40162c50 + 0x0018d> in <filename unknown>:0
at Cake.Core.Scripting.ScriptRunner.Run (IScriptHost host, Cake.Core.IO.FilePath scriptPath, IDictionary`2 arguments) <0x40152a80 + 0x003a9> in <filename unknown>:0
at Cake.Commands.BuildCommand.Execute (Cake.CakeOptions options) <0x40152990 + 0x00042> in <filename unknown>:0
at Cake.CakeApplication.Run (Cake.CakeOptions options) <0x40111d70 + 0x00039> in <filename unknown>:0
at Cake.Program.Main () <0x400c0d60 + 0x0046b> in <filename unknown>:0
@mholo65 And it doesn't respect if you place a NuGet.config in repo root/tools folder/or cake folder. Interestingly the source it complains about is disabled, so it shouldn't be used, if i remove the disabled sources and only have <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="NuGetV3" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration> Feels like an issue with the NuGet client libs. I don't get the same errors as I got on Linux so I'll rerun the tests there if it was something temporary. |
@mholo65 I can confirm exception is sorted and it now works for me the first time. |
@devlead I blame NuGet client libs and awful xplat support when it comes to file system. This breaks support for nuspec package save mode since nuspec is stored to disk as normalized (e.g. filename to lower invariant). But then when it checks if package is installed, it expects to find nuspec in non-normalized form. |
…ckages - Opt-in via NuGet_UseInProcessClient - Opt-in load dependencies via NuGet_LoadDependencies or add LoadDependencies as parameter in directive - Fixes cake-build#1743
97e18c9
to
ac7850b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@mholo65 your changes have been merged, thanks for your contribution 👍 |
TODO: