No Objective C support in SwiftPM
- [ ] I have read CONTRIBUTING and have done my best to follow them.
What did you do?
Added Nimble to Obj-C project with SPM. Added @import Nimble;
What did you expect to happen?
Nimble function to be visible from Obj-C
What actually happened instead?
It seems that no files from NimbleObjectiveC folder are actually included to SwiftPM, so there is nothing visible from Obj-C:
Implicit declaration of function 'expect' is invalid in C99
Implicit declaration of function 'equal' is invalid in C99
Environment
List the software versions you're using:
- Nimble: 10.0.0
- Xcode Version: 13.4.1 (13F100) (Open Xcode; In menubar: Xcode > About Xcode)
- Swift Version: Xcode Default (Open Xcode Preferences; Components > Toolchains. If none, use
Xcode Default.)
Please also mention which package manager you used and its version. Delete the other package managers in this list:
- Swift Package Manager 5.6.0 (swiftpm-???) (Use
swift build --versionin Terminal)
Hey @GLinnik21! Thanks for the issue! We'll take care of this and make sure we support Objective-C on the Swift Packages release in the next version of Nimble.
For now, Carthage and Cocoapods both support Objective-C, but I understand that it's a little extra work to get those working with xcode.
I also just ran into this issue. Would love to see objc support when used via SPM.
I spent some time spiking this out today. Part of the issue is that Swift PM doesn't support mixed-source targets (can't mix swift and objective-c). So we'd have to ship a separate framework for the objective-c support. ~~I might bump this to the next version of Nimble.~~
Found some time this evening to set this up. I would deeply appreciate feedback on it to double check this meets your needs!
Bumping this to the next release in favor of getting async/await support out the door sooner.