views:

266

answers:

4

We are using Subversion for SCC. We have a great deal of our build environment in our repository so that we can check a given version out and rebuild it fairly close to what was in use at that time. We have the following in there now:

InnoSetup binaries Third Party Components VCL (including Indy) Our Source (of course) Finalbuilder project files

The only thing missing is the binaries for Delphi itself - I am wondering if there is a minimum set of files that can be copied to the repository and run.

Thanks

+2  A: 

If you want to create a build environment that can be replicated easily, you'd be better off setting up a virtual machine and hosting the image on a network share instead of trying to deal with thousands of individual files through an SVN server.

Mason Wheeler
Thanks for the response - we definitely want to keep this within SVN because our developers are in different locations, but SVN is accessible to everyone (via multifactor VPN).
bcrooker
+1  A: 

The Delphi license was updated a few versions ago to explicitly allow the installation of the command line compiler on build PCs for the purposes of doing automated builds, so I agree with Mason that it is a good idea to set up a separate machine (virtual is good) for doing builds.

I can successfully do Delphi command line builds after copying the following tree structure (the folders and all contained files and subfolders) from the PC on which I have installed Delphi (2007 in my case) to a separate build box. There appears to be no need to enter any registry keys/values etc.; it just works fine as is for me.

C:\Program Files
  \CodeGear
    \RAD Studio
      \5.0
        \bin\*.*
        \lib\*.*
        \source\*.*
  \Common Files
    \RAD Studio
      \Shared Assemblies
        \5.0\*.*

I would expect Delphi 2009/2010 to be the same/similar.

I have the above tree structure in our SVN repository along with all our source, so if I set up a new build PC, most of my initial setup involves simply doing a SVN Checkout into the right place on the new build PC.

Conor Boyd
Thanks - I was able to find a minimum set of files (about 2 dozen, all from BIN folder) that were required for compiling. We already had the lib folder in SVN. Nothing else is apparently needed.
bcrooker
I'd be interested to know what the bin\ subset of files is. Please could you post it? We include the VCL source when building, so that's useful for us to include in SVN.
Conor Boyd
See my post above with the listing. That combined with the MSBuild action in FinalBuilder and things are working great.
bcrooker
+2  A: 

We are about to embark on setting this up for Delphi 2010 ourselves. We previously (and indeed currently) have exactly this setup for our FinalBuilder automated builds with Delphi 2006.

In that case all we did was take a copy of the contents of the installation folder of Delphi 2006 itself (Program Files\Borland\BDS\4.0). That is everything, Bin, Lib... the lot (i.e. exactly as we have on our dev machines).

The only difference between the dev machines and the build machine is that Delphi isn't actually INSTALLED on that machine, but this does not affect the ability to run the command line compiler (which is what we use in our automated builds).

The only other thing we had to do was to manually create some registry entries so that FinalBuilder would detect and recognise the presence of Delphi 2006 on the machine and provide the required library paths etc. This we did by exporting the necessary keys/values from a dev machine and importing to the registry of the build machine (the resultant .reg file is also part of our build config within the repository).

I cannot say what the minimum set of files is because we were not concerned with conserving disk space and simply took everything "just in case". You may be able to save a few MB's by trimming off some fat, but in comparison with the disk consumption of an automated build environment (source, intermediate and compilation products etc etc) I suspect the savings will be negligible and not worth the hassle.

Deltics
Thanks - see my post below, I found a VERY small set of files after some digging around.
bcrooker
+2  A: 

Ok - I think I have this working. I was able to compile our application under a VMware guest that didn't have any of our developer tools (RAD Studio, EurekaLog, etc.) installed. Basically I have a Compiler folder with these files:

Turns out you only need a few files. Basically these files:

02/05/2008  05:13 PM            89,088 BorDebug.dll  
11/02/2009  06:02 PM            57,344 Borland.Build.Tasks.Common.dll  
11/02/2009  06:02 PM           147,456 Borland.Build.Tasks.Delphi.dll  
11/02/2009  06:02 PM            49,152 Borland.Build.Tasks.Shared.dll  
11/02/2009  06:02 PM            20,480 Borland.Globalization.dll  
08/19/2009  05:00 PM            22,370 CodeGear.Common.Targets  
08/19/2009  05:00 PM            32,928 CodeGear.Delphi.Targets  
11/02/2009  06:02 PM         1,328,128 DCC32.EXE  
02/25/2010  08:17 AM           979,456 ecc32.exe  
11/02/2009  06:02 PM           314,368 lnkdfm140.dll  
02/25/2010  08:11 AM            40,960 Process.exe  
08/19/2009  05:00 PM            75,264 rlink32.dll  
06/15/2010  08:41 AM               185 rsvars.bat  

Maybe I could snip a few more of these files out as well. We also have a components folder that has all of the built-in VCL files (basically the lib and Indy10 folders) and our third-party components. In Delphi I made the Library path setting blank — this step is key. I then put that Library path setting in the specific project options. We used environment variables to specify where the built-in and third-party files were. These environment variables are set in RAD Studio, and then can be set via command line when performing the release compilation. So we have a BAT file like this:

SET BDS=C:\_Releases\Compiler
SET COREFILES=C:\_Components\D2010
SET COMPONENTS=C:\_Components
SET LANGDIR=EN

Our library path looks something like this:

$(COREFILES)\lib;$(COREFILES)\Indy10;$(COMPONENTS)\EurekaLog;$(COMPONENTS)\Jcl\source\common;$(COMPONENTS)\Jcl\source\windows

Now in our virgin VMware session that just has MSBuild and the raw files described above I can call these commands:

msbuild project.dproj -t:rebuild /p:config=Release  
ecc32 --el_alter_exe"project.dproj"

Which builds our application. Granted we are just using the Delphi32 personality which simplifies things, but for us I think this will work fantastic.

bcrooker