Jump to content
Larry Hengen

Changes IDE Recommends for Compatibility with other Installed Packages

Recommended Posts

Posted (edited)

I have a DataAcess package which is UI framework neutral and uses FireDAC.  When I build the package it prompts me to add FMX in order to be compatible with other installed packages. The interesting thing is that it is a RunTime Only Package with Rebuild as Needed.  There is only one package in the project group that is a design-time package and it does not require the DataAccess package.  If I cancel the IDE dialog, everything works as expected, but it's very annoying and I would like to understand the root cause. 

I have a couple of defines {$IFDEF FMX} FireDAC.FMXUI.Wait, {$endif} that might be factors except that FMX is not defined.

 

The package is a single datamodule unit. with an interface uses as follows:

 

uses
  System.SysUtils, System.Classes, hcSQLMapper, hcTransactMgrIntf, hcComponent,
  hcFactoryPool, Data.DB, hcObject, hcPrimaryKeyConstraint,
  FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf,
  FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async,
  FireDAC.Phys, FireDAC.Phys.FB, FireDAC.Phys.FBDef,
  FireDAC.Comp.Client, hcFireDAC, FireDAC.Phys.IBBase, FireDAC.DApt, FireDAC.Comp.ScriptCommands,
  FireDAC.Stan.Util, hcLookupList, {$IFDEF FMX} FireDAC.FMXUI.Wait, {$endif}FireDAC.Comp.UI,
  FireDAC.Phys.IBDef, FireDAC.Phys.IB, FireDAC.FMXUI.Wait;

 

and an implementation uses as follows:

 

{$IFDEF FMX}
{%CLASSGROUP 'FMX.Controls.TControl'}
{$ENDIF}

{$R *.dfm}

uses
  hcQueryIntf, {$IFNDEF FMX} Vcl.Forms, VCL.Dialogs {$ELSE} FMX.DialogService, FMX.Forms, FMX.Dialogs {$ENDIF}, System.UITypes, FireDAC.Comp.Script;

 

The message content in the dialog is as follows:

 

Add fmx.
fmx contains implicit unit(s) FMX.Printer.Win, FMX.Consts, FMX.Graphics, FMX.Utils, FMX.Types, FMX.Styles, FMX.Forms, FMX.AcceleratorKey, FMX.StdActns, FMX.VirtualKeyboard, FMX.Controls, FMX.Menus, FMX.MultiResBitmap, FMX.Platform, FMX.Clipboard, FMX.Clipboard.Win, FMX.Helpers.Win, FMX.Surfaces, FMX.ImgList, FMX.ActnList, FMX.Platform.Common, FMX.BehaviorManager, FMX.Platform.Win, FMX.Forms.Border, FMX.Controls.Presentation, FMX.Presentation.Win, FMX.ZOrder, FMX.ZOrder.Win, FMX.Presentation.Messages, FMX.Controls.Model, FMX.Controls.Win, FMX.Presentation.Win.Style, FMX.Presentation.Factory, FMX.Presentation.Style.Common, FMX.Ani, FMX.Presentation.Style, FMX.TextLayout, FMX.Text, FMX.Effects, FMX.Filter.Custom, FMX.Types3D, FMX.Materials, FMX.Filter, FMX.StdCtrls, FMX.Switch.Win, FMX.Styles.Switch, FMX.Styles.Objects, FMX.Objects, FMX.FontGlyphs, FMX.FontGlyphs.Win, FMX.Switch.Style, FMX.Dialogs, FMX.DialogService.Sync, FMX.MultiTouch, FMX.AcceleratorKey.Win, FMX.KeyMapping, FMX.WebBrowser, FMX.WebBrowser.Win, FMX.Controls.Ole, FMX.MultiTouch.Win, FMX.Gestures.Win, FMX.Gestures, FMX.DialogService, FMX.Forms.Border.Win, FMX.Edit, FMX.Edit.Win, FMX.Edit.Style, FMX.SpellChecker, FMX.MagnifierGlass, FMX.Layouts, FMX.InertialMovement, FMX.ExtCtrls, FMX.Pickers, FMX.Pickers.Default, FMX.Calendar, FMX.Calendar.Style, FMX.ListBox, FMX.ListBox.Selection, FMX.DateTimeCtrls, FMX.DateTimeCtrls.Types, FMX.Canvas.GPU, FMX.StrokeBuilder, FMX.Canvas.GPU.Helpers, FMX.Materials.Canvas, FMX.TextLayout.GPU, FMX.Context.DX11, FMX.Context.DX9, FMX.Canvas.D2D, FMX.Canvas.GDIP, FMX.Printer, FMX.Dialogs.Win, FMX.DialogHelper, FMX.Dialogs.Default, FMX.Header.

 

Add fmxFireDAC.
fmxFireDAC contains implicit unit(s) FireDAC.FMXUI.Wait.

 

Is the IDE missing the fact that FMX is not defined, or what am I missing?

Change to DataAcess - Adding FMX.png

Edited by Larry Hengen
fix grammar

Share this post


Link to post
2 hours ago, Larry Hengen said:

The interesting thing is that it is a RunTime Only Package with Rebuild as Needed. 

This is a bad idea, should only ever be enabled while developing the package. Having the IDE rebuild packages which will be loaded into the ide isn't a good idea - I touched on rebuild as needed in this post https://www.finalbuilder.com/resources/blogs/advice-for-delphi-library-authors

 

What do you have in your dpk? Don't try ifdeffing in there (the IDE doesn't handle it well), better to create two separate package projects and explicitly add fmx or vcl to the requires clause. 

 

Share this post


Link to post

Thanks for the suggestions.  I changed all the packages to Explicit ReBuild, not that it was the cause, but a good change anyway.

 

Turns out I isolated the issue to the IDE injecting the FireDAC.FMXUI.Wait unit into the Interface section every time the unit was saved/compiled despite the fact it was already present, just wrapped in an IFDEF.  Took me a while to find out why it was adding the unit.  Turns out I had dropped a TFDGUIxWaitCursor component on the data module at some point.  Creating that component in code with the Provider set appropriately fixed the issue.  The dialog is obviously misleading as it has nothing to do with what packages are installed in the IDE.

  • Thanks 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×