snowplow / snowplow-ios-tracker

Snowplow event tracker for Swift and Objective-C. Add analytics to your iOS, macOS, tvOS and watchOS apps and games
http://snowplow.io
Apache License 2.0
81 stars 93 forks source link

Linux platform compatibility #882

Closed markst closed 6 months ago

markst commented 7 months ago

We'd like to run our Swift Package tests on a Linux runner on Bitrise. https://www.swift.org/documentation/server/guides/testing.html

This means we can in parallel run an instance of Snowplow Micro in order to validate our events against schema.

However it seems we're unable to compile SnowplowTracker due to usage of AVKit:

[5/88] Emitting module SnowplowTracker
/code/.build/checkouts/snowplow-ios-tracker/Sources/Core/InternalQueue/MediaControllerIQWrapper.swift:16:8: error: no such module 'AVKit'
import AVKit
       ^ 
markst commented 7 months ago

Seems that in most cases the usage of AVKit is based on the assumption that it's watchOS.

This could be remedied by checking if search path finds framework, rather than assuming watchOS:

#if canImport(AVKit)
import AVKit
markst commented 7 months ago

Not as simple as I thought to compile for linux 🤭

error: Objective-C interoperability is disabled
    @objc