ReSwift/ReSwift-Thunk

ExpectThunk fails for watchOS using CocoaPods (pod lib lint)

DivineDominion opened this issue · 2 comments

See the error by Travis on #33

ExpectThunk is only supposed to be used for test targets. watchOS doesn't have any. So the whole build process fails, e.g. during pod lib lint.

$ pod lib lint

 -> ReSwiftThunk (1.2.0)
    - NOTE  | [ReSwiftThunk/Core,ReSwiftThunk/ExpectThunk] xcodebuild:  note: Using new build system
    - NOTE  | [ReSwiftThunk/Core,ReSwiftThunk/ExpectThunk] xcodebuild:  note: Planning build
    - NOTE  | [ReSwiftThunk/Core,ReSwiftThunk/ExpectThunk] xcodebuild:  note: Constructing build description
    - ERROR | [watchOS] [ReSwiftThunk/ExpectThunk] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - ERROR | [watchOS] [ReSwiftThunk/ExpectThunk] xcodebuild:  /Users/ctm/Coding/ReSwift-Thunk/ReSwift-ThunkTests/ExpectThunk.swift:9:8: error: no such module 'XCTest'
    - ERROR | [watchOS] [ReSwiftThunk/ExpectThunk] xcodebuild:  /Users/ctm/Library/Developer/Xcode/DerivedData/App-cpmepnvvxujdnyaypnrkyuqqmcbo/Build/Products/Release-watchsimulator/ReSwiftThunk/ReSwiftThunk.framework/Modules/module.modulemap:9:12: error: header 'ReSwiftThunk-Swift.h' not found
    - ERROR | [watchOS] [ReSwiftThunk/ExpectThunk] xcodebuild:  /var/folders/62/8k21681d08z9lhq8h433z3rh0000gp/T/CocoaPods-Lint-20190906-51488-dhxrll-ReSwiftThunk/App/main.swift:1:8: error: could not build Objective-C module 'ReSwiftThunk'

[!] ReSwiftThunk did not pass validation, due to 4 errors.
You can use the `--no-clean` option to inspect any issue.

Tried conditional compiling:

#if os(watchOS)
// Testing is not supported
#else
import XCTest
import ReSwift

#if RESWIFT_THUNKTESTS
import ReSwiftThunk
#endif

private struct ExpectThunkAssertion<T> { ... }
class ExpectThunkTests { ... }
#endif

Produces a tad different error:

 -> ReSwiftThunk (1.2.0)
    - NOTE  | [ReSwiftThunk/Core,ReSwiftThunk/ExpectThunk] xcodebuild:  note: Using new build system
    - NOTE  | [ReSwiftThunk/Core,ReSwiftThunk/ExpectThunk] xcodebuild:  note: Planning build
    - NOTE  | [ReSwiftThunk/Core,ReSwiftThunk/ExpectThunk] xcodebuild:  note: Constructing build description
    - ERROR | [watchOS] [ReSwiftThunk/ExpectThunk] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | [ReSwiftThunk/ExpectThunk] xcodebuild:  ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/Library/Frameworks'
    - NOTE  | [ReSwiftThunk/ExpectThunk] xcodebuild:  clang: error: linker command failed with exit code 1 (use -v to see invocation)

[!] ReSwiftThunk did not pass validation, due to 1 error.
You can use the `--no-clean` option to inspect any issue.

Solved in v1.2.0