Including Delphi Type Libraries in repository (SVN

2019-07-19 23:13发布

问题:

What is the best way to save a Delphi Type Library in SVN.

The file changes every time you compile the Application

The file is not saved in a readable form of AscII

It is very difficult to work out what changes have been made from one version to the next

This is a major problem when more than one person is changing the file

QUESTIONS:

1) Should one save an exported ‘IDL’ file in the version control ?

2) Can one covert an ‘IDL ’ into a Delphi type library If so how ?

3) What are the best practices when working with a Delphi type library ?

4) How easy is it get rid of the type library in Delphi2009 datasnap project?

p.s. I am using BDS2006

回答1:

Prior to Delphi 2009, I would not check in the TLB file but manually put the TLB (and *_TLB.PAS file for reference) into a zip file then force that into version control. When ever I made actual changes to the TLB, I would update the zip file and check it in. The local TLB was always made read/write and ignored by the version control system. This scheme saved me several times when the TLB file would mysteriously no longer compile, I could just close my project, unzip from the zip file, reload the project and continue working.



回答2:

In Delphi 2009, this has changed completely. Type libraries are now saved in the project as plain text, RIDL files. These will play nice with source control. DataSnap is also completely changed; you can read about it here, and see a screencast here.



回答3:

There are some good answers to this question at Delphi and COM: TLB and maintenance issues.