Why use JCL UNITVERSIONING?
Asked Answered
I

1

8

The JCL library have an conditional define UNITVERSIONING. I don't know why this option exists and don't know how to use this. I know that there are a unit called JclUnitVersioning.pas, but can't find a use.

Where to use this in a real word project?

Irishirishism answered 9/3, 2011 at 19:34 Comment(0)
E
7

It supports the JclUnitVersioning unit, which exposes the constants like these in a more coherent way:

{$IFDEF UNITVERSIONING}
const
  UnitVersioning: TUnitVersionInfo = (
    RCSfile: '$URL: https://jcl.svn.sourceforge.net/svnroot/jcl/tags/JCL-1.101-    Build2725/jcl/source/common/Jcl8087.pas $';
    Revision: '$Revision: 1$';
    Date: '$Date: 12/05/2008 10:29:10$';
    LogPath: 'JCL\source\common'
    );
{$ENDIF UNITVERSIONING}

An old version of the JclUnitVersioning unit is here]1 and gives you a rough idea how it works: the unit has a global function GetUnitVersioning: TUnitVersioning; which gives you back the version information for all units that support UNITVERSIONING.

From there you can enumerate them, and ask for details.

This is very handy for instance when you want to know which exact version of a unit gets linked into your .EXE.

--jeroen

Extramundane answered 9/3, 2011 at 20:14 Comment(4)
For example, suppose you ship a version of an application to your customer, and he submits bug reports to you. Maybe you might want to know what version of JCL-SubcomponentX, or MyCustomComponents-Y was involved in this statically linked build of your final product (your big application).Impedance
That looks hugely helpful. If I understand it, you could have a function to report the unit version (if present) of every unit in a given application? Including source branch... Would make it easy to spot merge issues.Berkin
Exactly. I might have five big apps, for example, all of which share a common DB Layer. Maybe I might want to know that UberWare 3.2 ships with DB Layer 2.1, but MegaSoft 2.4, only had DB Layer 2.0. Problem solved. For anybody who did't know this, the RCS tags above are automatically updated at checkin time, not only by RCS and CVS, but also by some other version control systems like subversion.Impedance
@Chris: you got the message; this is is immensely useful. @Warren: if you use TortoiseSVN, you need to alter some settings; somehow for me it didn't update those out of the box.Extramundane

© 2022 - 2024 — McMap. All rights reserved.