Jump to content
Bill Meyer

Pulling info from DPROJ files

Recommended Posts

I wonder whether there is any open source collection of tools for getting data from DPROJ files. In my limited inspection, I see large differences across versions. Not having all versions in place anywhere, I would prefer not to have to try to research the range of variations.

Share this post


Link to post
2 hours ago, Fr0sT.Brutal said:

AFAIK they're in MSBuild format so you should rather search for this subject

They are, but the info is quite RAD Studio specific.

Share this post


Link to post

I doubt there is any general tool for getting data but you likely can find scattered pieces of info here and there. I remember some of the guys here managed to plug the settings of his expert into the project file, probably it was Vincent.

There's also https://github.com/DelphiCodeCoverage/DelphiCodeCoverage in which I participated a bit and it has some code for getting Dproj info in /Source/CoverageConfiguration.pas

Edited by Fr0sT.Brutal

Share this post


Link to post
15 hours ago, Bill Meyer said:

I wonder whether there is any open source collection of tools for getting data from DPROJ files.

AFAIK, there is none.

 

If you can be a bit more specific about what you actually are after, I may be able to give some help.

Share this post


Link to post
3 hours ago, Uwe Raabe said:

AFAIK, there is none.

 

If you can be a bit more specific about what you actually are after, I may be able to give some help.

Unfortunate. In the short term, I want only a little. The location of the map file and exe. But going forward, I expect there will be other things, like the defines and the Search Path. Certainly I can find them with simple text searches, but it seemed logical to look for some open source where someone else may already have documented at least parts of it. I know people, for example, who are still maintaining projects in D7, so I am not keen to ignore the older variations.

Edited by Bill Meyer

Share this post


Link to post

D7 doesn't use dproj files. AFAIK, they were introduced with D2007.

Share this post


Link to post
5 hours ago, Bill Meyer said:

The location of the map file and exe. But going forward, I expect there will be other things, like the defines and the Search Path.

Welcome to all sorts of fun. Delphi uses config inheritance, so settings can be anywhere in the tree - so you need to work your way up the tree. Start by parsing the BuildConfiguration elements - use the Key and CfgParent values to build the tree. The difficulty comes when no settings exist at a node in the tree.. then nothing is in the dproj for that config, and you end up having to fill in the blanks to work out the correct parent etc. I don't have any code I can share, but can tell you if you don't work out the config tree first you will really struggle to get anything out of the dproj. 

Share this post


Link to post
On 3/5/2022 at 4:20 PM, Vincent Parrett said:

Welcome to all sorts of fun. Delphi uses config inheritance, so settings can be anywhere in the tree - so you need to work your way up the tree. Start by parsing the BuildConfiguration elements - use the Key and CfgParent values to build the tree. The difficulty comes when no settings exist at a node in the tree.. then nothing is in the dproj for that config, and you end up having to fill in the blanks to work out the correct parent etc. I don't have any code I can share, but can tell you if you don't work out the config tree first you will really struggle to get anything out of the dproj. 

Sigh. And puzzling out the dproj isn't my goal, it's merely something on the path.

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
×