1

Is it possible to automate setting the Option Set file reference programmatically when creating a new Delphi project using the IOTAProjectOptions respectively IOTAProjectOptionsConfigurations interface1?

Or can I do that using any of the other OTAPI IDE services2?

I'm currently using the RAD Studio Delphi 10 Seattle IDE. Though, if newer OTAPI versions would support that feature, I'd still like to know about that.

I couldn't find any appropriate property or function, that seems to do that action in my current ToolsAPI.pas.

I want to achieve the same as choosing Apply Option Set -> Reference at the root project configurations root node in the IDE's project manager view:

enter image description here

Hypothetically I'm looking for some functionality like

procedure IOTAProjectOptionsConfigurations.BaseConfiguration.ApplyOptionSetReference
   (const optSetFilePath : string);

A bit more background:

I'm currently developing legacy project wizards for our company wide Delphi project settings. I already have a working IOTAProjectCreator implementation that also manipulates the .dproj MSBuild XML file after it was generated and saved by the IDE. I'm just adding some conditional Import elements there.

Now we also want to use a Options Set file that is stored at a central repository. I know and studied the differences done in the .dproj XML, after that action was applied using the GUI, but there's a non negligible amount of logic going on (regarding dependencies and such), and I'm refraining to (re-)implement that logic via plain XML file manipulations. Not to mention that the necessary logic is prone to be changed with future versions of the IDE.


1)I'm trying to use that in the context of a IOTAProjectCreator implementation, with the definition of the procedure SetInitialProjectOptions(NewProject : IOTAProject); function.

2)It's a shame that these features are documented so poorly.

Community
  • 1
  • 1
user0042
  • 7,917
  • 3
  • 24
  • 39
  • I edited the title and tags. There's no such thing as XE10 and you aren't using XE. – David Heffernan Dec 19 '17 at 19:54
  • @David THX. I'm using RAD Studio Seattle actually. I don't know exactly what the compiler version is. – user0042 Dec 19 '17 at 19:56
  • The compiler version is displayed in the caption of the IDE. Mine says something like `Project68 - RAD Studio 10 Seattle - Project68.dpr`. The About box also tells you the version. – Rudy Velthuis Dec 19 '17 at 20:22
  • @Rudy THX. I don't have it at hand. I know that there are certain OTA interface versions for certain compiler / IDE versions. I didn't find anything for mine though. – user0042 Dec 19 '17 at 20:30
  • The OTAPI is the only way to manipulate the IDE with code.The older versions are *extended* by the newer ones. So a new version may have more functionality, but old functionality is not removed. So everything you see in the ToolsAPI sources for Seattle is available for Seattle too. – Rudy Velthuis Dec 19 '17 at 20:36
  • @Rudy /OT Do you know if any of the Embarcadero devs hang around here? I know of Remy and David as reputable tag contributors (no Embarcadero employees though). I also have some contacts via FB, but getting informal contact to Embarcadero officials beyond getting spammed with their marketing stuff, seems to be hard to impossible. – user0042 Dec 19 '17 at 22:15
  • @David ^^^^^ I don't want to write the whole thing again. Not to mention I mentioned you ;-) – user0042 Dec 19 '17 at 22:16

0 Answers0