Delphi Multiplatform and The New Compiler

I was excited when Delphi introduced FireMonkey and added the ability to cross compile and debug on Win64, Mac OS and mobile platforms. I saw it as an opportunity to leverage massive libraries into new environments. The foremost technology was my Object Database which was standard Delphi but originally used some Windows APIs for communications. Changing the communications to Indy was put on the TODO list and I purchased a Mac to get a Mac OS platform.

Delphi is a Multiplatform Development

There are always subtle differences in platforms so it seemed multiplatform DUnit testing should also go on the TODO list. I had already looked at converting Delphi DFM forms to FMX forms. By converting the single DUnit form to Firemonkey I was able to achieve DUnit Testing on the Mac. Not quite as simple as I had expected as this was circa XE5 and Firemonkey had no TImageList component while the DUnit form made extensive use of image lists. The TListView in FireMonkey is also an entirely different beast to the (Windows OS) functionality made available in the VCL version. Some style changes and a unit (FMXTreeViewLib) containing a TTreeNode derived from TTreeViewItem were developed to enable the DUnit Form.

The New Compiler

A new compiler has been introduced for mobile development and when someone tried to use the DUnit code in the mobile environment further tweaks were needed. I believe the code now available in my GIT Hub repository now works fine for Android devices. When it comes to validating my libraries and porting my Object Database the new compiler adds further challenges. In the new compiler auto-reference counting is implemented and mandatory, strings indexes are zero based and there is no AnsiString implementation. The availability of DUnit testing on the Android platform is a great help as I try to resolve all these issues.

Leave a Reply

Your email address will not be published.