Skip to content

Instantly share code, notes, and snippets.

@dodikk
Created March 13, 2017 10:56
Show Gist options
  • Save dodikk/d926538f8af322a49aa589e641824da7 to your computer and use it in GitHub Desktop.
Save dodikk/d926538f8af322a49aa589e641824da7 to your computer and use it in GitHub Desktop.
Carthage Time Workaround

Carthage/Carthage#342

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:

If Carthage/Build directory exists
If the file Carthage/.Cartfile.resolved exists
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
@dodikk
Copy link
Author

dodikk commented Mar 13, 2017

Carthage has --cache-builds flag. Still, there are some issues with it.

Carthage/Carthage#1800

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