Re: [Qbs] Graphviz export/generator

2019-07-22 Thread Christian Gagneraud
On Mon, 22 Jul 2019 at 21:25, Christian Kandeler
 wrote:
>
> On Sun, 21 Jul 2019 15:32:37 +1200
> Christian Gagneraud  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.

OK, might go for that then.

> 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.

Yes, that's the wrong granularity. That's why i want to plot the
inter-product dependencies, not source/artifacts dependencies.
And even with doing that the top graph might be too big.
CMake can generates a per-target graph (w/ forward/reverse deps) and
the whole thing, I might do something similar.
I might use env variables to communicate all options/customisations.

Any suggestion and/or wish list are welcome.

Thanks,
Chris

>
>
> Christian
> ___
> Qbs mailing list
> Qbs@qt-project.org
> https://lists.qt-project.org/listinfo/qbs
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Graphviz export/generator

2019-07-22 Thread Christian Kandeler
On Sun, 21 Jul 2019 15:32:37 +1200
Christian Gagneraud  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
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


[Qbs] Graphviz export/generator

2019-07-20 Thread Christian Gagneraud
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?

Thanks,
Chris
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs