Does 'swift build' execute Test Code on macOS even for iOS Only Apps?

Hi,

I have a library for my iOS Apps. It uses among other things the Combine framework, Core Location and OSLog. I manage the library using the Swift Package Manager (SPM) and usually build via XCode, which works fine. However for CI I would like to build everything from the terminal. So I do call 'swift build' on the terminal. This produces errors such as:

  • 'PassthroughSubject' is only available in macOS 10.15 or newer
  • 'os_log(:dso:log::_:)' is only available in macOS 10.14 or newer
  • 'eraseToAnyPublisher()' is only available in macOS 10.15 or newer
  • 'authorizedWhenInUse' is unavailable in macOS
  • 'AnyPublisher' is only available in macOS 10.15 or newer
  • 'showsBackgroundLocationIndicator' is unavailable in macOS
  • ...

These are all from the used frameworks. However, I do not care on which version of macOS, for example, PassthroughSubject is only available at, since the library is iOS only. Too make sure of that I added "platforms: [.iOS(.v14)]" to my Package.swift and thought this would be sufficient, so the project does not get build for macOS.

Can anyone please tell me or give me a hint on what I am getting wrong here?

Does 'swift build' execute Test Code on macOS even for iOS Only Apps?
 
 
Q