Carthage: Build modified library

Created on 9 Jan 2019  Ā·  7Comments  Ā·  Source: Carthage/Carthage

Hi there,

I have a situation with a library we are using for a project. The situation suggests we need to introduce a small modification which potentially would help mature the library.

My challenge: I would like to make a small change to the local source and have Carthage build that version without checking out any new/existing version.

Can I do this? How can I do this?

question

Most helpful comment

This will build iOS-Library with whatever changes you have committed to the repo on your desktop.

If you need to debug while you go then this is not the ideal way since you will have to commit every change.

Instead you need to create a workspace or drag into your existing project the project file of the dependency your are tying to debug and re-link the frameworks correctly (don’t forget to remove the library from carthage copy-frameworks)

All 7 comments

You can point Carthage to a local file path relative or absolute

Hi there,

I have this in my Cartfile:
git "/Users/.../Carthage⁩/Checkouts⁩/IOS-Library" "someVersion"

I'm using the following command:
carthage bootstrap --platform ios

I get this output:
A shell task (/usr/bin/env git fetch --prune --quiet /Users/.../Library refs/tags/:refs/tags/ +refs/heads/:refs/heads/ (launched in /Users/.../Library/Caches/org.carthage.CarthageKit/dependencies/IOS-Library)) failed with exit code 128:
fatal: '/Users/.../Carthage⁩/Checkouts⁩/IOS-Library' does not appear to be a git repository
fatal: Could not read from remote repository.

It would be great to understand exactly how I'm supposed to do this correctly.

Quoting the error you have reported:

fatal: '/Users/.../Carthage⁩/Checkouts⁩/IOS-Library' does not appear to be a git repository

Also you are referencing a project in carthage's own checkout folder which will not work.

Clone the project's git repo at, for example, /tmp/myRepo , make your changes, then point carthage to it in your Cartfile.

git "file:///tmp/myRepo"

This builds the original source without the changes?

Is this the correct command:
carthage bootstrap --platform ios

I cloned the repo to my desktop, modified the Cartfile to reflect the path:
git "file:///Users⁩/⁨.../Desktop⁩/IOS-Library"

This will build iOS-Library with whatever changes you have committed to the repo on your desktop.

If you need to debug while you go then this is not the ideal way since you will have to commit every change.

Instead you need to create a workspace or drag into your existing project the project file of the dependency your are tying to debug and re-link the frameworks correctly (don’t forget to remove the library from carthage copy-frameworks)

Thank you very much!

The solution was to build and include the library manually as the change we made was to illustrate the need for a small evolution of the library. A change which would never be merged into any remote.

Was this page helpful?
0 / 5 - 0 ratings