Forum > General
lazbuild for lpg files
ConfusedSushi:
Is it possible to build Lazarus Project Groups via command line? E.g.
--- Code: ---lazbuild MyGroup.lpg
--- End code ---
Or is there an alternative to group several project files (*.lpi) and build them altogether?
MarkMLl:
Unfortunately it is not. I think I raised that as a minor issue a few months ago in a fairly long thread that was dealing with lazbuild parameters etc., but not many of us are using the .lpg plugin (which is a pity, since it's useful).
If this is causing you major grief I suggest raising a bug report.
MarkMLl
ConfusedSushi:
Here you go https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41102
MarkMLl:
In the interim it should be easy enough to write a few lines of $language_of_choice to parse the .lpg file, it looks as though the only things necessary are the name of the .lpi file and the build mode.
The only real issue is intelligent handling of when something goes wrong: if one of the projects fails to build should (the equivalent of) a "make distclean" be done to erase what's already been done?
MarkMLl
n7800:
I think it's not hard to implement, but there are some "logical" difficulties. Project groups are just a package (plugin) for the IDE. And lazbuild, AFAIK, doesn't support plugins. Of course, it would still be possible to implement lpg support "natively", but that's not quite right.
And it would still entail the problem that MarkMLl mentioned - adding new command line parameters with error handling, build order, etc. lazbuild already has a lot of parameters, and it's hardly worth overloading it. IMO, I think very few users use project groups...
An alternative option is a separate utility (in the "components\projectgroups" folder) that can be built together with the package, and can even be moved to the lazarus root folder (next to lazbuild) to be accessible from the $PATH environment variable.
glazbuild, lazbuildg, lazbuildgrp, grplazbuild, lazpjgrpbuild...? I'll leave it to you to come up with a name for such a utility )) Since it will most likely be accessible from $PATH, the name should mention its affiliation with Lazarus.
This utility can be just a "wrapper" that just parses the lpg file and calls lazbuild sequentially for each project. And it can have the above parameters for processing the build order, errors, etc. I think this will be an acceptable option that will rid lazbuild of unnecessary code and parameters, and will not clutter the installation if this plugin is not installed.
Navigation
[0] Message Index
[#] Next page