Skip to content

Support for CocoaPods #729

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

Closed
teobugslayer opened this issue Jul 31, 2015 · 11 comments
Closed

Support for CocoaPods #729

teobugslayer opened this issue Jul 31, 2015 · 11 comments
Assignees
Labels
Milestone

Comments

@teobugslayer
Copy link
Contributor

No description provided.

@teobugslayer teobugslayer added this to the 1.3.0 milestone Jul 31, 2015
@Fatme
Copy link
Contributor

Fatme commented Aug 6, 2015

Based on some discussions, I've prepared the expected behavior of the CocoaPods support.

Plugin prepare

If the plugin contains Podfile in platforms/ios folder {N} CLI will copy the content of Podfile to platforms/ios/Podfile in native project.

After all plugins are being prepared, {N} CLI will call pod install inside native project. This will produce .xcworkspace file.

Build

tns build command will respect the produced .xcworkspace for the current project and will build it.

@Fatme Fatme added the feature label Aug 6, 2015
@Fatme Fatme self-assigned this Aug 6, 2015
@ligaz
Copy link

ligaz commented Aug 6, 2015

An alternative approach will be to "extend" the package.json of the plugin with ios section like this:

{
  "name": "nativescript-http",
  "version": "0.9",
  "nativescript": {
    "ios" : {
      "pods" : {
        "AFNetworking" : ">=2.0"
      }
    }
  }
}

The benefits of this will be that we will not need a separate file for defining the pods. The down side is that we cannot support complex pod files that have ruby code in them. Also we will have to transform the npm version notation to pod's one.

@tjvantoll
Copy link
Contributor

My thought on this is that we should support whatever iOS developers are more comfortable with—which I'm guessing (and just guessing) is a Podfile rather than a package.json snippet.

My reasoning is that, IMO, only people with at least some iOS experience are going to be writing plugins that use Cocoa Pods, so we should be consistent with what they're comfortable with. Your average web developer doesn't know what a CocoaPod even is, and likely won't be jumping to create {N} plugins that use them.

@teobugslayer
Copy link
Contributor Author

I found this list of OSS iOS apps.

It appears that custom ruby code in a Podfile is relatively uncommon - I found them in less than 10 apps from the entire list. But pod commands like inhibit_all_warnings!, use_frameworks! and link_with are common enough and we may need to design to allow their usage. Thoughts?

@maknz
Copy link

maknz commented Aug 12, 2015

use_frameworks! is definitely important to us, I think. We need to use that in order to have non-framework iOS packages work, such as UICKeyChain.

@ligaz
Copy link

ligaz commented Aug 12, 2015

Thanks all for your input. We will be progressing with the dedicated podfile in the plugin strategy.

@maknz
Copy link

maknz commented Aug 12, 2015

How will this work for non-plugins, i.e. the main app? Will we keep a Podfile/Podfile.lock in App_Resources, or some-such?

@Fatme
Copy link
Contributor

Fatme commented Aug 14, 2015

Hi @maknz,

What is the use case to need Podfile in your main app?

@maknz
Copy link

maknz commented Aug 17, 2015

Our app uses the UICKeyChain pod for secure storage on iOS. We keep this in modules/secure-storage.(ios|android).js files, but no formalities of a third party module, it's just the JS. At the moment, we use this guide to use pods.

@vchimev
Copy link

vchimev commented Aug 28, 2015

Related issue: #826.

@vchimev
Copy link

vchimev commented Aug 28, 2015

Related issue: #831.

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

No branches or pull requests

7 participants