-
-
Notifications
You must be signed in to change notification settings - Fork 302
Multi project build order
When you build a bnd project in ant the dependencies are built first. This explains how the ordered set of dependencies is computed.
First of all, you can explicitly specify projects to build with
-depends:project1,project2,...
Second, you can supply one or more DependencyContributor bnd plugins to modify this set, for instance
-plugin:org.foo.MyDependencyContributor;prop1=value1,prop2=value2
The DependencyContributor is given the current project and the depends set (modified by previous DependencyContributors)
For instance, it's easy to write a DependencyContributor that adds all projects in the workspace, for a "build-all" project.
Third, you have specified the bundles your project depends on with the
-buildPath:bsn1,bsn2,...
When a bsn is from a project in the workspace, it is added.
Now we know the direct dependencies for the "current" project. The set of ordered transitive dependencies is calculated by a simple tree traversal of these projects, skipping duplicates. This results in an ordered set of projects in a suitable order to build in.
The code for this is in Project.prepare (computing the direct dependencies) and Project.traverse (computing the transitive dependencies).