Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug carthage dependencies with different platform #465

Merged
merged 1 commit into from
Jan 26, 2019
Merged

Bug carthage dependencies with different platform #465

merged 1 commit into from
Jan 26, 2019

Conversation

raptorxcz
Copy link
Contributor

When project is generated, then in iOS app are added all carthage dependencies.
This behaviour is wrong, because iOS target can have watchOS target as a dependency.

@yonaskolb
Copy link
Owner

yonaskolb commented Jan 8, 2019

Hmm, maybe this behaviour is indicative of a deeper issue in that targets shouldn't be able to specify target dependencies that aren't the same platform. That could be added to the spec validation pass.

Or do you have some weird case where one target has a dependency on a target with a different platform? Maybe there's watchOS extension case or something I'm not thinking of

@raptorxcz
Copy link
Contributor Author

raptorxcz commented Jan 8, 2019

The project generating is correct. In iOS bundle can be watchOS app. I am not sure, but I think same behaviour can be achieved with tvOS too.

@yonaskolb
Copy link
Owner

Could you also add a changelog entry

Also can you explain a use case that this fixes? The tests use Alamofire_watch but is that a real use case? Wouldn't the watch target just use Alamofire?

Would another way of thinking of this be don't include carthage dependencies from app targets?

@raptorxcz
Copy link
Contributor Author

Changelog is updated. It is real use case. At my project we have 2 dependecies. Name of first dependency is Core. The name is same for all platforms. The name of second dependency is Platform_platformName eg. Platform_iOS or Platform_watchOS. The problem was that carthage imported framework Platform_watchOS to iOS app.

@raptorxcz
Copy link
Contributor Author

I think not importing app dependencies would be correct solution for this problem. I also think it would be better solution than current one.

@Alex293
Copy link

Alex293 commented Jan 11, 2019

I have multiple examples of libs that behave like this. I’ll post them asap

@raptorxcz
Copy link
Contributor Author

Hi @yonaskolb,

Is is possible to merge this PR or is it required to implement the solution you suggested?

Thanks

@@ -517,6 +517,23 @@ class SourceGeneratorTests: XCTestCase {
try expect(sourcesBuildPhase.files.count) == 1
}

$0.it("add only carthage dependencies with same platform", closure: {
Copy link
Owner

@yonaskolb yonaskolb Jan 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Can this be made a trailing closure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ec60901.

@yonaskolb
Copy link
Owner

@raptorxcz I guess there's nothing wrong with this directly, so we can merge it. Just needs a rebase and a small tweak

@raptorxcz
Copy link
Contributor Author

Updated in ec60901.

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @raptorxcz!

@yonaskolb yonaskolb merged commit 80587b4 into yonaskolb:master Jan 26, 2019
@raptorxcz raptorxcz deleted the bugfix/carthage branch January 26, 2019 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants