简体   繁体   English

git中的Delphi DCU文件?

[英]Delphi DCU files in git?

Note: I have no experience in Delphi programming. 注意:我没有Delphi编程经验。

My problem: 我的问题:

-I would like to put an old Delphi project of a collegue into a git repo. -我想将一个同事的一个古老的Delphi项目放入git repo。

-I read that DCU files are compiler generated and even found a .gitignore template actually ignoring these files. -我读到DCU文件是编译器生成的 ,甚至发现实际上忽略了这些文件的.gitignore模板。

-After putting everything together and cloning the repo, the Delphi compiler complains about missing DCU files in the fresh clone. -将所有内容放在一起并克隆存储库后,Delphi编译器会抱怨新克隆中缺少DCU文件。

-When I add the DCU files to git, everything compiles fine. -当我将DCU文件添加到git时,一切正常。

-The DCU files (at least most of them) get modified during the build process. -DCU文件(至少大多数文件)在构建过程中被修改。

-Obviously, the DCU files mess up the git history and make diff's hard to read, but a project that doesn't compile is unacceptable. -显然,DCU文件弄乱了git历史记录,使diff难以阅读,但无法编译的项目是不可接受的。

What is going wrong here? 这是怎么了? Are there errors in the code when the DCU files are required for compiling? 需要DCU文件进行编译时,代码中是否存在错误? Is it correct that the compiler is asking for the files during build process? 编译器在构建过程中要求文件是否正确? Any help is highly appreciated. 非常感谢您的帮助。

Delphi programs are made by linking the DCU's you need together. 通过将所需的DCU链接在一起来制作Delphi程序。 The pas-files will be compiled to dcu files. pas文件将被编译为dcu文件。

If for a program you don't have all the pas-files but you do have the DCU files then it can still compile. 如果对于一个程序您没有所有的pas文件,但您确实有DCU文件,那么它仍然可以编译。

So I would try the following: try compiling your project by removing all the modified DCU files. 因此,我将尝试以下操作:尝试通过删除所有已修改的DCU文件来编译项目。

This way you can find out which DCU-files you have source code for and which you don't. 这样,您可以找出哪些DCU文件具有源代码,哪些没有。

The issue was indeed that 3rd party libraries were inside the actual source like mentioned by Turrican and Rudy Velthuis. 问题的确是,如Turrican和Rudy Velthuis提到的那样,第三方库位于实际资源中。 Compiling the project showed us which dcu files came from 3rd party and afterwards we had to decide for each dependency what to do with it (we got rid of some, some had to stay, because there was no way to get the source sadly). 编译该项目后,向我们显示了哪些dcu文件来自第三方,之后我们必须为每个依赖项决定如何处理它(我们摆脱了一些依赖,有些不得不保留,因为没有办法悲伤地获取源代码)。 The comments by Rudy Velthuis helped a lot here. Rudy Velthuis的评论在这里很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM