Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude search paths from dproj when building with msbuild

Tags:

msbuild

delphi

I'm trying to build some Delphi XE projects using msbuild. While most work without a problem, some projects which have a lot of (and long) search paths, fail to build with this error message:

MSB6003: The specified task executable could not be run. The filename or extension is too long

I found the reason for this: I add differing search paths via /p:DCC_UnitSearchPath= some of which are not in the dproj file. This makes the command very long and msbuild fails.

So basiacally what I want to do here is just use the unit search paths I am setting via DCC_UnitSearchPath but exclude / ignore the search paths from the dproj file.

Is there a way to achieve this?

Thanks,

Greg

like image 276
Greg Avatar asked Mar 06 '14 17:03

Greg


1 Answers

Move parts of your search path to environment variables to access Spring4D, DSharp and VirtualTreeView:

DSharp=C:\Users\Developer\Versioned\DSharp
Spring4D=C:\Users\Developer\Versioned\Spring4D
VirtualTreeView=C:\Users\Developer\Versioned\VirtualTreeView

Then in your configuration specify them like this:

$(DSharp)\Source\Aspects;$(DSharp)\Source\Bindings;$(DSharp)\Source\Collections;$(DSharp)\Source\ComponentModel;$(DSharp)\Source\Core;$(DSharp)\Source\Logging;$(DSharp)\Source\PresentationModel;$(DSharp)\Source\Validation;$(DSharp)\Source\Windows;$(Spring4D)\Source\Base;$(Spring4D)\Source\Base\Collections;$(Spring4D)\Source\Core\Container;$(Spring4D)\Source\Base\Reflection;$(Spring4D)\Source\Core\Services
like image 160
Jeroen Wiert Pluimers Avatar answered Nov 03 '22 07:11

Jeroen Wiert Pluimers