Building a large dependency graph can take some time. If you know that you'll only need the frameworks for a particular platform, the process could be expedited with a flag like --platform Mac or something like that.
Suggest also allowing that to be specified in Cartfile to save typing.
:+1: for optionally putting it in the Cartfile
It's probably needed on a per-dependency basis, too
@robb Why's that?
Let's say you have a Mac and iOS target in you project, but only depend on the iOS framework of some dependency. E.g. some compatibility shims that you only want on Mac, where you support older versions?
I see. While specifying the platform per dependency could certainly be useful, it seems like a bit of an edge case, and introduces significant complexity into the Cartfile format and the build process.
I'd rather just have a global option, and default to both.
I'd rather just have a global option, and default to both.
Let's do that and burn the other bridge when/if someone comes to it.
This is relevant for anyone wanting to use Quick via Carthage on a Mac-only project, since building Quick-iOS requires a valid CodeSigning identity or the whole thing fails.
Obviously this applies to other projects too but this is the scenario I ran into.
Split the Cartfile option out into #262. This issue can encompass _just_ the command line flag.
My issue here is that if carthage builds targets 1 & 2, in that order, and I only need target 2, if carthage fails to build target 1, i'm SOL.
My current project has only 2 simple dependencies, but I can't build either for this reason, one fails on OS X build the other fails on watchOS build. I am developing an iOS app... 馃檲
@wbarksdale Why not specify --platform iOS?
For those of us who just got here from the Internet, @ikesyo is giving you a legit command
carthage build --platform iOS
Which is great if you need to avoid a platform like tvOS. Check your Carthage/Build directory to see the output.
as just comment here from the Internet, is there an option to specify it in the Cartfile?
@martnst you mean to specify the platform in the Cartfile? I'm pretty sure there isn't.
Yes, as I am working on a simple iOS app there is no need to wast time on building for macOS or tvOS.
a Makefile would be a good fit for project-specific build commands like these. no need to extend the Cartfile
@wbarksdale Would it work to use two Cartfiles in two directories named macOS & watchOS, each with their own .xcodeproj?聽 The codebase could still be shared (outside of those two dirs), and there could still be a .xcworkspace for general programming & building either-or.
I'm using
carthage update --platform macOS
but it's built for all platforms!
my Cartfile contents:
github "realm/realm-cocoa"
its shame!
@mehdico Currently, the build command supports --platform while the update command does not. So the way to accomplish that is with carthage update --no-build && carthage build --platform macOS.
_Like all command-line stuff, you could create a tiny script on your machine to macro this as carthage-update-and-build --platform macOS or carthage-upbuild --platform macOS or similar with a bash script not much more complicated than cathage update --no-build && carthage build "$@"._
Most helpful comment
For those of us who just got here from the Internet, @ikesyo is giving you a legit command
carthage build --platform iOSWhich is great if you need to avoid a platform like tvOS. Check your Carthage/Build directory to see the output.