Carthage: Include Projects in the Same Repo

Created on 29 Jan 2015  ·  8Comments  ·  Source: Carthage/Carthage

We have a collection of Xcode projects that are required to be in the same repo. We'd like to be able to use Carthage to manage the build dependencies despite this. Our ideal scenario would likely be a Cartfile with a list of the subprojects using a local path as the update configuration. Then, we can configure our workspace in a simple, linear manner.

Is there a simple way to support this. And if not, are there any pointers to be able to add this ourselves?

question

All 8 comments

Hmm, I'm having trouble understanding what problems you want to use Carthage for, if all of your dependencies are already in the same repository and versioned together. Carthage's main use case is _resolving dependency versions_ and downloading them for you, which doesn't seem necessary for your project.

Can you explain a bit more about what you're trying to do, and also why you're _required_ to have the projects in the same repository?

Right now, our current configuration is that we have an Xcode project with several subproject to build out it's dependencies. And each of those subproject also includes some subprojects. This patterns is fairly repetitive, and fragile. Especially since some of the leaf projects (ones without subproject) are used by several of the higher level projects. I guess what we'd like is the dependency management that carthage brings to the table with Project files so that we can chain the dependencies better. This would eliminate our need for this subproject within subproject madness while still maintaining up to date building of all our lower level frameworks. I realize that Carthage is intended to resolve remote dependencies, but I see that as a separate task as building those dependencies. I suppose we need the building part because we do also depend on some remote dependencies as well.

Carthage builds by simply invoking xcodebuild, so it wouldn't really result in a different build process than Xcode proper, if I'm understanding correctly.

If you mean you want to build binary frameworks like Carthage does, that logic is unfortunately pretty coupled to “flat” checkouts, and I don't think it would work with a custom directory structure.

Is there a particular reason that those subprojects can't be moved to different repositories? That would simplify things a lot, and make it easier to integrate Carthage (if that's what you want to do).

I'm with you on making our sub projects into separate repos. I've fought that battle and lost. Making Carthage work with our sub projects and directory structure is our next best alternative.

Sent from my iPhone

On Jan 29, 2015, at 3:12 PM, Justin Spahr-Summers [email protected] wrote:

Carthage builds by simply invoking xcodebuild, so it wouldn't really result in a different build process than Xcode proper, if I'm understanding correctly.

If you mean you want to build binary frameworks like Carthage does, that logic is unfortunately pretty coupled to “flat” checkouts, and I don't think it would work with a custom directory structure.

Is there a particular reason that those subprojects can't be moved to different repositories? That would simplify things a lot, and make it easier to integrate Carthage (if that's what you want to do).


Reply to this email directly or view it on GitHub.

Making Carthage work with our sub projects and directory structure is our next best alternative.

Unfortunately, I think it would add a lot of complexity to handle this particular use case. We try to stay away from supporting one-off scenarios and configurations in the interests of simplicity, and this doesn't seem like something that would benefit many other users of Carthage. :confused:

You may still be able to use carthage build to great effect, but I wouldn't expect the checkout/update/bootstrap bits to work automatically. Alternatively, you could maybe jury-rig something up with CarthageKit that does exactly what you need.

Sorry about the trouble! :frowning:

While I agree this is a one off deal, I guess my question was more geared toward "Are there any hints you can point us to so we can make this happen ourselves?" We're pretty sure this is something that carthage wasn't intended to do, but since the source is there, we though we'd fork away. What are the things we'd need to do to add, say a new supported Cartfile line type, for example:

project "./subfolder/MySubProject.xcodeproj"

If your source control setup is mono-repo what you want is probably a build tool along the lines of cmake / gyp / buck to generate your project files and build them, not a dependency manager.

What are the things we'd need to do to add, say a new supported Cartfile line type

I'm afraid this sort of stuff is part of some hand-rolled NSScanner parsing right now. See Cartfile.swift.

Was this page helpful?
0 / 5 - 0 ratings