Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Installing XE7 on a build server


This question is answered. Helpful answers available: 0. Correct answers available: 1.


Permlink Replies: 8 - Last Post: Oct 22, 2015 8:10 AM Last Post By: Andrew Denton
Andrew Denton

Posts: 4
Registered: 10/18/08
Installing XE7 on a build server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 20, 2015 8:39 AM
Hi,

The company I'm currently working for has a large mixed code base of both .NET and Delphi. I'm currently migrating the Delphi apps from 5 & 6 up to XE7. They use TFS and build agents to produce the .NET stuff and I'm wanting to install XE7 on a build server so that TFS can execute builds of the Delphi XE7 projects via MSBuild. I've searched everywhere and cannot find a definitive guide to installing Delphi on a build server. I only want the command line stuff, not the IDE.

So far I've created folders for both the compiler and the 3rd party components used, modified the RSVars batch file to reflect my paths and created a small Build test project. If I run a command prompt, run rsvars then try to execute
MSBuild BuildTest.Dproj /t:build
I get :-

error MSB4057: The target "build" does not exist in this project

Does anyone have any ideas what the problem is? Any ideas, tips etc, greatly appreciated.

It would be nice if Embarcadero, gave the option of an IDE-less install expressly for build servers. I'm sure I'm not the only one with this requirement.
quinn wildman

Posts: 856
Registered: 12/2/99
Re: Installing XE7 on a build server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 20, 2015 9:00 AM   in response to: Andrew Denton in response to: Andrew Denton
I'd have a look here:
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Command-Line_Utilities_Index
What command line utility's you need depends on your build requirements.
It's entirely possible all you need on your build machine is dcc32.exe.

Andrew Denton wrote:
I only want the command line stuff, not the IDE.
Andrew Denton

Posts: 4
Registered: 10/18/08
Re: Installing XE7 on a build server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2015 12:49 AM   in response to: quinn wildman in response to: quinn wildman
Thanks for the reply, Quinn. Whilst that was useful for background information, I really need to get projects building through MSBuild, as that's what the TFS build agent expects.

quinn wildman wrote:
I'd have a look here:
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Command-Line_Utilities_Index
What command line utility's you need depends on your build requirements.
It's entirely possible all you need on your build machine is dcc32.exe.

Andrew Denton wrote:
I only want the command line stuff, not the IDE.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Installing XE7 on a build server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2015 5:07 PM   in response to: Andrew Denton in response to: Andrew Denton
Andrew wrote:

Thanks for the reply, Quinn. Whilst that was useful for background
information, I really need to get projects building through MSBuild,
as that's what the TFS build agent expects.

In the latest TFS 2015 version, TFS can now invoke command-line apps as part
of the build process. That was the big reason my company was excited to
upgrade recently, as we should now be able to incorporate our existing C++Builder6
projects into our automated TFS builds.

--
Remy Lebeau (TeamB)
Thomas Grusche

Posts: 14
Registered: 6/29/00
Re: Installing XE7 on a build server
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2015 6:00 AM   in response to: Andrew Denton in response to: Andrew Denton
Hi Andrew,

if you show a mail address I can send you a minimal quick-and-dirty batch file which include a Delphi build with MSBuild.

Another solution can be a MSBuild project as a wrapper for a Delphi project. Then you can use it directly with TFSBuild. But this needs more work.

Regards,
Thomas
Andrew Denton

Posts: 4
Registered: 10/18/08
Re: Installing XE7 on a build server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 21, 2015 7:16 AM   in response to: Thomas Grusche in response to: Thomas Grusche
Hi Thomas,

Thanks for the reply and the kind offer.

A bit of an update on this :-

I've now successfully managed to get a test project compiling and building on the command line using dcc32. MSBuild now executes correctly (it appears you have to specify the latest version of the .NET framework and the MSBuild that comes with it - older versions complain), however I'm now getting error F1027: Unit not found: 'System.pas' or binary equivalents (.dcu)

which looks to me to be a search path issue, but I don't understand how it compiles fine when I use DCC32.

Cheers,

Andy

Thomas Grusche wrote:
Hi Andrew,

if you show a mail address I can send you a minimal quick-and-dirty batch file which include a Delphi build with MSBuild.

Another solution can be a MSBuild project as a wrapper for a Delphi project. Then you can use it directly with TFSBuild. But this needs more work.

Regards,
Thomas
Thomas Grusche

Posts: 14
Registered: 6/29/00
Re: Installing XE7 on a build server
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 22, 2015 5:54 AM   in response to: Andrew Denton in response to: Andrew Denton
Hi Andrew,

I think your Delphi enviroment is not correctly installed for the compile with MSBuild.

At our company we also have a mix of .Net and Delphi Projects. For streamlining our build processes we test using MSBuild for building Delphi projects (And we were successful).

Because we cannot attach files in this forums I show you the text of a demo CMD File for this purpose at the end of my reply. I think the important points are covered.

This CMD File works on every machine where you have MSBuild and Delphi. Normally that are the minimum settings for such a build.

If you use TFS Build you can directly link a Delphi DProj in a build if you set your Delphi Environment correctly on the build machine.

By the way, we use Delphi XE7.

Regards,
Thomas

+ Demo Build Delphi Project with MSBuild +

@echo off
:::
::: Example for Build Delphi Project with MSBuild
:::

echo.
echo using MSBuild from VStudio 2013
echo.
SET MSBUILD_EXE=C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe

echo.
echo A copy of a Delphi installation from a developers machine is ok. MSBuild calls dcc32/dcc64, not the IDE.
echo The build targets are included in "$(DelphiInstallDir)\bin\CodeGear.Delphi.Targets".
echo DefaultTarget is "Make"
echo.

echo.
echo Set Delphi XE7 Vars
echo.
SET BDS=D:\DevTools\Embarcadero\Studio\15.0
SET BDSBIN=%BDS%\bin
SET BDSLIB=%BDS%\lib

echo.
echo On a local Delphi developer machine the actual used Delphi settings are located here:
echo "%APPDATA%\Embarcadero\BDS\15.0\EnvOptions.proj"
echo.
echo The directories and files included in "EnvOptions.proj" must exist on the build machine!!!
echo.
echo Copy the (maybe modified) Delphi settings on your build machine to %APPDATA%\Embarcadero\BDS\15.0
echo.
MKDIR "%APPDATA%\Embarcadero\BDS\15.0"
COPY /Y /B /V "%~d0%~p0EnvOptions.proj" "%APPDATA%\Embarcadero\BDS\15.0\EnvOptions.proj"

echo.
echo Set the Delphi Project Vars
echo.
SET PROJECT_SRC=D:\TheProjects
SET PLATFORM=Win32
SET CONFIG=Debug

echo.
echo Build Delphi Project with MSBuild
echo.
echo + /p = Parameters for the Delphi Project Build
echo.
echo + /t = Targets to be executed, e.g. Clean and Build
echo.
"%MSBUILD_EXE" "%PROJECT_SRC%\myProject\myProject1.dproj" /p:Config=%CONFIG%;Platform=%PLATFORM% /t:Clean;Build

IF NOT ERRORLEVEL 0 GOTO ERROR

GOTO END

:ERROR
echo.
echo There were errors!
echo.
pause
EXIT

:END
pause
Andrew Denton

Posts: 4
Registered: 10/18/08
Re: Installing XE7 on a build server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 22, 2015 8:10 AM   in response to: Thomas Grusche in response to: Thomas Grusche
That did the trick!

Thank you very much Thomas! :)

It probably helps that we are running pretty much identical environments, but the cmd file you posted works very nicely indeed. There was a small typo (you have to call %MSBUILD_EXE%, not %MSBUILD_EXE ) but aside from that it works pretty much out of the box.

Thanks again.

Cheers,

Andy
Thomas Grusche wrote:
Hi Andrew,

I think your Delphi enviroment is not correctly installed for the compile with MSBuild.

At our company we also have a mix of .Net and Delphi Projects. For streamlining our build processes we test using MSBuild for building Delphi projects (And we were successful).

Because we cannot attach files in this forums I show you the text of a demo CMD File for this purpose at the end of my reply. I think the important points are covered.

This CMD File works on every machine where you have MSBuild and Delphi. Normally that are the minimum settings for such a build.

If you use TFS Build you can directly link a Delphi DProj in a build if you set your Delphi Environment correctly on the build machine.

By the way, we use Delphi XE7.

Regards,
Thomas

+ Demo Build Delphi Project with MSBuild +

@echo off
:::
::: Example for Build Delphi Project with MSBuild
:::

echo.
echo using MSBuild from VStudio 2013
echo.
SET MSBUILD_EXE=C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe

echo.
echo A copy of a Delphi installation from a developers machine is ok. MSBuild calls dcc32/dcc64, not the IDE.
echo The build targets are included in "$(DelphiInstallDir)\bin\CodeGear.Delphi.Targets".
echo DefaultTarget is "Make"
echo.

echo.
echo Set Delphi XE7 Vars
echo.
SET BDS=D:\DevTools\Embarcadero\Studio\15.0
SET BDSBIN=%BDS%\bin
SET BDSLIB=%BDS%\lib

echo.
echo On a local Delphi developer machine the actual used Delphi settings are located here:
echo "%APPDATA%\Embarcadero\BDS\15.0\EnvOptions.proj"
echo.
echo The directories and files included in "EnvOptions.proj" must exist on the build machine!!!
echo.
echo Copy the (maybe modified) Delphi settings on your build machine to %APPDATA%\Embarcadero\BDS\15.0
echo.
MKDIR "%APPDATA%\Embarcadero\BDS\15.0"
COPY /Y /B /V "%~d0%~p0EnvOptions.proj" "%APPDATA%\Embarcadero\BDS\15.0\EnvOptions.proj"

echo.
echo Set the Delphi Project Vars
echo.
SET PROJECT_SRC=D:\TheProjects
SET PLATFORM=Win32
SET CONFIG=Debug

echo.
echo Build Delphi Project with MSBuild
echo.
echo + /p = Parameters for the Delphi Project Build
echo.
echo + /t = Targets to be executed, e.g. Clean and Build
echo.
"%MSBUILD_EXE" "%PROJECT_SRC%\myProject\myProject1.dproj" /p:Config=%CONFIG%;Platform=%PLATFORM% /t:Clean;Build

IF NOT ERRORLEVEL 0 GOTO ERROR

GOTO END

:ERROR
echo.
echo There were errors!
echo.
pause
EXIT

:END
pause
Olivier Sannier

Posts: 424
Registered: 8/26/01
Re: Installing XE7 on a build server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 22, 2015 12:24 AM   in response to: Andrew Denton in response to: Andrew Denton
Andrew Denton wrote:
Hi,

The company I'm currently working for has a large mixed code base of both .NET and Delphi. I'm currently migrating the Delphi apps from 5 & 6 up to XE7. They use TFS and build agents to produce the .NET stuff and I'm wanting to install XE7 on a build server so that TFS can execute builds of the Delphi XE7 projects via MSBuild. I've searched everywhere and cannot find a definitive guide to installing Delphi on a build server. I only want the command line stuff, not the IDE.

So far I've created folders for both the compiler and the 3rd party components used, modified the RSVars batch file to reflect my paths and created a small Build test project. If I run a command prompt, run rsvars then try to execute
MSBuild BuildTest.Dproj /t:build
I get :-

error MSB4057: The target "build" does not exist in this project

Does anyone have any ideas what the problem is? Any ideas, tips etc, greatly appreciated.

It would be nice if Embarcadero, gave the option of an IDE-less install expressly for build servers. I'm sure I'm not the only one with this requirement.

Here is the command line we use here:

C:\WINDOWS\Microsoft.NET\Framework\$(MsBuildFramework)\MSBuild.exe
/v:normal /p:$(ConfigAttributeName)=$(ProjectConfig) /p:LANGDIR=en
/p:DCC_MESSAGE_DIRECTIVE=false "/p:Platform=$(ProjectPlatform)"
"$(ProjectName).$(Extension)"

We don't specify /t unless we are building a specific project inside a
project group, in which case we use /t:ProjectName.

And we also make sure that the BDS environment variable is set to the
root folder of the Delphi installation, that where the bin and lib
folders are located (C:\Program Files (x86)\CodeGear\RAD Studio\5.0 for
instance).

Note that we have various replacements in the command line because some
values depend on the Delphi version used. Here are the values we use:

D2007
MsBuildFramework=v2.0.50727
ConfigAttributeName=Configuration

DXE
MsBuildFramework=v2.0.50727
ConfigAttributeName=Config

DXE2
MsBuildFramework=v3.5
ConfigAttributeName=Config

DXE7
MsBuildFramework=v3.5
ConfigAttributeName=Config

ProjectConfig and ProjectPlatform are the values you can see in the IDE.
(Debug/Release, Win32/Win64)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02