Skip to content

1. An ecosystem ​

Libraries rarely live alone: a portability layer feeds a string library, which feeds a parser, which feeds your application, each in its own repository with its own tags and CI. When one changes, the others must follow, in the right order. fobis ecosystem treats such a family of FoBiS projects as a whole.

This track uses a small family that the documentation can build for you, three projects with history, tags, fetched dependencies and git remotes, all private to one directory:

bash
bash docs/demo/ecosystem-demo/setup.sh ~/eco    # the script is in the FoBiS repository
source ~/eco/env.sh                             # its registry, and its github.com/demo URLs resolved locally
cd ~/eco
console
$ ls
app
core
env.sh
mathx
remotes

core is a small library; mathx uses it; app uses both. Each declares its dependencies the usual way, in its fobos (fobis fetch cloned them into third_party/):

console
$ cat app/fobos | sed -n "/dependencies/,/^$/p"
[dependencies]
deps_dir = third_party
mathx    = https://github.com/demo/mathx
core     = https://github.com/demo/core

Registering the projects ​

The ecosystem is a list of projects in your user configuration (~/.config/fobis/config.ini, here the demo's): root, the directory that holds them, and projects. discover lists the FoBiS projects under the root not registered yet; add registers them:

console
$ fobis ecosystem discover
Unregistered FoBiS projects under ~/eco:
  app
  core
  mathx

Register the ones you want to manage (not necessarily all):
  fobis ecosystem add app core mathx
console
$ fobis ecosystem add core mathx app
Registered core, mathx, app in ~/eco/.config/fobis/config.ini
See where they sit: fobis ecosystem graph

The graph ​

FoBiS reads every project's [dependencies] and orders them: a project comes after everything it uses.

console
$ fobis ecosystem graph
Release order (dependencies first)
   1. core  (level 0)
   2. mathx  (level 1)
   3. app  (level 2)

Dependency tree
app
|-- mathx
|   `-- core
`-- core

The release order is the order in which every command of the next chapters acts. A cycle between projects is reported (dependency cycle, not ordered: ...) and its projects come after all the others.

What you learned

The registry ([ecosystem] root and projects), discover, add, graph. Reference: ecosystem.

Next: 2. The dashboard.