Jump to content
sfrazor

Delphi gitlab question

Recommended Posts

I've done some searching and see very minimal information about running Delphi in a CI/CD pipeline on gitlab. I wish it was CMAKE driven but MSBUILD is OK I suppose,

 

I have a successful CI/CD pipeline running with MSBuild.  Finally.

 

My question is specific to gitlab and what files need to be committed to the repo for proper collaboration. In my environment all changes are peer reviewed and accepted for merge.  However, the commit changes are littered with .dproj, .local, .grpproj and cache XML files.  Obviously the .cache files can be added to the .gitignore.

 

What exactly is required to commit to gitlab for proper collaboration?  

 

The catch is, if I make changes to my local environment, it gets pushed which is not needed   If I add a project to the group It gets pushed via the grpproj file, which is needed so the next person checking out the project has the new project in the group,  The .grpproj seems to get pushed every time by the fact that its touched.  Maybe I'm wrong.

 

All of t his seems very messy.  Is there a proper way to accomplish all of this in git that will eliminate all of the change cruft from being pushed?

 

Share this post


Link to post

Try this for a starting .gitignore - https://github.com/github/gitignore/blob/main/Delphi.gitignore

 

The .dproj files are XML files which on project Save, Delphi sometimes "reorders" some of its XML nodes (probably a dictionary is used somewhere instead of lists).
So you could get a modified .dproj file if you've just added a new line in the .dpr and pressed Save.

In order to avoid that try to use Project Magician plugin for the IDE

 

https://www.uweraabe.de/Blog/2018/05/17/keep-your-project-files-clean-with-project-magician/

Share this post


Link to post
2 hours ago, dwrbudr said:

Try this for a starting .gitignore - https://github.com/github/gitignore/blob/main/Delphi.gitignore

 

The .dproj files are XML files which on project Save, Delphi sometimes "reorders" some of its XML nodes (probably a dictionary is used somewhere instead of lists).
So you could get a modified .dproj file if you've just added a new line in the .dpr and pressed Save.

In order to avoid that try to use Project Magician plugin for the IDE

 

https://www.uweraabe.de/Blog/2018/05/17/keep-your-project-files-clean-with-project-magician/

I made mods to my .gitignore based on your example.  Thanks!  I'll see how that does.

 

Also pulled down the projectmagician to give that a try....  

Edited by sfrazor

Share this post


Link to post

And most important: Only commit what you actuallly changed. Revert all the rest. Only made a change to the .pas? Revert that changes to the dfm. Those are either selected tabs, attributes that got added with newer versions, or those imagelist headers that change by themselves. Or worse: you missclicked and moved a control. (Or Delphi decided to f*** with the DPI). Same for the project files.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×