Carthage: bootstrap vs update?

Created on 14 Oct 2015  路  5Comments  路  Source: Carthage/Carthage

What are the guidelines to follow when using bootstrap vs update commands? How are they different, when should one be used instead of the other?

bootstrap        Check out and build the project's dependencies
update            Update and rebuild the project's dependencies

Is there a way to get Carthage to only update and build dependencies that have changed? It seems that Carthage rebuilds everything each time either of these commands are run. Are there any arguments that can be passed to these commands?

Most helpful comment

bootstrap reads Cartfile.resolved, checks out and builds the dependencies at the versions listed.

update reads Cartfile and runs the dependency resolver to check out dependencies recursively, generally aiming for the newest versions that are compatible with all constraints in the tree. It writes Cartfile.resolved.

So, if you're updating to newer dependencies, or you've edited your Cartfile, use update. If you've just checked out your project and want the dependencies as specified in the commit you're on, use bootstrap.

All 5 comments

bootstrap reads Cartfile.resolved, checks out and builds the dependencies at the versions listed.

update reads Cartfile and runs the dependency resolver to check out dependencies recursively, generally aiming for the newest versions that are compatible with all constraints in the tree. It writes Cartfile.resolved.

So, if you're updating to newer dependencies, or you've edited your Cartfile, use update. If you've just checked out your project and want the dependencies as specified in the commit you're on, use bootstrap.

Awesome! Thank you for the clear explanation.

If I edit the Cartfile and simply add a new dependency, is there anyway to get just that new dependency to build? I'm working on my first app that's using Carthage and have about 10 dependencies now so updates are taking a bit of time for each of my frameworks that I port over to Carthage and add to the app.

There's currently no way to do that. I'd really like one, and I think lots pf people would. I believe the issue is the resolver algorithm expects to be able to find candidates for all of the dependencies when there are conflicts. And maybe there were concerns about adding complexity to that early on.

I would love to see a carthage update <dependency_name> command, which builds on the existing graph or errors. I haven't had the time to keep up with current issues, so I don't know what the current thinking about that is.

If I edit the Cartfile and simply add a new dependency, is there anyway to get just that new dependency to build?

Not yet. That's captured in #218 and #610.

Thanks a lot for clear explanation.

Was this page helpful?
0 / 5 - 0 ratings