Skip to content
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

Dynamic Library for iOS Carthage Support #168

Merged
merged 1 commit into from Nov 20, 2015
Merged

Dynamic Library for iOS Carthage Support #168

merged 1 commit into from Nov 20, 2015

Conversation

lucasderraugh
Copy link
Contributor

Trying to address issue #152, this build I believe will support Carthage. The issue is that Bolts is currently a static library, whereas Carthage only supports dynamic libraries (hence why the Mac build works). I know there can be backwards compatibility issues so I've added a new target that builds dynamically. I'd really like this to get moved into production so that Facebook could support Carthage out of the box. Let me know if anything needs to be changed.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@nlutsenko
Copy link
Member

Thanks for following up with this.
Let's address these few things, before we can merge it in:

  • Our flow is to handle all target configurations in .xcconfig files (as you've seen) - can we extract all dynamic target specific things into a new .xcconfig file?
  • Let's split changes around warnings and adding new target into 2 separate pull requests (I will send the warnings one in a bit), as they are not really relevant
  • I guess the bundle id for the new target should remain the same as for static framework, since those are the same, just different way of packaging it (I don't feel strong about this, just a suggestion).

Let me know how I can help you with this.

@nlutsenko
Copy link
Member

@lucasderraugh, just opened #170 to fix all of these warnings and few more, no need to fix them here.

@lucasderraugh
Copy link
Contributor Author

@nlutsenko I think I've properly setup the config file for the dynamic library. I simply duplicated the existing iOS config and changed the MACH_O_TYPE to mh_dylib. What would you like me to do with the commit for warnings?

@lucasderraugh
Copy link
Contributor Author

I've rebased with the changes @nlutsenko made to warnings and removed my commit for that. I've also squashed my commits into a single commit. Let me know if that's all that needs to be done to see this off.

@jsubida
Copy link

jsubida commented Oct 23, 2015

Any update regarding this?

@nlutsenko
Copy link
Member

Looking now.

isa = XCBuildConfiguration;
baseConfigurationReference = 1D88DFF31BD18B5600329FCD /* Bolts-iOS-Static.xcconfig */;
buildSettings = {
INFOPLIST_FILE = "$(SRCROOT)/Bolts/Resources/iOS-Info.plist";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please kill :)
The whole point of having a xcconfig file is to avoid these.

@nlutsenko
Copy link
Member

Few more things here and there, overall looks great. Almost ready to ship.

@jsubida
Copy link

jsubida commented Oct 23, 2015

Awesome thanks!

@lucasderraugh
Copy link
Contributor Author

Hopefully I deleted the right sections for this, let me know if there is anything else.

@nlutsenko
Copy link
Member

@lucasderraugh, looks great. Checked out things locally and here is the list of what we need to address before merging this. Let me know if there is anything I can help you with on any of these.

  • Rename Bolts-iOS-Static to Bolts-iOS-Dynamic, since changing the default one to be dynamic will break people who depend on the packages that we distribute.
  • Change mach-o type back to staticlib for the Bolts-iOS target
  • Add IPHONE_OS_DEPLOYMENT_TARGET to Bolts-iOS-Dynamic and put 8.0 there, since dynamic frameworks are supported only starting from iOS 8.0.
  • Update project configuration and make Bolts-iOS-Dynamic target actually use the configuration file (it doesn't now)
  • Reorder targets in xcodeproj and .xcconfig files in Configurations group in the project so both Bolts-iOS-* targets go one after each other
  • ???
  • PROFIT!

@lucasderraugh
Copy link
Contributor Author

Sorry for the commit amends, wasn't sure if you strive for nice git history or not (from the looks of it you do). Regardless, I believe all these changes have been made (including a rebase).

@lucasderraugh
Copy link
Contributor Author

Ok, so in the Bolts-iOS-Dynamic config file, I added the CoreGraphics and UIKit framework for linker params. This for whatever reason is breaking the OS X tests. Not sure how to fix this by using the config files exclusively.

@@ -11,7 +11,6 @@
#include "Shared/Product/Framework.xcconfig"

PRODUCT_NAME = Bolts
IPHONEOS_DEPLOYMENT_TARGET = 6.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was unintended change, please revert it.

@nlutsenko
Copy link
Member

@lucasderraugh

ammends

It's ok to keep separate commits until we are fully done, then we can squash everything together.
Might be easier to track progress this way, but absolutely up to you.

frameworks and OS X tests breakage

Not sure why it got broken. Try rebasing it against the current latest master.
Also, I've noticed that for some reason the xcodeproj changes included renaming of the existing Bolts-iOS target.
If nothing helps at this point - my suggestion is to try to reset all the changes for the Xcode project and recreate the target from scratch (by duplicating the existing one + renaming + changing the xcconfig file attached to this).

Takes a while to get through all of these, but I am confident we are going to make it together!

@lucasderraugh
Copy link
Contributor Author

Ok, I just completely reset off of what you have on master and redid what I originally set out to do. Not sure how the OS X tests were failing previously, but the same config files seem to not interfere with it this time around 👍 .

@lucasderraugh
Copy link
Contributor Author

Could this get merged in?

@nlutsenko
Copy link
Member

Doing last sanity check right now and merging in...

@nlutsenko
Copy link
Member

@lucasderraugh Found a small nit issue - Bolts-iOS-Dynamic.xcconfig file was by mistake added to BoltsTests-iOS target as resource. Please remove it (simply uncheckmark the target in the Utilities pane) and i'll merge it in straight away.

@lucasderraugh
Copy link
Contributor Author

@nlutsenko Should be good from here.

@facebook-github-bot
Copy link
Contributor

@lucasderraugh updated the pull request.

@nlutsenko
Copy link
Member

Perfect! One last thing - could you squash both commits into just 1?

@lucasderraugh
Copy link
Contributor Author

Done (I used fixup instead)

@nlutsenko
Copy link
Member

Thanks for bearing with me through the whole review. So glad it is finally done!

nlutsenko added a commit that referenced this pull request Nov 20, 2015
Dynamic Library for iOS Carthage Support
@nlutsenko nlutsenko merged commit d4a82c6 into BoltsFramework:master Nov 20, 2015
@nlutsenko nlutsenko added this to the 1.5.1 milestone Nov 20, 2015
@nlutsenko nlutsenko self-assigned this Nov 20, 2015
@facebook-github-bot
Copy link
Contributor

@lucasderraugh updated the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants