Managing dependencies constraint

Glamorous Toolkit uses baselines to manage dependencies. A baseline indicates the list of packages to load, and for each package its dependencies to other packages and baselines.

To avoid erros during loading a baseline should define all relevant dependencies for its packages. To ensure this we added a custom constraint, namely GtBaselinesShouldProperlySpecifyDependencies GtPharoConstraint subclass: #GtBaselinesShouldProperlySpecifyDependencies instanceVariableNames: '' classVariableNames: '' package: 'GToolkit-Constraints' . This constraint does a static analysis for all packages defines inside the baseline and computes their package dependencies. Then for each package dependency it checks if that package is defined as a dependency either directly, explicitly using a baseline, or it is an implicit dependency.

In short the constraint checks that all dependencies detected by analysing the source code are defined in the baseline. The constraint returns the list of baselines that do not pass this check.

As an example, the view below shows the result of applying this analysis on BaselineOfBloc BaselineOf subclass: #BaselineOfBloc instanceVariableNames: '' classVariableNames: 'PostLoaded' package: 'BaselineOfBloc' . For all packages there are no undeclared dependencies.

We can also take a closer look at the analysis for the package Bloc-Sparta .

We can see that this package has three types of dependencies, that are specified correctly inside the baseline

Dependencies to packages defined in the same baseline

Dependencies to packages defined in other baselines

Dependencies to packages from the standard Pharo image.

To run this constrait use the code below:

GtBaselinesShouldProperlySpecifyDependencies new