Xcode Project targets as containers for Swift Macros (and Plugins)

Hey there,

Big props for introducing the compile-time extensibility via macros, it really broadens the horizon for us devs.

I noticed something though - looks like Swift Packages got the exclusive pass to bring in macros during the build time. I'm guessing this might have something to do with their portability game compared to the usual targets in .pbxproj projects.

That's a bummer for tools like Tuist, which I happen to take care of. See, Tuist works hand-in-hand with Xcode projects and does some pretty neat stuff, like building focused Xcode projects that only pack what you need for the task and swapping out dependencies with their binary versions.

Any thoughts on tweaking the .pbxproj schema to play nice with targets that have plugins or macros? Or is the vibe more about moving away from .pbxproj and getting cozier with Swift Package Manager's system?

It'd be cool to get your take on this. It would help plan what's next for Tuist. I bet the CocoaPods folks might also want to know what's up, especially if they decide to get onboard with Swift Plugins and Macros from Pods.

Thanks a bunch!



Not sure if this answers your question, but there is this other post with guidance on how to integrate (compiled) macros in CocoaPods: How to import macros using methods other than SwiftPM

1 Like

It does @erudel. Thanks a lot for sharing the resource :pray: