Results 1 to 10 of 21

Hybrid View

  1. #1
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    102
    Hello again,

    we investigated the matter, and I’m afraid we have bad news. As reported even at the very beginning of the official documentation, a Swift package can't contain binaries.

    We could publish our source code (in fact, our client SDKs are just reference implementations of our TLCP public protocol, there’s nothing to hide), but our build is currently based on a Java to Obj-C transpilation process (discussed in this blog post) that requires multiple libraries from an external project (Google’s J2ObjC). Those libraries could not be included, since they are binaries, and they are not available in turn as a Swift package.

    This rules out the possibility to wrap our iOS client SDK, as is, in a Swift package, at least for now. The day J2ObjC should release their libraries as a Swift package, or if we should ever embark on a full rewrite of the client in Swift, we will re-evaluate the opportunity. Until then, you will have to continue with more traditional ways to add our client to your projects.

    Thanks anyway for bringing this matter to our attention.

  2. #2
    Member
    Join Date
    Oct 2019
    Location
    Berlin
    Posts
    10
    Yes, indeed SPM doesn't yet support precompiled binaries. It seems they are on the pitching stage for this feature. For more information check:
    - Pitch: https://forums.swift.org/t/pitch-sup...ndencies/27620
    - SPM support for binary distribution discussion: https://forums.swift.org/t/spm-suppo...ribution/25549
    - SPM bundles & resources support discussion: https://forums.swift.org/t/swift-pm-...esources/13981

    It is quite interesting to realize you are transpiling Java to Obj-C. It seem to work well for my usage, which is mainly desktop bounded (https://github.com/dehesa/IG). I do wonder however how well does it play with URLSession including this year's changes (low data mode, etc). I had to do a MQTT library wrapping for Apple systems some years ago and using C and Posix implied not using URLSession, which work as intended on WiFi, but on Cell stop working altogether.

  3. #3
    Quote Originally Posted by gianluca.bertani View Post
    Hello again,

    we investigated the matter, and I’m afraid we have bad news. As reported even at the very beginning of the official documentation, a Swift package can't contain binaries.
    Hi, thanks for your answer. I understand the limitation.

    Xcode 11 supports distributing binary libraries with new XCFrameworks format. https://developer.apple.com/videos/play/wwdc2019/416/
    Just out of curiosity, I have tried to run

    cd lightstreameriosclientxcodebuild
    -create-xcframework -framework Lightstreamer_iOS_Client.framework -output lightstreamer.xcframework

    And I am getting error:
    error: binaries with multiple platforms are not supported

    Is this because your binary contains Java? Only Swift and "C based code" is supported.

    If you decide to rewrite your client in Swift — XCFrameworks is wonderful tool for distribution with official support. It's great alternative to SPM if you don't want to go open source. I wish you all the best.

 

 

Similar Threads

  1. Java import - package does not exist
    By UweF in forum General
    Replies: 4
    Last Post: March 2nd, 2016, 05:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:13 PM.