Tuesday, January 29, 2008

TDM Rerun #2: A Better Build Process

I had to live with the problem. Until the day when it occurred to me that I could very probably find the solution to my problem on the internet. So I connected to Deja News and searched.

- A Better Build Process, The Delphi Magazine #49, September 1999

A life without Google? Was that really possible? I can hardly remember those times.

The article was written in Delphi 4 times and deals with building Delphi applications from a command line. More specifically, it solves the problem of dynamically recreating project.res file, which is something that you have to do if you want to increment build number in the version info resource during the build process. (A utility to increment build number was included, too.)

Also on display was a batch file that built my trusty GpProfile profiler and a "very complicated" tail utility.

{$APPTYPE Console}
program tail;
SysUtils, Classes;
str : TStringList;
i : integer;
first: integer;
str := TStringList.Create;
first := str.Count-StrToIntDef(ParamStr(2),20);
if first < 0 then first := 0;
for i := first to str.Count-1 do Writeln(str[i]);

Not much has changed in the Delphi world - I would code it almost identical today.

Links: article (PDF, 70 KB), source code (ZIP, 185 KB)


  1. Anonymous20:53

    I'm a big fan of GpProfile and have used it many times in the past. Is there a version for D2007 available? Many thanks

  2. I'm working on a new release. Some weeks I am working more, some weeks not at all. But it will be release - hopefully before the next Delphi is out.

  3. There are quite a few bugfixes in the VCL (as well as the RTL), but we'll not go into them in detail here. While remaining binary .dcu compatible, CodeGear has managed the feat of adding new functionality and even new properties on the existing TCustomForm class.
    Link Building

  4. Hm, yes? I don't get the point.

  5. Anonymous10:03

    Thank you very much for posting this!! This is by far the best approach I've found online for dealing with resources during a Delphi build.

    I know this is two years after posting, but hey - the article itself is from 11 years ago :) A life without Google...my brain can't even process such a though anymore.