[Qbs] Graphviz export/generator

Christian Kandeler Christian.Kandeler at qt.io
Mon Jul 22 11:24:58 CEST 2019


On Sun, 21 Jul 2019 15:32:37 +1200
Christian Gagneraud <chgans at gmail.com> wrote:

> Hi there,
> 
> I would like to be able to export a (graphviz) graph of a project and
> i'm thinking about writing a new ProjectGenerator plugin for that.
> The first kind of graph would be a product dependency graph.
> 
> Once i have access to the top level resolved project, AFAIU, the rest
> should be easy. As i can access all resolved products, and resolved
> products have a list of resolved product "dependencies".
> 
> ProjectGenerator are executed after the project is resolved, good, but
> the API doesn't give access to the TopLevelProjectPtr, which seems to
> be my only available entry point.
> Any idea on how to tackle that? What would be the less intrusive API
> change that would allow RO access to build/graph dependency data from
> the generator plugins?

You could just cheat by adding a helper function to the Project class; that'd probably still be the cleanest. 
You might also be interested to know that we had something like that
and it got removed: https://codereview.qt-project.org/c/qbs/qbs/+/38596
So perhaps check it out for hints on what not to do.


Christian


More information about the Qbs mailing list