4
votes

I am using Delphi XE. Since Delphi 2007, it supports Project Group (.groupproj) that we may add projects into it.

We may define various build configuration for projects in "Build Configurations" e.g.: Debug and Release build.

Since Delphi 2010, a runtime variable $(Config) may be used to set Output Directory like: .\$(Config)

In this example, $(Config) translated to "Debug" for Debug build and "Release" for Release build respectively.

When Debug build is activated in build configuration, output file will stored in ".\Debug" folder relative to the current directory.

This is a nice feature so we may have output files stored in various folders for builds defined in Project's Build Configuration.

Furthermore, using the "Build" menu item in context menu (pop-up menu via mouse right click) of "Build Configuration" perform compilation for all builds underneath.

Unfortunately, I have more than 200 projects in my project group. Each project has Debug and Release build defined. I don't find any way to trigger an action to build Debug and Release build for 200 projects at once.

The only solution I knew so far is using View | Configuration Manager to change the active configuration before each build. However, that would marks all project as modified.

Please share your thoughts on how to compile all builds available to a project group.

Thank you.

1
Do you have to compile in the IDE? Otherwise just use MSBuild on a command prompt.Uli Gerhardt
BTW: I tried the Configuration manager approach in D2007 and AFAICT it didn't mark anything as modified.Uli Gerhardt
@Ulrich: I am using Delphi XE. It mark projects to modified state after I switch the build configuration in Configuration Manager.Chau Chee Yang
@Ulrich: Not necessary have to compile in IDE. However, I have invest few thousand every years for the Delphi IDE. It should allow me to do those works.Chau Chee Yang
It has to mark them all modified. What if your RELEASE build turns off debugging info, or your DEBUG has a {$DEFINE DEBUG} in it that your RELEASE shouldn't include? The IDE has no way of knowing, so it needs to build them all if the group-level configuration changes.Ken White

1 Answers

7
votes

I have added a item to the Explorer context menu for *.groupproj calling this *.bat:

call  "C:\Program Files (x86)\CodeGear\RAD Studio\5.0\bin\rsvars.bat"
MSBuild %1 /t:Build /p:Configuration=Release
if errorlevel 1 goto Fehler

goto :EOF

:Fehler
pause

So I can do a release build from Explorer with two mouse clicks.

Screenshot of ReleaseBuild item in Explorer context menu