10

Let's say we have a team that works on many different projects. Each team member uses different set of visual/non-visual controls/components during it's development cycle. Since Delphi requires each component to be compiled and installed globally in the IDE, how to manage this situation while working with project which was started by the other team member?

It would be great if I could checkout the sources of a project from the version control and have the ability to compile it immediately. I don't care or sometimes don't know what visual or non-visual components are required for this project, I guess they all should be included in the project sources.

Maybe there are some tools which could read main project file or directory and compile/install all the needed components on project loading (and uninstall them when project is closed)?

How do you handle this issue in Delphi?

Danubian Sailor
  • 1
  • 38
  • 145
  • 223
Linas
  • 5,485
  • 1
  • 25
  • 35
  • 3
    This question may have some answers for you: http://stackoverflow.com/questions/8957128/setting-up-a-large-software-system-in-delphi. However, if you need to edit forms, there is no way around having to install at least the visual components. We have added scripts to our source control to automate uninstall and install of the relevant keys in the registry. Does require an IDE restart of course. – Marjan Venema Oct 16 '12 at 19:25
  • I usually maintain an "all components" package file, alongside the source code of each project, containing all components that are used within the particular project. I then just have to open a single package and rebuild it, in order to make sure that all necessary components are in place, before I start working on the project source code itself. – bjaastad_e Oct 16 '12 at 23:05

3 Answers3

5

In our company, we have the same problem. We solve this by forcing everyone to have all necessary library paths added to their delphi ide.

We are using an additional sdk/framwork repository which containins all components/sdks/frameworks of everyone . We keep a single text file, listing all libs with its version, install infos, etc. Everyone checks their wanted libraries, so we do not have double libraries or different versions.

Since we all work under Windows and since Delphi keeps its paths and (afaik) installed-components informations in the registry, we extracted these informations. We store for each used delphi version a .reg file within the sdk repository trunk.

So, if someone changes a framework, he updates the informations for everyone in the .reg files and commits it.

now, if someone wants to setup their dev-machine, they check-out the sdk, adds the e.g. xe2.reg informations to their registry, then check out the project and ... tada. compiling.

We have not tried to extract the "installed components" packages. thats on our to-do list. An alternative would be to keep a batch file for building and installing all sdk packages at once. But i do not know if installing components via commandline is possible in delphi.

Something like the JEDI installer would be nice. The installer detects installed Delphi versions and builds & installs everything nicely. A freely configurable version would be nice, so add all sdks -> install on each version.. perfect.

Hugie
  • 455
  • 5
  • 17
4

Anyone who wants to compile a given project must first install any components that project is using. There is no getting around that, unless the project directly includes the components source code and instantiates the components in code instead of using a DFM. AFAIK, there is no IDE tool that will automated component (un)installation on a per-project basis for you.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 6
    There is a way to achieve this by creating an IDE plugin that automatically detects if a "project specific component package" has to be recompiled and installs it into the IDE when the project-group is opened and uninstalls it when the project-group is closed. But in order to do this you have to patch and hook into the IDE as the OpenToolsAPI isn't rich enough to do it.This also requires the package to have a clean finalization code. – Andreas Hausladen Oct 16 '12 at 19:43
  • 1
    @AndreasHausladen It is a pity that no one ever made such a IDE plugin. – Linas Oct 16 '12 at 20:22
  • "Anyone who wants to compile a given project must first install any components that project is using...". Actually you can compile the project without installing but can not edit forms. If the form is complaining just press cancel – Maksee Oct 16 '12 at 20:22
  • @Maksee Yes, you can compile project without installing components, we are successfully using Jenkins for such thing. But it would be great that you could also open these project in the IDE and have ability to edit forms, data modules, etc. Also, these complaining dialogs are very annoying. – Linas Oct 16 '12 at 20:29
  • @Maksee: I did say that: "..., unless the project directly includes the components source code and instantiates the components in code" – Remy Lebeau Oct 16 '12 at 22:07
  • @Remy_Lebeau: the project may not instantiate components in the code and still be compilable and working. – Maksee Oct 17 '12 at 04:51
2

It's very wise to constraint which components and libraries that will be used by your team. If each member decide which component they will use, your final executable or packages will grow a lot and you can have some incompatibilities between libraries.

Besides, you can have extra costs buying and updating libraries that are very similar. Remember that each time Delphi is updated, you should buy new licences from most of that libraries.

So the best approach is:

  • ask which libraries each developer are using and discuss with them the real need of each one;

  • catalog those library required and install them on the machine that you will compile your final code;

Josir
  • 318
  • 1
  • 3
  • 8
  • 2
    I agree that your approach should work...BUT it is very inconvenient IMO. What if developer made custom component for only one project? Why do all the other developers need to install it? Also in this way I would have to maintain all these installed components to be sure that they all are up to date. If IDE supported installing components per projects then all these issues could be avoided. – Linas Oct 16 '12 at 20:20