For those of you have different editions of Delphi installed I am interested in how you arrange your projects for the different editions. The use case is where one has a production project developed in one version of Delphi (XE6 in this case) but would like to transition the project to a new verison of delphi but in the interim one needs to maintain the old version. eg do you have a completely different Embarcardero folder for each Delphi edition (probably not)? I've searched around but its not something I've seen discussed.
For those of you have different editions of Delphi installed I am interested in how you arrange your projects for the different editions. The use case is where one has a production project developed in one version of Delphi (XE6 in this case) but would like to transition the project to a new verison of delphi but in the interim one needs to maintain the old version. eg do you have a completely different Embarcardero folder for each Delphi edition (probably not)? I've searched around but its not something I've seen discussed.
It's unclear if you're asking about Delphi or the source code for the apps you're working with.
ReplyDeleteEach version of Delphi is installed in its own file tree, and they run independently. I've got several versions of Delphi installed; they all run with no problem. Just remember that the apps mapped to different file extensions that launch when you double-click on, say, a .dpr file can only point to one version of Delphi. (I have .pas launch my text editor, not the IDE.)
As far as your source code goes, yes, it's probably smart to keep your source in separate file trees as well so that you can rebuild your release version with the proper version of Delphi while you're working on migrating it to the newer version.
For example, in the case of a component, we only have separate project files (.dpk, .dproj) with different name suffixes for each version of Delphi. The source files (.pas) are the same, because anyway the compatibility across versions is tested and IFDEFed where necessary.
ReplyDeleteIn your case, it would be a good idea to branch out the code and work on the new version separately, since you need to be able to build old and new versions all the time. Also .dproj files will change between versions, so you will need to keep a separate copy of these too.
It's complex for explaining it in a forum, but I recommend you a searching on google for this term and similars "Parallel Development Strategy for Software Configuration Management".
ReplyDeleteYou should create two branches in your repository. One for the maintained version and other for the new developments.
In the maintained branch you should only make fixes, not new functionalities. The new functionalities are developed always in the branch of the future new version.
Every time you need it, you can merge, the changes in the maintained branch version, with the "future new" version branch, to consolidate this changes.
Really is easier that is seems. Try it!
Our production code is compiled in XE5, but I'm using Delphi 10.2.2 Tokyo for my development. We have all the third party components working on both versions, I've also used conditional defines for code specific to each version . I've actually used the latest version on my machine XE6, 7, 8, Seattle, Berlin, and now tokyo. Our build machine still has XE5. I use the same folders, as the code works in all the versions.
ReplyDeleteI use a build tool (Finalbuilder) to perform the release builds of my projects.
ReplyDeleteTo convert an existing Delphi project to a new Delphi version, I make a copy of the existing Finalbuilder build script and specify the new Delphi version to use for compilation. If the project won't compile correctly, the build log will tell me why. Then I make changes to the source code (using the old IDE) and/or search paths (in Finalbuilder) until everything compiles correctly with as few warnings as possible. If I have to change the sources, I use ifdefs if necessary to stay 100% compatible with the original Delphi version so I don't break anything.
Under no circumstances do I open the project with the new Delphi IDE before it compiles correctly in Finalbuilder using both the old and the new Delphi version.
If the compiled project runs and behaves as expected, then I consider opening it in the new Delphi IDE, not sooner. And until that time, I maintain it using the old IDE.
Oh, and everything is in a subversion repository so I can rollback any changes if necessary...
/interested
ReplyDeleteJuan C. Cilleruelo I did a google search on "Parallel Development Strategy for Software Configuration Management" and the third hit was your comment here! Google is very fast at tracking content.
ReplyDeleteDavid Schwartz I was refering to how you organize your source code including components or common code when you have multiple Delphi editions. I was thinking of having Documents\Embarcadero\Studio point to different Project folders for the different editions and in Studio also have a folder that contains any common code that is compatible across all editions. eg Embarcadero\Studio\ProjectsXE6, Embarcadero\Studio\ProjectsXE7, etc but I don't know what others do or whether there has developed best practice for this situtation. Seems that developers have their own unique way of handling this.
ReplyDeleteregarding components, many get installed in your /Program Files (x86)/ folder by default these days. Personally, I like to put them into their own file tree, like /dcomps///...
ReplyDeleteHowever, component libs are packaged in two ways: one assumes they're put inside of your Delphi file tree, so the source compiles to just one set of DCUs and BPLs for that version of Delphi. The other has a src folder (typically) as well as a bin or lib folder, under which is a separate folder for each version of Delphi that you have.
So in my /dcomps/ tree, I'll have separate folders for each Delphi version in which I'll put the first type of components. The second type will be put right under /dcomps/, not under the Delphi version folder.