Builders in kdev4

Andreas Pakulat apaku at gmx.de
Fri Jan 19 20:35:32 UTC 2007


On 19.01.07 12:59:16, Matt Rogers wrote:
> On Friday 19 January 2007 9:55 am, Andreas Pakulat wrote:
> > Hi,
> >
> > I wanted to ask this for some time now, but always got distracted. If I
> > understand the current API correctly for QMake, CMake or any other
> > buildsystems to work properly we need to implement a ProjectBuilder. For
> > example for qmake it would call qmake on certain occasions.
> >
> > What I don't see at the moment: How to avoid code-duplication, I mean a
> > QMakeBuilder would only run qmake once per project or eventually on
> > special occassions, but normally its much the same as the existing
> > MakeBuilder. So how should this be working, subclass the MakeBuilder?
> > (it does provide virtuals so that would be possible) Link to it and call
> > its methods?
> >
> > Andreas, who won't implement the qmakebuilder anytime soon, but as we
> > are discussing API at the moment ;)
> 
> It depends. I see two options.
> 
> Option 1: We could have the build managers manage their respective build 
> systems (so qmake build manager would handle qmake invokations, cmake build 
> manager would handle cmake invokations, etc.)
> 
> Option 2: We allow builder chains. So for a QMake project, we would have two 
> builders. A QMake builder and a Make builder. The build manager would then 
> set up a chain such that (when needed) the qmake builder is run and then the 
> make builder is run. Neither builder knows about the other. The build manager 
> takes care of knowing which builders are needed.

Well, I don't see too much of a difference between the two, in option 1
we'd do some more stuff when build() is executed in the build
manager, in case 2 we'd defer that to the builder chain and just make
sure that the configured build tools are executed in the right order.

Option two would allow us to let the user define build chains and
include for example XML Syntax checker, Parser-Generators and such
stuff. This can of course also be done via custom rules in the
buildsystem the project uses, but thats often much more complicated to
setup I guess.

So I think option 2 would be what we should target, then we'd also need
a way to add project files to a specific builder, i.e. adding a few xml
files that should be run by the xml-syntax-checker and two grammar files
that act as input for the build() function for the kdev-pg-grammar-builder.

Andreas

-- 
Your aims are high, and you are capable of much.




More information about the KDevelop-devel mailing list