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

Discuss: Use a single target for all platforms? #818

Closed
AndrewSB opened this issue Dec 1, 2016 · 17 comments
Closed

Discuss: Use a single target for all platforms? #818

AndrewSB opened this issue Dec 1, 2016 · 17 comments

Comments

@AndrewSB
Copy link
Member

AndrewSB commented Dec 1, 2016

Hey all! I was reading https://blog.pusher.com/what-i-learned-building-the-pusherswift-framework/, and one of the first things the author goes into is how the framework they built uses only one target for all platforms.

Currently Moya has 4 targets for each 3 of our frameworks (12 total), and then 3 for tests.
screen shot 2016-12-01 at 2 39 57 pm

I'm not sure how the author was able to make a universal target, but maybe we could do something similar?

@pmairoldi
Copy link
Member

I know how. I've done it for other projects. It's fairly simple. There are couple things not really mentioned but this article covers mostly how to do this http://promisekit.org/news/2016/08/Multiplatform-Single-Scheme-Xcode-Projects/.

@AndrewSB
Copy link
Member Author

AndrewSB commented Dec 2, 2016

@petester42 that looks really cool, it would be awesome to have Moya vend through one target as well.
I could take a shot in a PR, but since you've done this before it may be easier for you to do it? Let me know what you think.

@pmairoldi
Copy link
Member

Ya sure I could do it. I was creating a script that would automatically do this but I haven't finished it. I could do it manually, it wouldn't take too long.

@AndrewSB
Copy link
Member Author

AndrewSB commented Dec 2, 2016

💯

A script that would do this automatically for any project?

@BasThomas
Copy link
Contributor

That... that'd be awesome 😱

@aaroncrespo
Copy link
Contributor

How would this work with bundleID collisions with say a watchOS extension.

@pmairoldi
Copy link
Member

This more for frameworks than actual applications. It's not really useful for application targets

@aaroncrespo
Copy link
Contributor

aaroncrespo commented Dec 2, 2016

frameworks still have bundleID's though.

Reason I am asking is because I do this already for other frameworks and had issues when we wanted to use the framework compiled in this way in an Application as well as a Watch extension bundled with that Application.

@AndrewSB
Copy link
Member Author

AndrewSB commented Dec 2, 2016

@aaroncrespo can you give a concrete example?
I think the issue with bundle ID collisions disappears when you have one universal target, since there is only one target - it can't collide with something that no longer exist.

sorry if I misunderstood your comment 😅

@AndrewSB AndrewSB closed this as completed Dec 2, 2016
@AndrewSB AndrewSB reopened this Dec 2, 2016
@aaroncrespo
Copy link
Contributor

It's more a question maybe we weren't loading/linking the framework correctly across watch/extension/app.

@pmairoldi
Copy link
Member

I have no idea about watchOS stuff.

@AndrewSB
Copy link
Member Author

AndrewSB commented Dec 8, 2016

@petester42 I think we should go ahead with this, and we can fix watchOS issues if/when they come up. When you create a PR, can you close this issue?

Thanks 😄

@AndrewSB
Copy link
Member Author

AndrewSB commented Jan 2, 2017

@scottrhoyt @BasThomas @pedrovereza: Along the lines of simplifying the project structure in #885, I think it would be really awesome to have this implemented too.

Especially if we can have it in before the 8.0.0 release.

@BasThomas
Copy link
Contributor

Hmm, would this be a breaking change? I agree this would definitely be nice, but I am not so sure if we need it before releasing 8.0.0.

@scottrhoyt
Copy link
Contributor

I don't think it would be a breaking change.

@AndrewSB
Copy link
Member Author

AndrewSB commented Jan 3, 2017

Oh, you guys are right. It would have 0 effect on the API, it was just related to the new project structure we had

@AndrewSB
Copy link
Member Author

Implemented in #967 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants