Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Delphi-News aus aller Welt (https://www.delphipraxis.net/58-delphi-news-aus-aller-welt/)
-   -   Classic Tip: From Default Project Options to RAD Studio Option Sets (https://www.delphipraxis.net/200247-classic-tip-default-project-options-rad-studio-option-sets.html)

DP News-Robot 2. Apr 2019 17:20

Classic Tip: From Default Project Options to RAD Studio Option Sets
 
In early versions of Delphi and RAD Studio, a user could change some of the current project options and (with a check box) save them as default, that is as the initial options for any future project. It was also possible to change this configuration by selecting the Project Options when no project was active. This feature is long gone (I think*it was dropped from XE2 or XE3).

What's the alternative? It is called option sets and it is way more powerful that the default project options. YOu can read about it in the RAD Studio*Doc Wiki at http://docwiki.embarcadero.com/RADSt..._Sets_Overview. Here are some notes from my "Delphi 2009 Handbook" adapted to 10.3 Rio and with new images.

In the Project Manager you can select a build configuration and export its settings to an “option set” file. This is like saving a configuration template or skeleton to an external file, and the configuration will be linked to the file. You can create a new option set starting from the Project Options dialog (save) or apply an existing set:

http://blog.marcocantu.com/images/fo...ptionset01.png

This makes it easy to move those same settings to a new or another existing project, as you can use the Project Manager (using the Apply Options Set local menu item while on a build configuration) or the Project Options dialog box (using the Apply Options button) to import a set of configuration options. In both cases Delphi opens up the Apply Option Set dialog box, in which you can pick a file and choose whether to keep the external configuration file linked (so that a change in the file will be reflected in the projects using it) or simply merge the current settings using some priority rules.

Once you have created an external option set on a file, you can edit it from any project referring to it, using the Edit local menu of the Project Manager pane:

http://blog.marcocantu.com/images/fo...ptionset03.png

This opens up the an editor containing a subset of the pages of the Project Options dialog box, as shown below:

http://blog.marcocantu.com/images/fo...ptionset04.png

The .OPTSET file is an XML file with a format similar to the .DPROJ format, again based on the MSBUILD XML format, and an OptionSet project type. This is a simple example of its contents:

* * * * * * false * * * * true * * * * PerMonitorV2 * * * * * * * * Delphi.Personality.12 * * * * OptionSet * * * * * * * * * * * * * * * * * * 12 * * While this is an old feature, I'm pretty sure a few of the RAD Studio and Delphi users might have missed it. Notice that having multiple proejcts with settings linked to the same option set allows you to edit the configuration of many projects at once, and still override the default in each individual project as needed.

http://feeds.feedburner.com/~r/marco...~4/FTF0lsZQsPA

Weiterlesen...


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:54 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz