How to save Delphi Library Path saved in FB variable and reused in actions?

Hi,

I want to be able to use variable in Library Path in Delphi compiler action and I could not find good article how to do it.

If I save the current values of Library Path in variable and put it in the action - just doesn't work. Even if it try to show it with MessageDialog it shows nothing. Is the $(..) convention causing this?

My goal is to be able to clone git repo with my Delphi source code in a different directory (c:\x next time c:\y etc) and still be able to build it with the same FB project.

In fact the FB project will do it before the compilation. The problem is that some of the paths are to sub folders of the working copy of the repo and they cannot be static any more.

With XE4 I use optset files and it helps a lot but FB doesn't support them.

I have more than 60 Delphi project in that FB project and it is no fun to go and modify them on addition of component or some path change, that's why I'm currently using "Use global registry.."

Could you help me how to make Delphi Library Path dynamic?

Thanks,

Nik

Hi Nik

Variables do work in the library path. There are so many different ways to set up the library path, you really haven’t given us enough info to be able to figure out what is happening. If you are using Delphi environment variables then you need to make sure you enable the option to import them in the FinalBuilder options dialog. My guess is you have some Delphi environment variable references in the variable you are storing the library path in. That will not work, because the Delphi action virtualises delphi environment variables and they only work when referenced directly by the action. The reason this is done is to allow supporting multiple versions of delphi on the same machine.

If you have subfolders that need to be referenced in your project, the best way to do this is in the Delphi project’s Search Path (using relative paths) and then tell FinalBuilder to use the values in the delphi projects settings file (dproj). Note that these are stored per configuration, so make sure to set the correct configuration on the action. This is exactly how we build FinalBuilder, very little is put on the Library Path as that affects all projects. We build FinalBuilder with FinalBuilder (which is run by Continua CI), each build occurs in a clean workspace, our source code and libraries are all put in that workspace as required and it builds using the same search path as on our developer workstations.

We have a growing repository that contains more than 60 projects.
We are restructuring a lot lately to include new components, divide current code to layers etc. that heavy envolves directory structure change.
In some cases it is easy to use the search path exactly as you describe it, but for so may project it is no fun.
We use option sets with those search path changes and it works as a charm inside Delphi IDE, but FinalBuilder could not use them. In a sence I need to go and modify the search path in 60 projects to make it work without using .optset files or registry Library Path.
I’m search a way to not do that.
My first attempt was to use FB variable for the Delphi Library Path, but as you wrote it is not working.

Could you suggest me another approach except modifying the search path in each project?