paket simplify
Simplify declared dependencies by removing transitive dependencies.
1: 2: 3: 4: 5: 6: 7: 8: 9: |
|
If you add the --verbose flag Paket will run in verbose mode and show detailed information.
With --log-file [path] you can trace the logged information into a file.
A note on strict mode
paket simplify will also affect
paket.references files, unless
strict mode is used.
Important: paket simplify is a heuristic approach to dependency
simplification. It often works very well, but there are rare cases where
simplify can result in changes of the package resolution.
Interactive mode
Sometimes, you may still want to have control over some of the
transitive dependencies. In this case you can use the
--interactive flag, which will ask you to confirm before deleting a dependency
from a file.
Preventing Simplify
You can use the setting simplify: never to prevent a package from being removed as part of the simplify.
Any package with settings will also never be removed.
Example
When you install Castle.Windsor package in NuGet to a project, it will
generate a following packages.config file in the project location:
1: 2: 3: 4: 5: |
|
After converting to Paket with
paket convert-from-nuget, you should get a
following paket.dependencies file:
1: 2: 3: 4: |
|
The NuGet packages.config should be converted to following
paket.references file:
1: 2: |
|
As you have already probably guessed, the Castle.Windsor package happens to
have a dependency on the Castle.Core package. Paket will by default (without
strict mode) add references to all
required dependencies of a package that you define for a specific project in
paket.references file. In other words, you still get
the same result if you remove Castle.Core from your
paket.references file.
This is exactly what happens after executing paket simplify command. After
running it, paket.dependencies will contain:
1: 2: 3: |
|
And paket.references file contains:
1:
|
|
Unless you are relying heavily on types from Castle.Core, you would not care
about controlling the required version of Castle.Core package. Paket will do
the job.
The simplify command will help you maintain your direct dependencies.