Avoiding redundant rebuild of dependencies when compiling a hierarchy of Swift Packages

We have a set of Swift Packages with dependencies from one to another, and we need to build xcframeworks out of those. We currently iterate over each package and xcodebuild archives out of them, but this is really slow. It also seems that the dependencies are rebuilt for every package, and we're looking for a way to avoid that.

More precisely, say we have the following packages

  • CoreFoundation
  • Feature1, depending on CoreFoundation

We need to turn this into corefoundation.xcframework and feature1.xcframework. The problem is that when calling xcodebuild on Feature1, it seems to be rebuilding CoreFoundation even though it's already been built when building corefoundation.xcframework.

Anyone knows of a better way to do that ? Lumping it all together in a single xcframework doesn't seem to be possible.

Thanks for any input :)

Avoiding redundant rebuild of dependencies when compiling a hierarchy of Swift Packages
 
 
Q