[Qbs] Get rid of extra product type statements when generating graphviz dependency graphs using qbs

Christian Kandeler christian.kandeler at qt.io
Mon Dec 12 10:40:15 CET 2022


On 12/11/22 19:08, qbs at mein-briefkasten.net wrote:
> Just "Depends { name: "depgraph” }” was not enough, I had to extend the type of
> every lib to get all dependencies show up in the graph, i.e.

Yes, and the reason is explained here: 
https://doc.qt.io/qbs/qml-qbslanguageitems-rule.html#rules-and-product-types

> Depends { name: "depgraph" }
> type: base.concat(["dot-fragment”])

You want 
https://doc.qt.io/qbs/qml-qbslanguageitems-module.html#additionalProductTypes-prop.

> The leanest way from a qbs user perspective would be to just do a
> -----
> CppApplication {
> name: “app”
> ...
> }
>
> DotDependencyGraph {
> name: “app-dependency-graph”
> Depends { name:  “app” }
> }
> -----
> So no need to add a Depends to every related product and just pull the
> dependencies via the single app dependency, but no idea if this would be
> possible and how to do it.

It's just a matter of how you write your rule, no? You have access to 
the dependency tree of products via product.dependencies.


Christian



More information about the Qbs mailing list