Open eunikolsky opened 9 years ago
0 Carthage requires a shared dynamic framework scheme in the project (created here: https://github.com/eunikolsky/Connect-SDK-iOS/tree/feature/carthage_support).
1 The built dynamic framework should be embedded into the app in project's target settings => General => Embedded Binaries section.
Issues so far:
0 Build warnings like:
/Users/q/proj/csdk-sampler-carthage/ConnectSDKSampler/ControlFlow/SamplerViewController.m:18:2: warning: missing submodule 'ConnectSDK.AirPlayService' [-Wincomplete-umbrella]
#import <ConnectSDK/AirPlayService.h>
^ ~
In file included from /Users/q/proj/csdk-sampler-carthage/ConnectSDKSampler/ControlFlow/SamplerViewController.m:18:
/Users/q/proj/csdk-sampler-carthage/Carthage/Build/iOS/ConnectSDK.framework/Headers/AirPlayService.h:25:2: warning: missing submodule 'ConnectSDK.AirPlayServiceHTTP' [-Wincomplete-umbrella]
#import "AirPlayServiceHTTP.h"
^ ~~~~~~~~~~~~~~~~~~~~~~
and
<module-includes>:1:1: warning: umbrella header for module 'ConnectSDK' does not include header 'AirPlayService.h' [-Wincomplete-umbrella]
#import "/Users/q/proj/csdk-sampler-carthage/Carthage/Build/iOS/ConnectSDK.framework/Headers/ConnectSDK.h"
^
<module-includes>:1:1: warning: umbrella header for module 'ConnectSDK' does not include header 'AirPlayServiceHTTP.h' [-Wincomplete-umbrella]
<module-includes>:1:1: warning: umbrella header for module 'ConnectSDK' does not include header 'AirPlayServiceHTTPKeepAlive.h' [-Wincomplete-umbrella]
1 Cast and FireTV devices are not discovered (after manually linking them with the app (there was no warning that they were required (which is another issue))).
Re 1: I forgot to include those classes in the framework — fixed now. However, the user should now build the framework differently:
carthage update
rsync frameworks
carthage build
You still don't get linker errors if you don't link those frameworks with the app — the app crashes at runtime. I suppose, we could link them weakly, that would require extra checks.
I've made a few project changes and fixed all compiler warnings. The framework now can be used in a swift project as a module.
I included all public headers in the umbrella header, and made a few others private:
CastServiceChannel
because it has to import GoogleCast/GCKCastChannel.h
;FireTVMediaControl
because it has to import AmazonFling/MediaPlayerStatus.h
;ASIHTTPRequest
classes because one of them requires zlib.h
, and it's an outdated library anyway.So the important question is to figure out what headers should really be public and hide everything else.
Here's a new dependency manager for Cocoa: https://github.com/Carthage/Carthage, which is not a replacement for CocoaPods. We should check if ConnectSDK is built fine and can be used from Carthage. And publish a config file for the project if necessary.