Skip to content

Commit

Permalink
Merge pull request #20 from nventive/dev/beca/documentation
Browse files Browse the repository at this point in the history
Added sample commands in the documentation
  • Loading branch information
Benjamin Cartier authored Sep 13, 2019
2 parents cadfd0a + 1645cbe commit 5362121
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- Replaced package owner with package author
- Reworked internal logic of the updater: package list is now fetched from the files before being looked up online
- Updated sources handling to add support for any number of public or private package sources (it was previously limited to NuGet.org and any number of private package sources)
- Updated sources handling to add support for any number of public or private package sources (it was previously limited to NuGet.org and any number of private package sources
- Set the current directory as the solution root if none is specified in the .Net Core application

### Deprecated

Expand Down
50 changes: 45 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,54 @@ NuGet Updater allows batch updates of NuGet packages in a solution.

## Getting Started

The NuGet Updater can be installed as a standalone .Net Core tool using the following command: `dotnet tool install -g nventive.NuGet.Updater.Tool`
Help can be found with : `nugetupdater --help`
The NuGet Updater can be installed as a standalone .Net Core tool using the following command:
`dotnet tool install -g nventive.NuGet.Updater.Tool`

The NuGet updater library can also be installed as a NuGet package in a UWP or WPF application.
Help can be found with :
`nugetupdater --help`

## Features
The NuGet updater library can also be installed as a NuGet package in a UWP or WPF application.

Update NuGet packages to the latest version with a specific tag (i.e. dev, alpha, etc.).
## Sample commands

- Update all packages in the current folder (and its subfolders) to the latest stable version found on NuGet.org
```
nugetupdater --useNuGetorg
```
This can also be achieved using the following command
```
nugetupdater --feed=https://api.nuget.org/v3/index.json
```

- Update all packages in `MySolution.sln` to the latest stable version available on NuGet.org
```
nugetupdater --solution=MySolution.sln -n
```

- Update packages to either beta, stable or alpha (whichever's the highest)
```
nugetupdater -s=MySolution.sln -n --version=beta -v=alpha
```

- Update packages to the latest beta version available on a private feed
```
nugetupdater -s=MySolution.sln --feed=https://pkgs.dev.azure.com/account/_packaging/feed/nuget/v3/index.json|personalaccesstoken --version=beta
```

- Update packages from `nventive` from NuGet.org, except for `PackageA` and `PackageB`
```
nugetupdater -s=MySolution.sln -n --packageAuthor=nventive --ignore=PackageA -i=PackageB
```

- Update only `PackageA` and `PackageB` from NuGet.org and a private feed
```
nugetupdater -s=MySolution.sln -n -f=https://pkgs.dev.azure.com/account/_packaging/feed/nuget/v3/index.json|personalaccesstoken --update=PackageA -u=PackageB
```

- Update packages to latest stable, even if a higher version is already found in the solution
```
nugetupdater -s=MySolution.sln -n --allowDowngrade
```

## Changelog

Expand Down
3 changes: 2 additions & 1 deletion src/NuGet.Updater.Tool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static async Task Main(string[] args)
var options = new OptionSet
{
{ "help|h", "Displays this help screen", s => isHelp = true },
{ "solution=|s=", "The {path} to the solution or folder to update", s => Set(p => p.SolutionRoot = s) },
{ "solution=|s=", "The {path} to the solution or folder to update; defaults to the current folder", s => Set(p => p.SolutionRoot = s) },
{ "feed=|f=", "A NuGet feed to use for the update; a private feed can be specified with the format {url|accessToken}; can be specified multiple times", s => AddSource(s) },
{ "version=|versions=|v=", "The target {version} to use; latest stable is always considered; can be specified multiple times", s => Set(p => p.TargetVersions.Add(s))},
{ "ignorePackages=|ignore=|i=", "A specific {package} to ignore; can be specified multiple times", s => Set(p => p.PackagesToIgnore.Add(s)) },
Expand All @@ -39,6 +39,7 @@ public static async Task Main(string[] args)
_isParameterSet = false;
_parameters = new UpdaterParameters
{
SolutionRoot = Environment.CurrentDirectory,
UpdateTarget = UpdateTarget.All,
Sources = new List<IUpdaterSource>(),
PackagesToIgnore = new List<string>(),
Expand Down

0 comments on commit 5362121

Please sign in to comment.