We're slowly converting a big and complicated collection of Delphi 6 projects to Delphi 2007.
In Delphi I can use compiler directives in dpr, dpk and pas files to make different code visible to different versions. For example:
requires
rtl,
vcl,
vclx,
{$IFDEF VER180} //Delphi 2007 and later
IndyCore,
IndySystem,
IndyProtocols;
{$ELSE} //earlier than Delphi 2007
I开发者_如何学GondyCore60,
IndySystem60,
IndyProtocols60;
{$ENDIF}
However, I don't know how to do the same in a dof file. The requires clause above is for a package that is used by a program. I want that program to have a different packages setting for different versions of Delphi. So I want to put something like the following in the dof file:
{$IFDEF VER180}
Packages=vcl;rtl;vclx;IndySystem;IndyCore;IndyProtocols;MyPackage;
{$ELSE}
Packages=vcl;rtl;vclx;IndySystem60;IndyCore60;IndyProtocols60;MyPackage;
{$ENDIF}
I'm very new to Delphi 2007 so hopefully I'm missing something really obvious!
Any suggestions received gratefully.
In Delphi 2007, you don't need the dof files anymore. All information is in the dproj file.
With version 2009 you can create different build configurations.
But as I understand it correctly, you have a code base in Delphi 6 and want to convert it slowly to 2007?
First why not directly to 2010? You get unicode support (this can be a reason not to go to 2009/2010). The IDE of 2010 is great to work with. Stable and some new features. If unicode is not your thing, but you want 64 bit in the end, you need to go through the unicode phase in the end so why not right now.
Next, you can share the unit files. But create different projects for each Delphi version. The project files are too version specific to share between versions.
D2007 doesn't use *.dof's. Instead the options are stored in YourProject.dproj. So there should be no conflict.
精彩评论