Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reorganize the folder structure of my units in Delphi?

I started a prototype with Delphi with all source files under one single directory.
Now, I want to reorganize everything with folders.

I found two way to do this.

1/ First is to open each unit in Delphi IDE and Save as the new folder. Then delete the old unit file.

2/ Under windows explorer, reorganize everything, then open the project in Delphi IDE, remove reference to old (unknown) units, and then add each unit folder by folder.

As I have 100+ units, it is really painful, whatever method I use (1 or 2).
How are you doing such reorganization ? Did I miss a feature ?

like image 912
TridenT Avatar asked Sep 27 '12 08:09

TridenT


1 Answers

I didn't check for XE, but in XE2 this is quite easy to do inside the IDE:

  • in case of multiple projects have all projects in one project group
  • in the project manager for each unit do
    • rename the unit by pressing F2 or use the context menu
    • while renaming place the subfolder in front of the unit name (e.g test\Unit1.pas)

The IDE will move the unit (removing the old one) and promote this change to all projects in the project group.

like image 140
Uwe Raabe Avatar answered Sep 24 '22 17:09

Uwe Raabe