provide a cocoapods spec for sdk so that it can be used via cocoapods #90

Closed
superfell opened this Issue Jul 10, 2012 · 32 comments

Projects

None yet
@superfell

Cocoapods is a dependency manager for iOS & OSX projects see http://cocoapods.org/ for more details.

It would be useful if I could add the SDK to my project via cocoapods.

@superfell

You need to write a cocoapods spec file, and add it to the specs repo, pretty straight forward, i did it for zkSforce, it works great.

@khawkins
Contributor

That looks pretty cool. I'll take a look.

@akaromka
akaromka commented Jun 2, 2013

Do you have any news about Cocoapods request?

@khawkins
Contributor
khawkins commented Jun 4, 2013

We've reorganized our dependencies for our upcoming 2.0 release, so I hope to be able to add Cocoapods support soon.

@khawkins khawkins referenced this issue in forcedotcom/SalesforceMobileSDK-iOS-Distribution Nov 4, 2013
Closed

Cocoapods support #17

@edelabar

Any update on this? We're about to go down a path to create private pod specs for the binaries, but if this is going to be done any time soon we may wait it out.

@khawkins
Contributor
khawkins commented Dec 2, 2013

We're likely going to take on this work as part of our next release. So hopefully we'll get something started in the near future.

@paweldudek
Contributor

Are there any updates on this? We'd love to use Salesforce as a dependency managed by Cocoapods. If you guys need any help with setting cocoapods up I could quickly get a podspec up and running.

@ghost
ghost commented Jan 22, 2014

We would like to be able to use this SDK as a pod too.

@paweldudek please let us know if you build the podspec, because we would be interested on using it. Thanks!

@paweldudek
Contributor

@veducm I've managed to get whole SDK up and running on cocoapods, but with a few caveats so don't get your hopes up yet.

First, due to a bit tangled dependency tree I had to separate code into five repositories:

  • The SalesforceCommonUtils repository
  • Networking (which uses a custom definition of MKNetworking pod spec since SFDC uses a custom fork and depends on SalesforceCommonUtils)
  • OAuth (which depends on Networking and SalesforceCommonUtils)
  • Core (which depends on SalesforceCommonUtils)
  • Native SDK (which finally depends on OAuth and Core)

The second caveat is that I had to use custom repos for all this stuff, meaning you'll probably end in merging hell in a few years. The good news here is that SFDC is pretty nicely separated into modules (excluding the dependency of common tools, which got elegantly solved by shared pod), so it might not end up that bad.

Third caveat is that pod definitions for SFDC are located at internal (and thus private) pod specs definition repo at my company. You might want to set up your own private pod spec repo (I can point you to some tutorials), which is pretty simple once you get a hang of how it works.

Fourth and final caveat is that originally our SFDC Mobile SDK repository, on which I've based the main Native component, was private and I have to consult whether I can make it public.

Last but not least, I haven't even touched the hybrid version, so you'd probably have to do a bit more work if you need that version. Good news is that foundation is already laid out. ;)

@ghost
ghost commented Jan 22, 2014

@paweldudek Woooow!! Thanks for your explanation. Definitely, it's not an easy task. I will try to see if I can mimic what you did and make it work. Luckily for us, we don't need the hybrid version either.

@paweldudek
Contributor

FYI you might also run into an issue with the static library containing cocoa lumberjack symbols. I've removed with some lipo hackery, you can grab the modified version here: https://github.com/Taptera/SalesforceCommonUtils-Taptera

There's also a pod spec there, you can use for your own dependencies too. I might still do some work there so the version 1.0 can still change.

@paweldudek
Contributor

Ok, so...

If you're using Cococa Lumberjack as a dependency you won't be able to use the aforementioned component. You can consult this #430 issue for more info.

@paweldudek
Contributor

@veducm I've managed to solve all the issues with using SF as a dependency, so it's definitely doable. You can check out the repos I set up for this, they have all the required pod specs. The changes I made to code are minimal, if any.

@khawkins
Contributor

@paweldudek That's awesome! We'll take a look too, when we get to the work. CocoaPods is still up the priority list on our radar, but not at the top. Hopefully we'll make some traction in the next couple of months.

@paweldudek
Contributor

@khawkins it did require a bit of a different attitude when it comes to builds settings, however I haven't touched anything else, so far. Let me know if there're any details you need to get this working officially!

@ghost
ghost commented Jan 28, 2014

@paweldudek Thanks for sharing the great work! I will take a look again and see if I manage to replicate it for us.

Anyway, I really hope this gets supported officially soon!

@khawkins khawkins was assigned by bhariharan Feb 27, 2014
@edelabar

We were able to hack something together with binaries and a private CocoaPods repo, but it's a bit of a nightmare to keep up to date. We also had problems similar to @paweldudek with the custom fork of MKNetworking. Long story short, it would be great to have an officially-supported spec in the master repo!

@khawkins khawkins referenced this issue Jul 25, 2014
Closed

cocoapods #673

@jeffbailey

+1 for official support for a cocoapod. Is there a technical reason Saleforce doesn't support it? If not, very disappointing...

@akhileshgupta
Contributor

We are working on providing this support with our next release. Stay tuned.. #safeharbor

@carlcarter

Excellent news! Thank you

Sent from my iPhone

On 18 Sep 2014, at 18:18, akhileshgupta notifications@github.com wrote:

We are working on providing this support with our next release. Stay
tuned.. #safeharbor

Reply to this email directly or view it on GitHub
#90 (comment)
.

@jeffbailey

Yes, great news. In the meantime do you have a recommended approach to integrate the SDK into an existing project?

@akhileshgupta
Contributor

Sorry for delayed response. I just updated the steps to add the SDK to existing projects. You can find that here: SalesforceMobileSDK-iOS-Distribution Repo

@khawkins
Contributor
khawkins commented Oct 2, 2014

CocoaPods spec is now available on our unstable branch. Take a look and please post if you run into any issues.

@khawkins khawkins closed this Oct 2, 2014
@jschmid
Contributor
jschmid commented Oct 2, 2014

With a Podfile like:

pod 'SalesforceMobileSDK-iOS/SalesforceRestAPI', :git => 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS.git', :branch => 'unstable'

I get an error:

Installing SalesforceMobileSDK-iOS (3.0.0)
[!] /bin/bash
set -e
sed -i -e 's/#import \"Categories\//#import \"/g' external/MKNetworkKit/MKNetworkKit/MKNetworkKit.h

sed: external/MKNetworkKit/MKNetworkKit/MKNetworkKit.h: No such file or directory
@khawkins
Contributor
khawkins commented Oct 2, 2014

Make sure to use :submodules => true, in your Podfile, as the Mobile SDK makes use of them.

@btelintelo

Why was MKNetworking forked?

@khawkins
Contributor
khawkins commented Nov 2, 2014

There have been some Salesforce-specific additions that have been made to our fork of MKNetworkKit.

@rovqapint

Try to build solution with CocoaPods.
Build Failed with error: 'SalesforceCommonUtils/SFLogger.h' file not found

@rovqapint

Could you help me with this "'SalesforceCommonUtils/SFLogger.h' file not found" error?

@khawkins
Contributor

You can join the discussion in progress on our community, if you'd like to post details.

@khawkins
Contributor

The issue with the missing header file(s) has been resolved. Give it a shot with the latest version on master.

@jschmid
Contributor
jschmid commented Nov 27, 2014

👍 it works now

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