Closed jerrymarino closed 4 years ago
I'm going to land what's here as a first pass, I think we can issue some followups to keep scope down ( and I'm running up against deadlines ) So far I've tested it with a handful of permutations of Swift sources:
ObjcLibrary
shim like PromisesI'm planning to run this against a broader set of Pods.
This PR adds mixed module swift support with the constraints that Xcode and the PodSpec supports. An objc library may depend on a swiftmodule and the swift module implicitly imports the public objc module. Currently, all sources are propagated to a single
swift_library
to produce a singleswiftc
invocation. The swift interface header is included in a public module map, while the public headers are exposed to theswiftc
invocation through a private module mapAdditionally, it cleans up the rule for module map to be simpler and more easily used in this context. The
BazelTarget
for this rule additionally passes named arguments to improve readability.Note: because we reduce sources into a single swift library, it must consider subspecs that are included, otherwise, it would pull in sources from the entire podspec. Currently it uses
Default
subspecs. As a followup, we need to add an option tonew_pod_repository
to select subspecs. Additionally, I'll follow up to fix the ad-hoc targets inObjcLibrary
It also adds FBSDK as a build test.