Polidea / RxBluetoothKit

iOS & OSX Bluetooth library for RxSwift
Apache License 2.0
1.41k stars 366 forks source link

Multiple targets with same framework output name causes Xcode to build the wrong target #342

Open c0diq opened 5 years ago

c0diq commented 5 years ago

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:

  1. Create a simple project with just iOS as platform/sdk
  2. Make sure Implicit Dependency is checked in the scheme
  3. Add RxBluetoothKit.xcodeproj to project
  4. Drag the RxBluetoothKit.framework for iOS from RxBluetoothKit.xcodeproj Products folder to the Link Phase of the main project.
  5. Make sure it's NOT explicitly specified in Target Dependency (xcodebuild will complain about multiple commands build the same output otherwise)
  6. 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:

m-ricca commented 2 years ago

same problem

Marcello168 commented 2 years ago

same problem