Codex Delphi Expert
- Is an expert that can be installed into the Delphi IDE
- Helps boost your productivity
- Installs under the Tools menu
- Is completely free
- Supports Delphi 10.3 Rio, Delphi 10.2 Tokyo, and Delphi 10.1 Berlin (v1.0.0 only)
Installers can be found here on Github.
Please report any issues you find with Codex, here.
The global options for Codex can be managed by clicking Tools|Codex|Options – available options are
- Load last opened project – opens the project that was loaded last, prior to shutting down the Delphi IDE
- Delete .stat files – deletes .stat files generated by the IDE (at present, this function could be more reliable than it is)
- Adjust Project Options dialog size – automatically adjusts the height of the Project Options dialog, based on the available screen area
- Show editor tabs on the left – shows the editor tabs on the left hand side, like it used to! If you use CnWizards, disable the FeedReader Wizard until it is fixed
- Show Favorites menu – Inserts a menu item in the File menu in Delphi called Favorites, and populates with the Favorite Files items managed with GExperts
- Show Project Manager when opening a project or group (v1.1.0 and higher)
The old ACTED tool has been retired, and functionality has been migrated into Codex. The following items are available under the Android Tools menu:
- Build Jar – Allows building of .jar files from Java source, using the Java compiler from the JDK selected in the Options. See a more detailed explanation below
- Create R Jar – Allows creation of an R jar that can be included in Android projects. Useful for projects like the FCM Demo, when updating to a later version of Google Play Services
- Extract AAR Files – Extracts jar files and resources contained in AAR (Android Archive) files. The classes.jar file in each AAR is renamed to the use the same filename as the AAR, but with a .jar extension
- Import google-services.json – Extracts relevant information from google-services.json to create an appropriate .xml file for inclusion with Android projects. Useful for projects like the FCM Demo
- Java2OP front end (v1.1.0+) – Uses the Java2OP executable to import classes from jar files.
- LogCat Viewer – See a more detailed explanation, below – note: this has been removed in v1.2.2, please use Device Lens instead.
- Options – Used for configuring the settings that the other Android Tools items use
Used for deleting binaries from source folders. Currently supports removal of .exe, .dcu and .o files.
Feed Alerts (v 1.2.0+)
Have alerts for your favourite feeds right in the Delphi IDE, e.g. the latest reports from QP, the latest entries in CodeCentral etc. Feeds can be configured by calling up the alerts window, then clicking on the cog icon:
Click the Add button to add a feed and edit in-line in the listview:
Alerts appear (by default) in the bottom right hand corner of the IDE main window. The alerts window will remember its last position.
The tool buttons across the top of the alerts window are:
- Toggle all alerts as read/unread
- Mark all alerts as read, and close the alerts window
- Close the alerts window without changing anything
- Alerts Options
Codex has menu items that provide shortcuts (including keyboard shortcuts) to pages in the Delphi IDE Options dialog, namely:
- Environment Variables
- SDK Manager
The Image Assets menu item enables when a project is opened in the IDE. It helps manage icons/splash screen images in the project options for mobile applications. Invoking Image Assets presents this dialog:
Image Assets uses the directory of the current project, and searches for images that match the sizes for the icon/splash images required for mobile apps. If the “Include subdirs..” checkbox is checked, it will also search in subdirectories. The path edit box or ellipsis button can be used to select a different directory.
The image assets required for mobile projects is listed on the left hand side, whilst the matching images that have been found are listed on the right. Clicking Apply will apply the images found to the project options of the current project. If the “Remove existing entries..” checkbox is checked, any existing entries (such as the default FMX entries) will be replaced with the found images.
Build Jar (Android Tools) (v1.0.0+)
Shows a non-modal window that allows you to build jar files from Java sources. This is useful if you need to create Java classes that are descendants of other Java classes, as it is not yet possible to do so in Delphi, however you can then consume these descendants in your Delphi code. Once your jar is built, you can use the Java2OP front end in Codex to import the Java classes into Delphi code.
Build Jar can also be used to rebuild fmx.jar, which may be necessary if there is an issue that requires a change to the FMX java code (e.g. https://quality.embarcadero.com/browse/RSP-21841) or if you want to make a change yourself.
Build Jar configurations can be saved so that they can be loaded later if you need to rebuild the jar after a change. A pre-built configuration for fmx.jar is located here. You will need to modify the configuration if Delphi is installed on a 32-bit machine, or somewhere other than the default, and you will need to modify the Output File value to suit. Note: this configuration is for the Delphi 10.3 Rio initial release. You may need to change it for future releases.
This is the Build Jar window with the fmx.jar configuration file loaded:
Note: The ability to add folders of Java sources, the Versions options, the Clear and Options buttons were added in v1.1.1.
LogCat Viewer (Android Tools) (v1.1.0-v1.2.0)
Shows a non-modal, dockable window that behaves somewhat like Monitor, which comes with the Android SDK, in the tools folder below the SDK root (run using monitor.bat)
To start logging, select a connected device and click the Start logging button
Checking the Filter On Current Project checkbox filters messages based on the current project and is available if the project has the Android platform
Unchecking the Auto Scroll checkbox stops the grid from scrolling to the bottom automatically
Note: There are known issues with the LogCat Viewer on some older devices.
SDK Frameworks Import (v1.1.0)
This function allows you to import new iOS and macOS SDK frameworks in “bulk”, i.e. other than having to add them manually, individually, to each SDK where they’re needed. If you have a number of frameworks that you use in a project that are not included by default, this can save a lot of time when a new SDK is released, or when upgrading to a new version of Delphi.
In order to use this function, you need to create an import file, which is basically the same as the .defaultsdkpaths files you will find in the bin folder of the Delphi installation, except that it contains only the frameworks that need to be imported. When installing Codex, an example import file: iOSSDKFrameworksImport.Example.xml, is installed into the \Users\Public\Documents\Codex\Common folder, and you can modify this file to suit your needs.
When using this function, the following dialog is presented:
The first tab is for importing into existing SDKs. This modifies the registry settings, so after importing, you will need to(unfortunately) restart Delphi, bring up the SDK Manager, and click the “Update Local Cache” button for each selected SDK.
The second tab is for importing into the SDK defaults files:
This is for creating new versions of the defaultsdkpaths files, which are used by Delphi when adding an SDK. The new files will ensure that the additional frameworks will be added when the SDK is added, so the local file cache will have the required files.
As far as is understood, the file shown selected in the picture above (i.e. iOSDevice.defaultsdkpaths) is used when an SDK is being imported that Delphi is yet to support, e.g. iOS 12 in Delphi Tokyo 10.2.3, so you may want to select that by default when importing new frameworks.
Unless you are running Delphi with elevated privileges, you will need to select an output folder which has the appropriate permissions. Once imported, the resulting file(s) can be copied into the bin folder of the Delphi installation when Windows may prompt you for permission to write to that folder.
In both importing for existing SDKs, and importing into default SDKs, you will be presented with a summary of results, indicating which imports succeeded.
If the “Show Favorites” global option is enabled, and there are Favorite Files configured using GExperts, Codex will insert a “Favorites” menu in the File menu:
The top item in the “Regular” submenu example above is a special case, which is a reference to a folder. Files that are added to GExperts’ Favorite Files entries that end in .fav will be treated as being a favorite for the folder in which the file is contained, e.g:
Clicking a favorite entry in the Favorites menu that represents a folder, will present a open file dialog for that folder.