0

I'm trying to build projects in project group from command line using MSBuild. After reading this page, my batch file looks like this:

SET BDS=C:\Program Files (x86)\Embarcadero\Studio\17.0
SET FrameworkDir=C:\Windows\Microsoft.NET\Framework
SET FrameworkVersion=v3.5
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild" .\Source\MyProjectGroup.groupproj /t:build /p:config=Debug /p:Platform=Win32 /verbosity:minimal /fileLogger /fileLoggerParameters:LogFile=Build.log;Verbosity=detailed;Append=true

Build fails, if I try to perform a "clean" build (that is, get source files from source control and run build from command line).

Looks like it tries to build projects in order they are placed in groupproj file. Consider this example:

  • there are two package projects, package A and package B;
  • package B requires package A;
  • package B is placed before package A in groupproj file.

In this case, "clean" build will fail, but if I reorder projects in project group, or build package A first, build will be successful.

E.g., MSBuild targets for C# resolve dependencies from project references.
But groupproj neither include dependencies info:

<Projects Include="NativePackages\Drawers\Drawers.dproj">
    <Dependencies/>
</Projects>

nor processing DCC_Reference properties in dproj files:

<DCCReference Include="Drawers.dcp"/>

Am I doing something wrong?
Is there any option/property to trigger?
Could MSBuild targets for Delphi resolve dependencies automatically?

UPDATE

I know about "Dependencies..." context menu item in Project Manager (it just affects Dependencies tag in groupproj file).

Dennis
  • 37,026
  • 10
  • 82
  • 150
  • No experience with Delphi projects, but can you create a solution and setup dependencies there? If so, build that sln file on the commandline using msbuild after setting the MSBUILDEMITSOLUTION environment variable and it will create an .sln.metapoj file in which you will see the proper msbuild way of specifying dependencies. – stijn Jan 07 '16 at 08:41
  • @stijn: I suppose, I can write dependencies in `groupproj` file by hand, since it's just an msbuild project file... but this doesn't differ from re-ordering projects. – Dennis Jan 07 '16 at 08:43
  • Indeed it doesn't really differ.. Then again, the way C# projects 'resolve' dependencies is also because one manually specifies dependencies through project references so I think there's always going to be a manual step involved. – stijn Jan 07 '16 at 08:48
  • What's the problem with ordering the projects in the group? That's naturally how they should be anyway. – Jerry Dodge Jan 07 '16 at 14:51
  • @JerryDodge: this isn't a problem, when performed once. When project grows, maintaining project order becomes a pain, especially, when using CI server. Furthermore, since Delphi uses MSBuild now, ordering projects is not a right way to go - you have to set *dependencies* explicitly to build them, when you need to build particular project. 99.9% of time I'm using Visual Studio. Projects are sorted alphabetically by default, and grouped logically using solution folders. Project dependencies are maintained automatically. *This* is natural. It's sad, that Delphi IDE still sucks. :( – Dennis Jan 09 '16 at 07:58
  • @JerryDodge: to clarify previous comment. I've been used Delphi from version 3. When MS released VS 2003, it became clear, that Delphi IDE has serious competitor. When Borland released BDS2006, Delphi became almost dead for me and I've switched on .NET and VS almost completely. It's sad, that I've installed Delphi *23* (according version number !) and see almost the same ugly IDE from BDS 2006. – Dennis Jan 09 '16 at 08:03

0 Answers0