2

i have two projects in a project group:

  • ProjectA
  • ProjectB

Whenever i open the ProjectGroup.bpg in Delphi, it always starts with the 2nd project as the active one:

  • ProjectA
  • ProjectB

And every time i have to flip it to the the "real" project:

  • ProjectA
  • ProjectB

How can i make ProjectA the default project that opens with the project group?


ProjectGroup.bpg

#------------------------------------------------------------------------------
VERSION = BWS.01
#------------------------------------------------------------------------------
!ifndef ROOT
ROOT = $(MAKEDIR)\..
!endif
#------------------------------------------------------------------------------
MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
DCC = $(ROOT)\bin\dcc32.exe $**
BRCC = $(ROOT)\bin\brcc32.exe $**
#------------------------------------------------------------------------------
PROJECTS = ProjectA.exe ProjectB.exe
#------------------------------------------------------------------------------
default: $(PROJECTS)
#------------------------------------------------------------------------------

ProjectA.exe: ProjectA.dpr
  $(DCC)

ProjectB.exe: childfolder\ProjectB.dpr
  $(DCC)

See DUnit: How to run unit tests for the practical reason.

Community
  • 1
  • 1
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219

4 Answers4

2

Far from ideal but the only way I know is like

  1. in the Delphi IDE, right click your default project in the Project Manager and select Build Later.
  2. or Switch the lines for Project A and Project B in the .bpg file.
Lieven Keersmaekers
  • 57,207
  • 13
  • 112
  • 146
  • Very far from ideal, since **ProjectB** depends on **ProjectA**. – Ian Boyd Mar 25 '10 at 19:54
  • @Ian Boyd: I assume you mean that that is a problem when doing a Build All? – Lieven Keersmaekers Mar 26 '10 at 08:07
  • @Liven: That can sometimes be a problem. The real problem is that now when everyone opens "the project": Delphi initially shows us some **other** project. A project other than the one that was active when i saved and closed everything. – Ian Boyd Mar 26 '10 at 14:38
  • @Ian Boyd: I've never noticed that. As for test projects, I tend to have my test projects as the first project in the project manager, the actual project as second. When I need to run the tests, it comes down to `CTRL-SHIFT-F11`, `Arrow up`, `Enter`, `F9`. – Lieven Keersmaekers Mar 26 '10 at 15:44
1

You might have a stuck desktop settings file. Look for a .DSK file associated with your project group, and delete it.

Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
1

In Delphi 7 (and I presume later also) you can select the 'active' project in the project group tree by double-clicking it. If you then do 'Save Project Group As' by right clicking the top of the project tree, the active project is saved with the group and will open at that when you next open the project group.

Brian Frost
  • 13,334
  • 11
  • 80
  • 154
0

Place file ProjectGroup.dsk in project folder with text:

[ActiveProject]
ActiveProject=1

or set check to TRUE in Environment Options -> Preferences -> Autosave Options -> Project Desktop, this will create DSK files for projects and groups automatic!

AlexanderT
  • 79
  • 1
  • 8