Proper includes into Package.swift

Ok, I have a bit of special problem. I want to use the "Swift Upcoming Feature Flags" in my packages.

The problem is that we have quite a lot of Packages in a quite deep tree:

at the root of the Package directory there are four dirs:

  • AppA/
  • AppB/
  • Shared/
  • Temporary/

also the packages ExternalLibs and BuildPlugins. Temporary contains Packages that need rework and the other three subdirs each contain the subdirs:

  • Features/
  • Utilities/
  • Services/

All in all there are over 100 packages.

Now I would like to use definitions like https://github.com/treastrain/swift-upcomingfeatureflags-cheatsheet to use in the Package.swift files. And as you might guess, I do not want to copy those into each and every Package.swift file.

It seems like SPM is only finding includes by itself if they are in the exact same directory as the Package.swift file 🙄 That's not at all helpful…

Has anyone found a way to do useful includes into Package.swift files? Any help appreciated.

Thank You Roddi

Proper includes into Package.swift
 
 
Q