RxSwiftCommunity / RxSwiftExt

A collection of Rx operators & tools not found in the core RxSwift distribution
MIT License
1.32k stars 213 forks source link

Fix Carthage integration #266

Closed giginet closed 3 years ago

giginet commented 3 years ago

Motivation

I'd like to use this library with Carthage, However, some settings are broken, so we can't build this with Carthage.

There are two problems.

Minimum situation

Xcode 12.4

Cartfile (of an application project)

github "RxSwiftCommunity/RxSwiftExt" "7cae93b7795fb7b4ecf617aec5f1c0f1fc8fb0e6" # current main HEAD

Carthage build command

$ carthage bootstrap --platform ios --use-xcframeworks --cache-builds
*** Building scheme "RxSwiftExt-iOS" in RxSwiftExt.xcworkspace
Build Failed
        Task failed with exit code 65:
        /usr/bin/xcrun xcodebuild -workspace /Users/giginet/work/CarthagePlayground/Carthage/Checkouts/RxSwiftExt/RxSwiftExt.xcworkspace -scheme RxSwiftExt-iOS -configuration Release -derivedDataPath /Users/giginet/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/RxSwiftExt/6.0.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO -archivePath /var/folders/b_/_ndwwrsd68q8yskc_sbtlbk80000gn/T/RxSwiftExt SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/giginet/work/CarthagePlayground/Carthage/Checkouts/RxSwiftExt)

Description

I fixed some errors to integrate this library with Carthage.

  1. Cartfile syntax was broken
  2. Change minimum development target version to 9.0
    • Package.swift requires 9.0. However, xcodeproj's one was wrong.
  3. Add Rx.xcodeproj to xcodeproj to solve dependencies

Fixes 3 will solve the issue which it can't build this library as XCFramework with Carthage. Current xcodeproj searchesRxSwift.framework in Carthage/Build/iOS. However, when it was built with --use-xcframework options, RxSwift.xcframework is generated instead. So the project can't find dependencies. I added Rx.xcodeproj into the xcodeproj as a child project. It will solve this problem.

rxswiftcommunity[bot] commented 3 years ago

Thanks a lot for contributing @giginet! I've invited you to join the RxSwiftCommunity GitHub organization – no pressure to accept! If you'd like more information on what this means, check out our contributor guidelines and feel free to reach out with any questions.

Generated by :no_entry_sign: dangerJS

giginet commented 3 years ago

It works for me. @freak4pc Could you release a newer version?

$ carthage update --platform ios --use-xcframeworks --cache-builds RxSwiftExt
*** Fetching RxSwiftExt
*** Fetching RxSwift
*** Checking out RxSwiftExt at "a42af9caeab63f2dbde318f1f3dc424f05871a37"
*** Checking out RxSwift at "6.1.0"
*** Valid cache found for RxSwift, skipping build
*** Invalid cache found for RxSwiftExt, rebuilding with all downstream dependencies
*** Building scheme "RxSwiftExt-iOS" in RxSwiftExt.xcworkspace