-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build target for dynamic framework to support #281
Comments
Hi @mowens Our build server publishes some artifacts up to www.typhoonframework.org for each successful build, so we'd be able to include this as part of that. If you'd like to do the build target? I'll do the build server part and put a link on GitHub and www.typhoonframework.org |
For the time being, Apple has recommended not linking against pre-built binaries using the swift compiler as it is still young. So I believe the "ideal" integration would be a git submodule and link directly against the build artifact from the Typhoon xcodeproject. I will start looking into/working on the dynamic framework build target. |
Thanks @mowens, that is excellent. Have you seen this issue: #286 ? Its second highest priority, but neither @alexgarbarev or I have been able to look at it yet. |
@jasperblues PR: #290 |
Ready to close? |
@mowens how about using Carthage package manager for Swift? |
@jasperblues sorry it took so long to get back to you. I have taken a look at Carthage and I like the concept as it doesn't mock with project settings like Cocoapods does but the project is still pretty young. Currently, I couldn't get Carthage to build Typhoon out-of-the-box. I didn't look too much into the failure case, but seems to be schema related. A downfall of Carthage is it is (more or less) a wrapper around git and xcodebuild, which means developing local pods would be a pain in the ass (not that it is much better with Cocoapods but it is better). A beta has been released for Swift and framework support for Cocoapods which I am currently looking into. It doesn't build Typhoon as a framework out-of-the-box either, but with a few teaks i'm sure it can! IMO pods would support should take precedence to Carthage. Thoughts? |
@jasperblues Typhoon does work with Cocoapods 0.3.6 beta out of the box! For swift libraries/apps that need to link against Typhoon they must specify in their pod file that it uses frameworks # platform *must* be atleast 8.0
platform :ios, '8.0'
# flag makes all dependencies build as frameworks
use_frameworks!
# framework dependencies
pod 'Typhoon', '2.3.3' |
great work@mowens. lets stick with cocoa pods for now. We may need to support carthage when it becomes popular |
Agreed |
Hey guys, we're currently using carthage and we would like to include Typhoon in it. Is it a good time to reconsider adding support for Carthage ? According to the Carthage docs, it should just be a matter of marking your schemes as shared. |
All schemes were shared except for the Typhoon Framework scheme. . . i shared it and pushed to master. Next step? |
Hmm, I'm not seeing the push to master. I just tested it locally, and marking the Typhoon framework scheme as shared was sufficient to allow Typhoon to be compatible with Carthage. So once that commit is available in master, it doesn't look like any other changes need to be made, fortunately. |
Oops. . . sorry! I did that early this morning in between a bunch of other tasks and didn't pay attention to console output. Its pushed now. |
Awesome, thanks for the quick response! One other thing I just realized is that Carthage tries to grab the latest version of a dependency based on tags, so if you include Typhoon using Thanks again! |
OK, just pushed 3.0.3 tag, and also to CocoaPods mater repo. |
Oh, one more thing to note: While pushing the podspec just now, linting failed as there was a function declared as public in |
Cool -- I believe Carthage will just pull down whatever the tag is currently pointing to when retrieving dependencies, so it should be okay. Thanks! |
@jarod2d Did it all work? I'm just adding the 'Carthage compatible" badge in the readme. |
Yup -- Typhoon has been working great with Carthage. |
With the introduction of swift, and cocoapods lack of swift support, it would be nice (and likely needed once cocoapods does support swift - e.g dynamic frameworks) to support building typhoon as a dynamic framework. This is necessary for supported typhoon DI in swift libraries that themselves build dynamic frameworks and link into the main app project.
For example, say I have the following swift projects that build dynamic frameworks:
XXFoo-> XXFoo.framework
XXBar -> XXBar.framework
These libraries are then linked into my main app project, XXMyApp. In order for XXMyApp to leverage Typhoon DI, cocoapods can be used to create a libPods.a static library with the Typhoon source and a bridging header (
XXMyApp-Bridging-header.h
) can be created and#import "Tyhoon.h"
. Now this is al well and good if all of my Typhoon assemblies exist in XXMyApp, however, if I truly want to leverage the power of DI in XXFoo and XXBar I should be able to define myTyphoonAssembly
factories in each library and import them for use in XXMyApp. This way each library would be responsible for setting up its own dependencies.This is currently not possible with the pods approach as you cannot link a static library (e.g. libPods.a) into a dynamic swift framework. You can however link to dynamic frameworks, so if Typhoon was able to build a dynamic framework (e.g. Typhoon.framework) then XXFoo, XXBar and XXMyApp could link against it; XXFoo and XXBar could define their own assemblies and XXMyApp would be able to instantiate them.
Because dynamic frameworks are not yet supported by cocoapods, the approach that several swift-only libraries are taking are git modules, so swift libraries want to dynamic link against Typhoon could:
The text was updated successfully, but these errors were encountered: