Delphi Compile Action.LibraryPath refresh?

Hi guys

In my build script, I have a Delphi Compile action where I need to change the version of Delphi I compile with. Essentially, it's based on a build parameter which indentifies the codeline I'm building.

However, when I change the Action.CompilerVersion property in my BeforeAction script, the Action.LibraryPath does not change in synch which is different from what happens with you change it in the UI. And the Compile action then fails building it's cfg due to not being able to expand either $(DELPHI) or $(BDS) respectively.

Is there a way to force the Delphi action to reload the correct Action.LibraryPath for the appropriate CompilerVersion like it does in the UI?

If not, I'm forced to have an IF block and two Delphi Compiler actions which seems clumsier.

Regards, Paul.

Hi Paul

In this case you should have the “Use Global Delphi Library Path” option checked, then it will act as you need.

Vince wrote:
  Hi Paul

In this case you should have the "Use Global Delphi Library Path" option checked, then it will act as you need.

Unfortunately, I tried that and it doesn't seem to make any difference. At least not in FinalBuilder 4.

if it's helps to clarify here is the key snippet of BeforeAction code:

 

 Action.AlwaysUseDelphiLibraryPath = True
 MsgBox(Action.LibraryPath)
 Action.CompilerVersion = 0
 MsgBox(Action.LibraryPath)
 Action.CompilerVersion = BUILDWITH ' 4 = Delphi7, 11 = Delphi 2006
 MsgBox(Action.LibraryPath)
 Action.LibraryPath = Replace(Action.LibraryPath, "..\..\Newlook\", "..\Newlook\")
 Action.AlwaysUseDelphiLibraryPath = False

 

Each MsgBox shows the exact same out of date path that the action currently has (albeit shown greyed out due to the option) but the Global library options have been updated and the action never seems to see them.

I'm guessing that FinalBuilder's actual implementation of Action.LibraryPath is that it only gets used for the .cfg if Action.AlwaysUseDelphiLibraryPath is False and is completely ignored otherwise, as opposed to Action.LibraryPath being populated with the global library path if told to and Action.LibraryPath always being placed into the .cfg

 

That would explain the behaviour I'm seeing and would normally work just fine unless you're trying to work with the default library path in Action code like I'm trying to do.

 


 

Hi Paul

You can access  the delphi library paths using the options object in script :

dim opt

set opt = GetOptionsObject("Borland Delphi")
if not (opt is nothing)  then

    msgbox opt.D2007LibraryPath

end if


Note that code completion only shows up to D2005 however the properties are there for 2006 & 2007 (the xml code completion file needs updating).

HTH