Search code examples
delphidelphi-ide

Delphi IDE Project "Clean" Command — What does it do?


Running Delphi 2007 (and probably other versions as well, I'm guessing), if I right-click on a project in the Project Manager (either EXE of BPL in this case), there is a "Clean" command above Compile and Build. What exactly does it do?


Solution

  • To "clean" a build means to delete all intermediate and output files generated by the compiler. Some compilers or IDEs also have a "clean & build" or "rebuild all" option which essentially performs a clean, followed by a build.

    When you rebuild an existing project, compilers generally only rebuild files it determines are changed or new. This is, of course, to save time by not completely recompiling the entire project each time. However, sometimes this has problems; you will find your program getting strange errors or not working right. This increases with the number of dependencies within your project - they may not be rebuilt properly. In this case, you will find that cleaning the output and re-building from scratch will solve the problem.

    It is also generally recommended to do a clean before building any release versions for the same reason.