Difficulty Sharing Code Between Swift Package Manager Plugins

Interesting. It sounds, then, that the expected approach might be to declare two .plugin targets which dispatch to a central .executableTarget which itself contains the shared code? (Feels unintuitive! Wish this were documented somewhere.)

I'll try to see if I can get this to work. The plugins right now do little but process a bit of info from the PluginContext, looking up a tool from another binaryTarget that I expect to use, and just dispatching off to that. I'd need to pass a lot of context to the executable target, and I hope I can run the external tool from in there. (And hopefully I'll be able to execute the tool from in there, given that plugins are sandboxed.)


[If this is indeed the expected approach, it feels very limiting — I have all of the context I need from within the plugin, and having to pass all of that in a digestible way to another tool just for the benefit of sharing a source file feels like overkill.]