Carthage: carthage bootstrap should install new/missing dependencies

Created on 18 Feb 2015  路  8Comments  路  Source: Carthage/Carthage

Example case: add a new framework without bumping existing dependencies
Currently, carthage bootstrap won't install the new framework. While carthage update will bump other frameworks.

Or I have to add the new framework to both Cartfile and Cartfile.resolved manually.

Related: #218

enhancement

All 8 comments

Hmm, maybe we could revive the carthage add idea for this.

I don't think this responsibility belongs to the bootstrap command, because part of the point is that it shouldn't modify an existing Cartfile.resolved.

In cocoapods, it is pod install.
Yes, we can add a new command for this. Should I try to implement it?

:+1: @l4u

I'm not sure if this helps the discussion but I ended up creating a Run Script before Compilation phase in XCode that simply checks a few points. I also exclude the mentioned Carthage/.Cartfile.resolved file from my repo via my .gitignore file. Conditions the script checks:

  1. If Carthage/Build directory exists
  2. If the file Carthage/.Cartfile.resolved exists
  3. If the files Cartfile.resolved and Carthage/.Cartfile.resolved don't differ

If any of these points 'fail' the script will run carthage bootstrap --platform iOS (I'm on an iOS project) and then copy the produced Cartfile.resolved into the directory in point 2. This provides a seamless approach for any collaborators in the future who pick up commits based on dependency changes.

Maybe you can get some ideas out of it. Ideally, it would be nice if carthage bootstrap was smart in a way where it can detect diffs between what's currently pulled and built vs. what's in the .resolved file, much like how Cocoapods install is I think.

Gist of script: https://gist.github.com/aavina/240e8e052558349625ee9e1c82f96422

@aavina I think you're talking about something else. This issue is about the case where you add a _new_ dependency to your Cartfile, but don't want to run carthage update because it will affect the others鈥攊n that case, carthage bootstrap will not pick up your new dependency.

@jspahrsummers Ah good point, my mistake. Doesn't the Cartfile "Version Requirement" feature cover this use case?

Yeah, dependencies could be pinned to very specific versions to avoid that, but that's still a change that the user would have to put into their Cartfile. 鈽猴笍

@aavina It looks like this issue is closer to (though still not exactly the same as) what you were suggesting: https://github.com/Carthage/Carthage/issues/218

This could be now achieved by carthage update NewDependency (#972).

Was this page helpful?
0 / 5 - 0 ratings