Only new behavior is captured, everything else should work per usual.
Project local dependencies CLI flag
Nimble recently added the ability to work with project local dependencies. Simply by creating a
nimbledeps directory in the project is sufficient to go into this mode. Once this directory exists, all information that typically goes into
~/.nimble is stored here, unaffected by any other projects or global changes.
This feature is being extended with a new
-l | --local flag which sets up a project in localdeps mode. For most cases, all it does is creates a
nimbledeps directory if it doesn't already exist.
nimble -l init will initialize a project in localdeps mode.
This flag is only useful when initially working with a project or a pre-existing project folder. Once the
nimbledeps folder is setup, the flag is redundant.
nimble develop pkg
nimble develop pkg command clones a new project so setting it up in localdeps mode requires some additional code changes.
nimble develop -l karax for example will result in the following actions:
git clone https://github.com/pragmagic/karax karax cd karax mkdir nimbledeps
After this, nimble will setup all dependencies in
./karax/nimbledeps since project is now in localdeps mode.
Larger Nim projects require code changes to dependencies as well. This requires the user to check out each dependency separately in
nimble develop mode.
This workflow can be simplified with a new
-d | --deps flag for
nimble develop which will also set up all dependencies in develop mode.
nimble develop -d karax will result in the following directory structure:
./dotenv/... ./karax/... ./ws/...
The top level project
karax and all its dependencies will be checked out with
git clone at
#head as sibling directories. This also means all
requires statements with version specific information will be only used to identify dependencies but not their actual versions since you develop on
Project local dependency mode
By default, nimble will use
~/.nimble and link all packages per usual.
-l | --local is also specified, the project and all dependencies will be set up in project local dependency mode.
nimble develop -l -d karax will result in the following directory structure:
./nimbledeps/... # contains all project local nimble metadata ./dotenv/nimbledeps/nimble.nimble-link # links to ../../nimbledeps ./dotenv/... ./karax/nimbledeps/nimble.nimble-link # links to ../../nimbledeps ./karax/... ./ws/nimbledeps/nimble.nimble-link # links to ../../nimbledeps ./ws/...
This enables project isolation and the project and each dependency can be developed while being linked to their dependencies.
Any nimble commands to add/remove dependencies will work the same whether within the parent directory, the top level project
./karax or in a dependency directory.