I’m not aware there is any OTA functions that will do this for you so you need to write a parser/replacer which looks for the macros (use regex) and then replace with the appropriate info. For BDS related macros you need to read some registry info. I wrote an article the other day on that and you will find them in BDSs environment block.
Yes, but replace with what? That's the entire problem. ModuleName (or anything that appears to be it, and it should change when the active project is changed) is not in the environment block. I may have to go with the project filename with .dpr removed, however I'm concerned that is not going to be reliable
Okay, wrong end of the stick. You need to look at the project options (IOTAOptionsOptions I think) and it’s members. In my ITHelper I use this to build a target name for the project. My stuff it on GitHub @ github.com - · GitHub and the project is call Integrated Testing Helper. Sorry for the lack of info I’m on a platform waiting for a train.
IOTAProject.ProjectOptions.TargetName. There is an example in Procedure TITHResponseFile.BuildTargetFileName(Const strBasePath: String); in the above project.. Note: the targetname can be modified in code, I’ve tried to handle the change of extension but LIBSUFFIX and the like can also change it.
Tried TargetName - unfortunately it is not the same thing. e.g. in an Android project, the $(ModuleName) can be SomeProject, TargetName is libSomeProject, and as you say, it can be modified
I’m not aware there is any OTA functions that will do this for you so you need to write a parser/replacer which looks for the macros (use regex) and then replace with the appropriate info. For BDS related macros you need to read some registry info. I wrote an article the other day on that and you will find them in BDSs environment block.
ReplyDeleteYes, but replace with what? That's the entire problem. ModuleName (or anything that appears to be it, and it should change when the active project is changed) is not in the environment block. I may have to go with the project filename with .dpr removed, however I'm concerned that is not going to be reliable
ReplyDeleteOkay, wrong end of the stick. You need to look at the project options (IOTAOptionsOptions I think) and it’s members. In my ITHelper I use this to build a target name for the project. My stuff it on GitHub @ github.com - · GitHub and the project is call Integrated Testing Helper. Sorry for the lack of info I’m on a platform waiting for a train.
ReplyDeleteIOTAProject.ProjectOptions.TargetName. There is an example in Procedure TITHResponseFile.BuildTargetFileName(Const strBasePath: String); in the above project.. Note: the targetname can be modified in code, I’ve tried to handle the change of extension but LIBSUFFIX and the like can also change it.
ReplyDeleteTried TargetName - unfortunately it is not the same thing. e.g. in an Android project, the $(ModuleName) can be SomeProject, TargetName is libSomeProject, and as you say, it can be modified
ReplyDelete