Skip to content
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

NugetPackagePluginCatalog should download the package only once #59

Closed
mikoskinen opened this issue Mar 25, 2022 · 1 comment · Fixed by #60
Closed

NugetPackagePluginCatalog should download the package only once #59

mikoskinen opened this issue Mar 25, 2022 · 1 comment · Fixed by #60
Assignees

Comments

@mikoskinen
Copy link
Contributor

mikoskinen commented Mar 25, 2022

PluginFramework supports installing plugins using Nuget. This is implemented in NugetPackagePluginCatalog.

If NugetPackagePluginCatalog's packagesFolder is set, the Nuget package gets always installed into the same path. Still, NugetCatalog always tries to download the Nuget package.

Change

We want to download the package only once. When NugetPackagePluginCatalog is initialized, it should check if the package has been previously installed and if so, it should use that instead of trying to download the package again.

Implementation idea

When first initializing the catalog, can we serialize and save nugetDownloadResult into some fixed location (based on the packages folder & package identifier (name.version)) in NugetPackagePluginCatalog.Initialize? Before calling nuGetDownloader.DownloadAsync we could check if the file already exists and deserialize the result instead of using NugetDownloader.

Note

Behind the scenes NugetPackagePluginCatalog uses NugetDownloader. NugetDownloader takes care of installing the correct version of the package (x86 vs x64 vs arm vs Win10 vs Win11 etc). NugetDownloader passes NugetDownloadResult to PluginFramework and PF uses that info when initializing the catalog.

NugetDownloader can be found from https://github.com/weikio/nugetdownloader but we shouldn't need to modify it.

Testing

New unit test should be created to test this functionality by cloning the NugetPackagePluginCatalogTests.CanInstallPackageWithNativeDepencencies. This is a good test case as it uses the native dlls etc. which are provided by the NugetDownloader.

@franklupo
Copy link

News?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants