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:
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.