Package (DPK) Options and Version Question

Hi,

I am currently evaluating FinalBuilder 5 (5.5.0.348) and have some questions by now.

I want to create Build Tasks for different components/packages I am using with Delphi 7, 2006 and 2007. Most of these packages are single source for all versions, only differing by the .dpk package project file. When creating a Delphi compile action I set all compiler and version options for the package, as for a release version for example Optimization=on, Debug Info=off etc. As a Delphi package file (.dpk) has compiler options included, like {$DEBUGINFO ON} and {$OPTIMIZATION OFF} - and these switches supersede any command line switch or .cfg file, the problem is that even if I configure a release version in FinalBuilder, the compiler generates a debug version, if the switches are set like that in the .dpk file. (Btw, this does not only affect FinalBuilder, but MSBuild in Delphi 2007 as well. If I start MSBuild from the command line it does compile to settings in the .dpk file, regardless what configuration I choose via the /p:configuration switch.)

A solution is to delete all the compiler switches from the .dpk file, but the next time I open the package in the IDE and save the project, all the current options are included into the .dpk again; not that good.

Does someone has an idea how to circumvent this behaviour, or am I missing something obvious?

Another question: In the Version Information I'd like to have the "OriginalFilename" property filled with the output bpl, dll, exe or else. As I don't want to type the resulting filename into each compile action, but automate this with FB I need a variable or something that represents the filename of the resulting compilation. Example: Compile MyPackageD2007.dpk, result MyPackageD2007.bpl, and this should be filled in as the "OriginalFilename"; something like the "Auto update FileVersion" switch for that property.

Is there a way to accomplish this?

Anyway I have to say I am really impressed by FB5, I recommended and used some previous version when doing consulting at  some company, and I appreciate the steady improvements the product receives.

Thanks in advance for the help, kind regards -

christoph

Hi Christoph

On the Delphi action, there is an option to “Update Package Source”. This option is there to work around the problem you describe, ie you cannot override compiler directives that are in the source code. This option causes finalbuilder to parse the dpk file and update the values of the compiler directives. The downside to this is that you must have the dpk writable.

For the second problem, you could probably tackle this with a short bit of script in the BeforeAction script event :

dim sFileName

sFileName = Action.ExpandExpression(Action.ProjectFile) 'deal with variable references.
sFileName = ExtractFileName(sFileName) 'remove the path from the filename
Action.SetVersionInfoKey “OriginalFilename”,sFileName


HTH

Works like charm, thanks. Although I had to add the line

FileName = ChangeFileExt(FileName, ".bpl")

to the script to get the right extension.

Best regards,

christoph