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

Implemented nuget.exe add and nuget.exe init commands #14

Closed
wants to merge 13 commits into from

Conversation

deepakaravindr
Copy link
Contributor

Both nuget.exe add and nuget.exe init follows the new v3 model to only copy the nupkg, extract the nuspec and create a SHA512 of the nupkg file at the destination. With a provision to expand the packages using '-Expand' switch

nuget.exe add: NuGet/Home#1421
Adds a given package to the specified source if it is a file source. http sources are not supported.

nuget.exe init: NuGet/Home#1423
Adds all the packages from a given feed to the specified destination feed if it is a file source feed. http feeds are not supported.

Following are pending and/or not covered in this change.

  1. nuget.exe init only takes a folder of nupkgs as the source. Should this be upgraded to support every v2 folder source and probably v3 folder sources as well?
  2. nuget.exe init could parallelize package additions.
  3. Need more tests for the new '-Expand' switch. Also, need to verify and update the messages for the -Expand switch as needed.
  4. Marker file for nuget.exe add and init: nuget.exe add and init should add a marker file to feed root Home#1456
  5. Concurrency for "multiple exes" on other platforms: NuGet.Xplat - init and add commands Home#1455
  6. With the latest design, Updating nuget clients may not be necessary anymore. We should close Update NuGet VS Client to honor the offline feed settings Home#1425 and Update nuget.exe to honor the offline feed Home#1424 as Won't Fix.
  7. Update documentation on docs.nuget.org

@yishaigalatzer @MeniZalzman @emgarten

@yishaigalatzer
Copy link
Contributor

  1. It should take any existing folder source
  2. Lets skip the parallelization for now
  3. Add the tests
  4. Skip nuget.exe add and init should add a marker file to feed root Home#1456
  5. Concurrency is important, but can be done in a follow up PR
  6. Closed the items
  7. Create a doc PR

@deepakaravindr
Copy link
Contributor Author

  • It takes any existing folder source. V2 and V3. Added tests. Manually tested.
  • OK
  • Added tests for -Expand switch. Manually tested
  • OK
  • OK
  • OK
  • Will do

@@ -5245,4 +5245,41 @@ nuget update -Self</value>
<data name="CommandMSBuildVersion" xml:space="preserve">
<value>Specifies the version of MSBuild to be used with this command. Supported values are 4, 12, 14. By default the MSBuild in your path is picked, otherwise it defaults to the highest installed version of MSBuild.</value>
</data>
<data name="AddCommandDescription" xml:space="preserve">
<value>Adds a given package to the specified source if it is a file source. http sources are not supported.</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really describe what the command is for

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, we need to explain the offline feed concept here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @yishaigalatzer and updated the command description both for add and init. Check it out in the next iteration.

@emgarten
Copy link
Member

:shipit:

public class AddCommand : Command
{
[Option(typeof(NuGetCommand), "AddCommandSourceDescription", AltName = "src")]
public string Source { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check if we have a way to declare mandatory parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. We do not have a way today to declare mandatory parameters.

@MeniZalzman
Copy link
Contributor

:shipit:

… This will be used by nuget.exe add and nuget.exe init
user-defined offline feed as controlled by settings.
mandatory source and destination feed for add and init respectively.
Need to fix tests
and destination feed for nuget.exe init mandatory.
and nuget.exe init using an -Expand switch. Need to add tests
…found.

2) Added more tests for nuget.exe init
Verified manually that it works. Need to add tests
simplify the not exists check on the path both for add and init commands.

2) Renamed ValidatePath to ThrowIfInvalid.

3) Added tests for OfflineFeedUtility
moved the tests to NugetPackageUtilTests.cs.
Also, fixed the existing tests to use the new signature for
InstallFromSourceAsync
@deepakaravindr
Copy link
Contributor Author

Merged with

3004649,

5eefae0
and
5272f06

@deepakaravindr deepakaravindr deleted the daravind/offlinefeed branch January 7, 2016 23:12
nkolev92 added a commit that referenced this pull request Mar 30, 2022
TheCakeIsNaOH pushed a commit to TheCakeIsNaOH/NuGet.Client that referenced this pull request Jan 6, 2023
Nigusu-Allehu added a commit that referenced this pull request Oct 22, 2024
# This is the 1st commit message:

Read unix executable plugins

# This is the commit message #2:

Add tests

# This is the commit message #3:

Use GetUnixFileMode

# This is the commit message #4:

Cleanup testing

# This is the commit message #5:

Add NUGET_PLUGIN_PATHS

# This is the commit message #6:

use empty body constructor

# This is the commit message #7:

NuGetPluginPaths Env variable used by dotnet tools only

# This is the commit message #8:

Plugins path env

# This is the commit message #9:

fix tests

# This is the commit message #10:

fix linux bash call

# This is the commit message #11:

remove some apis

# This is the commit message #12:

cleanup

# This is the commit message #13:

cleanup

# This is the commit message #14:

cleanup
# This is the commit message #15:

Use GetUnixFileMode

# This is the commit message #16:

Cleanup testing

# This is the commit message #17:

remove some apis

# This is the commit message #18:

stub

# This is the commit message #19:

Add test

# This is the commit message #20:

cleanup
Nigusu-Allehu added a commit that referenced this pull request Oct 22, 2024
# This is the 1st commit message:

Read unix executable plugins

# This is the commit message #2:

Add tests

# This is the commit message #3:

Use GetUnixFileMode

# This is the commit message #4:

Cleanup testing

# This is the commit message #5:

Add NUGET_PLUGIN_PATHS

# This is the commit message #6:

use empty body constructor

# This is the commit message #7:

NuGetPluginPaths Env variable used by dotnet tools only

# This is the commit message #8:

Plugins path env

# This is the commit message #9:

fix tests

# This is the commit message #10:

fix linux bash call

# This is the commit message #11:

remove some apis

# This is the commit message #12:

cleanup

# This is the commit message #13:

cleanup

# This is the commit message #14:

cleanup
# This is the commit message #15:

Use GetUnixFileMode

# This is the commit message #16:

Cleanup testing

# This is the commit message #17:

remove some apis

# This is the commit message #18:

stub

# This is the commit message #19:

Add test

# This is the commit message #20:

cleanup
# This is the commit message #21:

cleanup

# This is the commit message #22:

cleanup

# This is the commit message #23:

oops
# This is the commit message #24:

Clean up
# This is the commit message #25:

undo
Nigusu-Allehu added a commit that referenced this pull request Oct 22, 2024
# This is the 1st commit message:

Read unix executable plugins

# This is the commit message #2:

Add tests

# This is the commit message #3:

Use GetUnixFileMode

# This is the commit message #4:

Cleanup testing

# This is the commit message #5:

Add NUGET_PLUGIN_PATHS

# This is the commit message #6:

use empty body constructor

# This is the commit message #7:

NuGetPluginPaths Env variable used by dotnet tools only

# This is the commit message #8:

Plugins path env

# This is the commit message #9:

fix tests

# This is the commit message #10:

fix linux bash call

# This is the commit message #11:

remove some apis

# This is the commit message #12:

cleanup

# This is the commit message #13:

cleanup

# This is the commit message #14:

cleanup
# This is the commit message #15:

Use GetUnixFileMode

# This is the commit message #16:

Cleanup testing

# This is the commit message #17:

remove some apis

# This is the commit message #18:

stub

# This is the commit message #19:

Add test

# This is the commit message #20:

cleanup
Nigusu-Allehu added a commit that referenced this pull request Oct 22, 2024
# This is the 1st commit message:

Read unix executable plugins

# This is the commit message #2:

Add tests

# This is the commit message #3:

Use GetUnixFileMode

# This is the commit message #4:

Cleanup testing

# This is the commit message #5:

Add NUGET_PLUGIN_PATHS

# This is the commit message #6:

use empty body constructor

# This is the commit message #7:

NuGetPluginPaths Env variable used by dotnet tools only

# This is the commit message #8:

Plugins path env

# This is the commit message #9:

fix tests

# This is the commit message #10:

fix linux bash call

# This is the commit message #11:

remove some apis

# This is the commit message #12:

cleanup

# This is the commit message #13:

cleanup

# This is the commit message #14:

cleanup
# This is the commit message #15:

Use GetUnixFileMode

# This is the commit message #16:

Cleanup testing

# This is the commit message #17:

remove some apis

# This is the commit message #18:

stub

# This is the commit message #19:

Add test

# This is the commit message #20:

cleanup
# This is the commit message #21:

cleanup

# This is the commit message #22:

cleanup

# This is the commit message #23:

oops
# This is the commit message #24:

Clean up
# This is the commit message #25:

undo
Nigusu-Allehu added a commit that referenced this pull request Oct 22, 2024
# This is the 1st commit message:

Read unix executable plugins

# This is the commit message #2:

Add tests

# This is the commit message #3:

Use GetUnixFileMode

# This is the commit message #4:

Cleanup testing

# This is the commit message #5:

Add NUGET_PLUGIN_PATHS

# This is the commit message #6:

use empty body constructor

# This is the commit message #7:

NuGetPluginPaths Env variable used by dotnet tools only

# This is the commit message #8:

Plugins path env

# This is the commit message #9:

fix tests

# This is the commit message #10:

fix linux bash call

# This is the commit message #11:

remove some apis

# This is the commit message #12:

cleanup

# This is the commit message #13:

cleanup

# This is the commit message #14:

cleanup
# This is the commit message #15:

Use GetUnixFileMode

# This is the commit message #16:

Cleanup testing

# This is the commit message #17:

remove some apis

# This is the commit message #18:

stub

# This is the commit message #19:

Add test

# This is the commit message #20:

cleanup
# This is the commit message #21:

cleanup

# This is the commit message #22:

cleanup

# This is the commit message #23:

oops
# This is the commit message #24:

Clean up
# This is the commit message #25:

undo
# This is the commit message #26:

cleanup

# This is the commit message #27:

cleanup

# This is the commit message #28:

# This is a combination of 20 commits.
# This is the 1st commit message:

Read unix executable plugins

# This is the commit message #2:

Add tests

# This is the commit message #3:

Use GetUnixFileMode

# This is the commit message #4:

Cleanup testing

# This is the commit message #5:

Add NUGET_PLUGIN_PATHS

# This is the commit message #6:

use empty body constructor

# This is the commit message #7:

NuGetPluginPaths Env variable used by dotnet tools only

# This is the commit message #8:

Plugins path env

# This is the commit message #9:

fix tests

# This is the commit message #10:

fix linux bash call

# This is the commit message #11:

remove some apis

# This is the commit message #12:

cleanup

# This is the commit message #13:

cleanup

# This is the commit message #14:

cleanup
# This is the commit message #15:

Use GetUnixFileMode

# This is the commit message #16:

Cleanup testing

# This is the commit message #17:

remove some apis

# This is the commit message #18:

stub

# This is the commit message #19:

Add test

# This is the commit message #20:

cleanup
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 this pull request may close these issues.

Update NuGet VS Client to honor the offline feed settings
5 participants