Mass change for hundreds of "build" actions

The team I’m working in is moving a huge code base (hundreds of Delphi projects) up from the dark ages of .zip file source backups and batch scripts with Delphi 5 to modern tools with Git, FinalBuilder, and Delphi 12. As we’re building the infrastructure of unit tests and FB scripts, I’m keeping in mind the future as I’m helping them realize the benefits of keeping up with technology instead of staying on one version of Delphi forever.

When I first started testing and promoting the idea of using FinalBuilder, we were on Delphi 11. I wrote several scripts and showed how this could be used to install our custom libraries into Delphi and also how to build the various projects and move away from batch scripts.

Then we bought FinalBuilder and also upgraded to Delphi 12. As I’ve been pulling those scripts out and trying to compile, then getting weird errors, I’ve realized they were all built to compile with Delphi 11–and I have to go in and manually change every single build action item from Delphi 11 to Delphi 12.

This wouldn’t be a problem with dozen or two projects but we have 1500 Delphi projects! I really only want to set these up once but someday, if/when we move to Delphi 13 or 14 or whatever, we’ll have to change all of these FB actions.

Is there a tool or a way to do that?

The reason I ask now (way ahead of time) is if there’s a trick to setting up these actions, like using a variable or something, I want to do that now instead of changing everything later. Or, I might switch to using a batch file called by FB to do the compilation (ok, probably not as that would be kinda backwards).

What’s the best advice here?

Hi David

You can change the compiler version using a variable, however that needs to be done in a script event.

On the delphi action, switch the the script editor view, select the BeforeAction event tab and select Javascript as the language

Action.CompilerVersion = FBVariables.DelphiCompilerVersion;

Declare a FinalBuilder variable, set the type to integer and the default value to 29 (for delphi 12).

One thing to note when switching compiler versions this way is that it doesn’t do anything to update the action’s Search Path or Library Path - this is not a problem is you use variables for that or have “Always use search path from project settings file” and “Use global delphi library path”. If you have manually set the the search path/library path then you would need to take care of that.

Oh interesting–of course! Change it in a BeforeAction event.

Currently, each developer has a a copy of FinalBuilder installed on their development machine–no separate build machine (yet). So all the projects have the correct paths in them and therefore, I have all the build actions set to “Load settings from project file” for Directory, which automatically checks those two options you mentioned.

This will work well! Thank you!