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

cocoapods support improvement #108

Merged
merged 1 commit into from
Sep 9, 2019

Conversation

knight9999
Copy link
Contributor

The purpose of this ticket is to improve Cocoapod support by:

  • Deprecate the framework usage of type="podspec"

The current framework tag type="podspec" provided basic CocoaPods support in the beginning. Continuing to support this method but expand on the tag to support more features will become messy. Additionally, some configurations are not at an individual pod level.

In this case, the best option is to deprecate this method and implement a new method for handling CocoaPods.

  • Improve readability

The new method/structure in plugin.xml will improve the readability.

  • Add missing default configurations

The new method/structure in plugin.xml will also provide the ability to give users flexibility with global pod configuration and down to the individual pods.

Goals

@jcesarmobile
Copy link
Member

Any info about the new method?

@knight9999
Copy link
Contributor Author

knight9999 commented Aug 27, 2018

Thanks @jcesarmobile .

This proposal introduces new tag podspec and its child tags in plugin.xml as https://github.com/cordova-develop/cordova-discuss/blob/ios-cocoapod-improvement/proposals/ios-cocoapods-improvement.md .

(I don't plan to introduce pod_install scripts there now)

In order to develop this feature, I will improve PluginInfo.js in cordova-common, and API.js, pluginHandlers.js, Podfile.js and PodsJson.js in cordova-ios.

For example, I plan to introduce new methods

  1. getPodSpecs in PluginInfo.js to parse new tags. (similar to method getSourceFiles, but rather complicated due to the structure of podspec tag)
  2. addDeclaration and addSource in Podfile.js. (similar to method addSpec)
    => source means URL of CocoaPods podspec repogitry.
    => declaration means CocoaPods statement use_frameworks! or inhibit_all_warnings! in Podfile.
  3. removeDeclaration and removeSource in Podfile.js. (similar to method removeSpec)
  4. __updateFormatIfNecessary in PodsJson.js, this is private method, which upgrade pods.json file in order to record sources and declarations

I will improve addPlugin and removePlugin methods in Api.js to apply new tags setting to pods.json and Podfile.

@mattdsteele
Copy link

Hi! Not sure if this is related, but is there a way to add a Cocoapods plugin?

My use case is: we use Artifactory CocoaPods proxy to resolve dependencies behind a corporate firewall. The Artifactory documentation specifies to make this work, you have to add this to the Podfile:

plugin 'cocoapods-art', :sources => [
  'cocoaPods-remote'
]

Is this achievable with your changes @knight9999 ?

@knight9999
Copy link
Contributor Author

@mattdsteele
Sorry for replying so late.

If you want to get the Podfile:

plugin 'cocoapods-art', :sources => [
  'cocoaPods-remote'
]

Your plugin.xml should have

  <platform name="ios">
    ...
    <podspec>
      <config>
        ...
      </config>
      <pods use-frameworks="true">
        <pod name="cocoapods-art" options=":sources=>'cocoaPods-remote'" />
      </pods>
    </podspec>
  </platform>

i.e. To specify source for each library, please use general options attribute in pod tag.

@erisu erisu merged commit 6057c88 into apache:master Sep 9, 2019
@erisu
Copy link
Member

erisu commented Sep 9, 2019

Merged as the support improvements were already integrated and released.

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

Successfully merging this pull request may close these issues.

5 participants