Delphi RES files and Git

前端 未结 6 1548
无人及你
无人及你 2021-02-04 00:19

I have a big project written in Delphi and I want to manage its sources using Git. I created Git repository, which includes my application\'s sources and 3rd party components. A

6条回答
  •  無奈伤痛
    2021-02-04 00:36

    Welcome to the club. The application .res file in Delphi is a pain in the lower back for everybody using source control. You want to use auto-inc-buildnumber but it messes up your scource control. What I have done is

    • split the icon and the version resources like this:

      {$R *_icon.res}

      {$R *._version.res}

    • disable auto inc of the buildnumber

    • add a pre-build event to the project that

      • increments the build number in a .ini file corresponding the project
      • generates a .rc file with the version info from the .ini file
      • compiles a .res file from the .rc file
    • add the *_icon.res file to source control, it never changes so this is safe

    • add the .ini file with the version info to source control, it is a text file so it is easy to diff

    The tool I have written for generating the version .res file is free software, available here and also from OSDN

提交回复
热议问题