Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    99
    Thanks for your information. We will surely take a second look at supporting SPM.

    And sorry for the late answer, unfortunately your post was flagged for moderation (probably due to links) and it went under our radars.

  2. #12
    Member
    Join Date
    Oct 2019
    Location
    Berlin
    Posts
    5
    Hello again Gianluca (and Boris),

    Sorry to revive this old post. After some research and with the release of Swift 5.3, I believe I found a way to deliver Lighstreamer binaries through SPM that doesn't require code changes, just a Xcode rebuild.

    Let me summarize the current state of things:
    1. Lightstreamer transpiles Java to ObjC and delivers four dynamic libraries in the shape of .framework files (for macOS, iOS, tvOS, and watchOS).
    2. End-clients wanting to use Lightstreamer functionality just needs to embed/link the selected Lighstreamer framework file in their Xcode project.
    3. More often than not, the Lighstreamer dynamic framework is just one low-level component within a major library. A good example is IG (company where Boris works). IG uses Lightstreamer as their "real-time" messaging system, but they offer much more functionality.
    4. Swift programmers wanting to use IG services, need to know all dependencies and their requirements, manually download them, embed/link the dependency frameworks, and set correctly all the build settings (they need to be careful since there are different dynamic libraries per target platform: macOS x86-64, macOS arm64, iOS arm64, iOS x86 simulator, tvOS arm64, tvOS simulator, etc.).

    The goal is to make life as simple as possible for the end user. Ideally, a user specify a SPM url in his/her project, and all the required dependencies (for the right platforms) are downloaded and compiled.

    SPM and Swift 5.3 enable this through the new .binaryTarget. It is now possible to specify binary dependencies, by providing a URL and a checksum. The only caveat is that the binary dependency must be exposed as a .xcframework. A xcframework is just a standard bundle of compiled binaries. It is actually possible to create a single xcframework from all the already released Lighstreamer dynamic libraries, by using the following terminal command:

    xcodebuild -create-xcframework \
    -framework Lightstreamer_iOS_Client.framework \
    -framework Lightstreamer_macOS_Client.framework \
    -framework Lightstreamer_tvOS_Client.framework \
    -output Lightstreamer.xcframework


    Sadly,this command fails because the iOS and tvOS frameworks currently bundle both their arm64 code and the x86 simulator code. xcframework enforces that each framework must only target a single architecture. Therefore, for this command to work there must be a framework for each architecture: iOS arm64, iOS simulator, tvOS arm64, tvOS simulator, etc.

    So Gianluca, I would kindly ask you to do one of the following things:
    - Provide a framework per platform architecture (do not bundle simulator and real device code), or
    - Provide a xcframework zip file.

    This would enable the delivery of Swift Packages, ease the use of the Lighstreamer framework, and reduce the amount of compilation/linking errors. Personally, I need a xcframework for Lightstreamer Allegro Presto Vivace 6.1.0 2017/01/23 (unified API 2.1.2), since this is what IG support. Is it possible to receive such xcframework zip file?

  3. #13
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    99
    Hello,

    thank you for your valuable insights into the problem. I will surely take a look and let you know.

  4. #14
    Member
    Join Date
    Oct 2019
    Location
    Berlin
    Posts
    5
    Great. Looking forward your analysis/response. In the meantime, you can find a project currently delivering Lighstreamer binaries through SPM here. That project delivers a library (which can statically or dynamically linked) and a packaged Lighstreamer.xcframework.

    Regards,

 

 

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 04:12 AM.