Carthage: Which project or workspace will Carthage select?

Created on 9 Oct 2016  路  4Comments  路  Source: Carthage/Carthage

  • carthage version: 0.18.1
  • xcodebuild -version: XCode 8.0 (8A218a)
  • Are you using --no-build? no
  • Are you using --no-use-binaries? yes
  • Are you using --use-submodules? no

Cartfile

github "RxSwiftCommunity/RxAlamofire" "3.0.0-beta.1"

Carthage Output

*** Building scheme "RxAlamofire-iOS" in RxAlamofire.xcworkspace

This is a question regarding the project or workspace that Carthage will use.

As far as I know if there is no .xcworkspace then carthage will use the top level .xcodeproj and if there is a .xcworkspace and a .xcodeproj carthage will use the . xcworkspace, I can also verify this behaviour with multiple dependencies.
But if i have a project like RxAlamofire then carthage with use the RxAlamofire.xcworkspace instead of the _.xcodeproj.
Is this a carthage bug or is it an expected behaviour?
If this is an expected behaviour which is the logic of choosing the .xcworkspace instead of the .xcodeproj

thanks

question

Most helpful comment

@mdiep I definitely disagree with this approach. Carthage has so many intricate issues mixing UI projects in sub frameworks it's sort of mind boggling. I'm surprised that it doesn't take that into account.

All 4 comments

Carthage builds all dynamic framework schemes that are shared from an Xcode project file. If that scheme is exposed through a workspace, Carthage will build that scheme through the workspace. Otherwise it will build it through the xcodeproj.

Lets says that we have the project Foo with this directory structure

Foo/foo.xcodeproj (iOS Shared Scheme)
Foo/Foo/Foo.xcodeproj (iOS Shared Scheme)
Foo/Foo/Foo.xcworkspace (iOS Shared Scheme)

iOS Shared Scheme is the only shared scheme in the repository.

carthage will build the iOS Shared Scheme from the Foo/Foo/Foo.xcworkspace file and not from the Foo/foo.xcodeproj

is this behaviour normal?

I thought that carthage would try to build the iOS Shared Scheme from the Foo/foo.xcodeproj.

Carthage should search only the top level directory for xcodeproj or xcworkspace, right?

is this behaviour normal?

Yes

Carthage should search only the top level directory for xcodeproj or xcworkspace, right?

No

@mdiep I definitely disagree with this approach. Carthage has so many intricate issues mixing UI projects in sub frameworks it's sort of mind boggling. I'm surprised that it doesn't take that into account.

Was this page helpful?
0 / 5 - 0 ratings