Open
Description
Describe the bug
Because of a bug with xcodebuild reported here and here, when RxBluetoothKit project is integrated directly as a source dependency inside another project (not via Carthage), Xcodebuild will incorrectly choose the wrong target (macOS, watchOS) when determining dependencies implicitly.
To Reproduce
Steps to reproduce the behavior:
- Create a simple project with just iOS as platform/sdk
- Make sure Implicit Dependency is checked in the scheme
- Add RxBluetoothKit.xcodeproj to project
- Drag the RxBluetoothKit.framework for iOS from RxBluetoothKit.xcodeproj Products folder to the Link Phase of the main project.
- Make sure it's NOT explicitly specified in Target Dependency (xcodebuild will complain about multiple commands build the same output otherwise)
- On the command line execute:
set -euo pipefail && xcodebuild -derivedDataPath 'build' -sdk 'iphonesimulator' -enableCodeCoverage YES -scheme 'App' -configuration 'Debug' build
Notice that it will randomly pick ios, watchos or macos.
Expected behavior
It should pick iOS.
Solution
The way to solve it is to follow what other frameworks do like RxSwift, etc.. and have a single target RxBluetoothKit
that supports all platforms.
Environment:
- Macbook Pro 2018
- OS: macOS 10.14.4
- Library version: 5.2.1
- Swift version: 5