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

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
Closed
Assignees

Comments

@superfell
Copy link

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
Copy link
Author

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
Copy link
Contributor

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

@akaromka
Copy link

akaromka commented Jun 2, 2013

Do you have any news about Cocoapods request?

@khawkins
Copy link
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.

@edelabar
Copy link

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
Copy link
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
Copy link
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
Copy link

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
Copy link
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
Copy link

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
Copy link
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
Copy link
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
Copy link
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
Copy link
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
Copy link
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
Copy link

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!

@edelabar
Copy link

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 mentioned this issue Jul 25, 2014
@jeffbailey
Copy link

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

@akhileshgupta
Copy link
Contributor

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

@carlcarter
Copy link

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
Copy link

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

@akhileshgupta
Copy link
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
Copy link
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 as completed Oct 2, 2014
@jschmid
Copy link
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
Copy link
Contributor

khawkins commented Oct 2, 2014

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

@btelintelo
Copy link

Why was MKNetworking forked?

@khawkins
Copy link
Contributor

khawkins commented Nov 2, 2014

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

@rovqapint
Copy link

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

@rovqapint
Copy link

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

@khawkins
Copy link
Contributor

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

@khawkins
Copy link
Contributor

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

@jschmid
Copy link
Contributor

jschmid commented Nov 27, 2014

👍 it works now

mneubrand-sfdc pushed a commit to mneubrand-sfdc/SalesforceMobileSDK-iOS that referenced this issue Feb 6, 2015
Mobile SDK: Merging unstable into community
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests