Native 3th party integration using Cocoapods (along with cocoapods-art plugin)

35 views
Skip to first unread message

Hasni Faiçal

unread,
Aug 29, 2019, 6:38:07 AM8/29/19
to CodenameOne Discussions
IDE: NetBeans
Desktop OS: Mac
Simulator
Device: iPhone

Hi,

I need to integrate an SDK to codename one project (I cannot share it's name for confidentiality reasons), they provided the following instructions, I can integrate it using Xcode project, but cannot figure out how to do it on codename one.

Any advice?
Thanks in advance!

Using Cocoapods (along with cocoapods-art plugin)

  1. Because standard cocoapods doesn’t support any authentication mechanisms, in order to use CocoaPods with Artifactory you will need to install the ‘cocoapods-art’ plugin. To install cocoapods-art run the following command:

    gem install cocoapods-art
  2. The plugin uses authentication as specified in standard .netrc file).

    machine A_PRIVATE_URL
    login ##USERNAME##
    password ##PASSWORD##
  3. Once set, add our repo to your cocoapods dependency management system:

    pod repo-art add myPrivateSDK "A_PRIVATE_ART_URL" 
  4. At the top of your project Podfile add:

    plugin 'cocoapods-art', :sources => [
        'master',                 # so it could resolve dependencies from master repo (the main one)
        'myPrivateSDK'            # so it could resolve PRIVATE_FRAMEWORK1 depdendency
    ]
  5. Add the FRAMEWORKS in your Podfile in one of its pods version:

    pod 'PRIVATE_FRAMEWORK1'
    
    pod 'PRIVATE_FRAMEWORK2' 

  6. Then you can use install as usual:

    pod install

NOTES. If you are already using our repo, and you cannot resolve some dependency, try to update the specs:

pod repo-art update myPrivateSDK

Shai Almog

unread,
Aug 29, 2019, 10:45:25 PM8/29/19
to CodenameOne Discussions
Hi,
I'm guessing here but you can probably create a podspec file with the content of step 4.
Also you would need to add the URL from step 3 to the pod hints. I think the rest should just work but I'll need to check.
Message has been deleted

Steve Hannah

unread,
Aug 30, 2019, 8:11:19 AM8/30/19
to codenameone...@googlegroups.com
You can specify a username and password for a pod source in the ios.pods.sources build hint.  E.g.

The build server will parse this out and generate the appropriate netRC file to make the connection.

(Multiple sources can be included, separated by a comma or semi-colon).

You can also add your own custom podspecs in your project's native/ios/podspecs directory.  See this sample project as an example

Steve


On Fri, Aug 30, 2019 at 4:48 AM Hasni Faiçal <hasni....@gmail.com> wrote:
Thank you for your help, this is the same explained here to install library from artifactory repository https://www.jfrog.com/confluence/display/RTF/CocoaPods+Repositories,
Following your instructions we will expose the library to public.
Is there any way to run those instruction as scripts while building the project? may be using build.xml for example?

This is urgent 

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/6df29235-bc55-449b-a987-d3b01f9fcf94%40googlegroups.com.


--

Faiçal HASNI 
Software engineer - DevOps & Full-Stack software development
T : +212 696-180072
E : hasni....@gmail.com
L : Add me on LinkedIn 

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/CAAT5ZimRxcdZABOk0vyVEbh7Xn7BZXL7Yzu8ziGFBSqZ8qeo8Q%40mail.gmail.com.


--
Steve Hannah
Software Developer
Codename One
Message has been deleted

Hasni Faiçal

unread,
Sep 5, 2019, 4:48:25 AM9/5/19
to CodenameOne Discussions
Thank you all, it works for me, I created a private spec repository, and I add it to sources, Now the project can be build successfully. and the source code contains the necessary pods as expected.

On Friday, August 30, 2019 at 1:11:19 PM UTC+1, Steve Hannah wrote:
You can specify a username and password for a pod source in the ios.pods.sources build hint.  E.g.

The build server will parse this out and generate the appropriate netRC file to make the connection.

(Multiple sources can be included, separated by a comma or semi-colon).

You can also add your own custom podspecs in your project's native/ios/podspecs directory.  See this sample project as an example

Steve


On Fri, Aug 30, 2019 at 4:48 AM Hasni Faiçal <hasni....@gmail.com> wrote:
Thank you for your help, this is the same explained here to install library from artifactory repository https://www.jfrog.com/confluence/display/RTF/CocoaPods+Repositories,
Following your instructions we will expose the library to public.
Is there any way to run those instruction as scripts while building the project? may be using build.xml for example?

This is urgent 

On Fri, Aug 30, 2019 at 3:45 AM Shai Almog <shai...@gmail.com> wrote:
Hi,
I'm guessing here but you can probably create a podspec file with the content of step 4.
Also you would need to add the URL from step 3 to the pod hints. I think the rest should just work but I'll need to check.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages