bloomberg / xcdiff

A tool which helps you diff xcodeproj files.
Apache License 2.0
928 stars 45 forks source link

Allow to parse a single project - no comparison #70

Open remover opened 4 years ago

remover commented 4 years ago

Is your feature request related to a problem? Please describe.

I often want to quickly find out "what are the dependencies of this project" or "what are the build settings of this project". However, opening Xcode and navigating the UI can be slow and cumbersome. xcdiff might provide a quick way to get at this info.

Describe the solution you'd like

It might be nice if you could invoke xcdiff to just parse and print these values without any comparison against another project

marciniwanicki commented 4 years ago

Thanks @remover for raising it. I like the idea, it might be quite a common use-case. Wonder if there is already a tool doing what you suggested - I honestly don't know.

Adding the functionality to xcdiff is not impossible :), but also not as easy as I'd hope. The design is heavily diff-oriented and all kinds of data providers for the comparators are private detail and not very formalised. Similarly, the rendering of the results is focused on the comparison.

Comparing a valid project with an empty project wouldn't do the trick as we expect both projects to have common targets and configurations, otherwise some of the comparators will be skipped (won't produce any output). Some hacking to match the targets and configurations can work, but the final output might be unpleasant to read.

One (a little heavy) solution that I think of is introducing another layer called "data providers" in XCDiffCore module, which can be used by the comparators as well as the summary/insights (not sure about the name) functionality. It would require some refactoring, but once it's done, getting the details of a single project should be much easier.

@remover did you think about some possible ways of implementing it? Is it something you'd like to contribute to? Happy to help with the implementation.

remover commented 4 years ago

@marciniwanicki that's a shame. i haven't looked into the implementation at all so can't bring any ideas there i'm afraid. i like the idea of trying to implement it but finding the time to do so is another thing :)