vapor / websocket-kit

WebSocket client library built on SwiftNIO
https://docs.vapor.codes/4.0/advanced/websockets/
MIT License
272 stars 79 forks source link

CocoaPods Support? #129

Closed kennyevo closed 1 year ago

kennyevo commented 1 year ago

Hi!

I'd like to use this library outside of vapor for an iOS project, it is working fine with SPM, but we are using cocoapods for dependency management. Is there any plan to add a podspec?

I tried to create on and add to our private repo, the spec validates fine but when imported to the project it fails to build with the Include of non-modular header inside framework module error.

Here's the spec file I tried to use:

Pod::Spec.new do |spec|
  spec.name          = 'WebSocketKit'
  spec.version       = '2.6.1'
  spec.license       = { :type => 'MIT' }
  spec.homepage      = 'https://github.com/vapor/websocket-kit'
  spec.authors       = 'Qutheory, LLC'
  spec.summary       = 'Vapor WebSocketKit'
  spec.source        = { :git => 'https://github.com/vapor/websocket-kit.git', :tag => '2.6.1' }
  spec.swift_version = '5.0'

  spec.ios.deployment_target  = '13.0'

  spec.source_files       = 'Sources/**/*.swift'

  spec.dependency 'SwiftNIO'
  spec.dependency 'SwiftNIOCore'
  spec.dependency 'SwiftNIOConcurrencyHelpers'
  spec.dependency 'SwiftNIOFoundationCompat'
  spec.dependency 'SwiftNIOHTTP1'
  spec.dependency 'SwiftNIOWebSocket'
  spec.dependency 'SwiftNIOSSL'
  spec.dependency 'SwiftNIOTransportServices'
  spec.dependency 'SwiftAtomics'

  spec.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'OTHER_SWIFT_FLAGS' => '-Xcc -Wno-error=non-modular-include-in-framework-module' }
end
0xTim commented 1 year ago

@kennyevo Hi, thanks for the issue. Unfortunately we have no plans to add support for Cocoapods. Even if we did it's never going to happen as SwiftNIO (one of our dependencies) no longer supports Cocoapods. So if you want to use it you'll need to fork the repo and all of the dependencies and then add pod specs for them all. (There are old versions of NIO in Cocoapods but there's no guarantee that we're not using a dependency that's newer that the version available).

You can run SwiftPM and Cocoapods side-by-side as longs as you don't have cross package manager dependencies, so I recommend you try that.

kennyevo commented 1 year ago

Thank you for the heads-up. This is just sad, I doubt that my team will accept to use SPM and Cocoapods together :/