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?

dsolimano
  • 8,870
  • 3
  • 48
  • 63

1 Answers1

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

Jeroen Wiert Pluimers
  • 23,965
  • 9
  • 74
  • 154
  • 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). – Warren P Mar 09 '11 at 21:07
  • 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. – Chris Thornton Mar 09 '11 at 21:09
  • 1
    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. – Warren P Mar 10 '11 at 01:40
  • @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. – Jeroen Wiert Pluimers Mar 10 '11 at 06:07