MobileNativeFoundation / swift-index-store

Library to read from Swift / clang source code indexes
Apache License 2.0
137 stars 12 forks source link

Idea: A tool to generate "Report of connectivity level between modules" #53

Open DmT021 opened 1 year ago

DmT021 commented 1 year ago

There was a pitch recently on the swift forum about introduction new visibility levels on imports (ex @_implementationOnly imports). internal and lower levels of imports are useful to reduce number of modules to be rebuild in incremental builds. But there is no way suggested in the proposal to automate or assist with import visibility lowering. However it was suggested that the swift index store could be used to get the information about dependencies between entities in different modules. So with the index store it's possible to build a report of connectivity level between modules, which in turn will be a valuable tool to plan work for specifying import visibilities.

keith commented 1 year ago

Here's an example of that idea https://github.com/lyft/swift-index-store/pull/43 although it would require some tweaking to be production ready.

keith commented 1 year ago

I think one thing we've discovered with this tool is it seems sufficiently difficult to ever be 100% correct, but for this case maybe that's ok