On Tue, 8 Nov 2016, Mattias Gaertner via Lazarus wrote:
On Sun, 6 Nov 2016 11:59:44 +0100 (CET)
Michael Van Canneyt via Lazarus <lazarus@lists.lazarus-ide.org> wrote:
[...]
It would be good to have an option in the package system to write and/or
register the package version somewhere, so it is accessible at runtime, and
an application can query the various packages and their versions.
AFAIK most users asked for the version at compile time. So it must be
either a define or some consts in an unit like lclversion does.
The defines would create many ugly FPC parameters, fpmake can't
create them.
The 'version unit' is compatible with all build systems and works at
runtime too. It is not supported by codetools yet though. Maybe the IDE
can automatically update/create such version units.
I'm not sure we're talking about the same thing. I don't know what 'version
unit' you mean ?
I have software which consists of many different packages which we control,
from different SVN repos. In order to correctly identify the version of each
package on a production system, I need somewhere a registry of versions of
all used packages.
For each package I now create an include file with a version string which is
written to a central registry. At runtime I query the registry and display
for all used packages the version number.
As far as I know, the version number of a lazarus packages lives outside the
sources, it resides just in the LPK. I now use some XML routines to extract
this version number from the .lpk and write it in the abovementioned include
file. This happens in our build system.
I don't necessarily expect lazarus to provide such a central registry, but
to be able to have a version unit for each package would be nice, so I no
longer need to do the XML trickery or adapt the build system manually...
But please, this is a nice to have, it was just a thought after seeing the
lclversion tip.
Michael.
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus