( #1514 remastered )
I develop a framework with only one dependency.
podspec configured well. Everything works.
One dependency.
Now I am trying to add Carthage support.
Top folder of the project contains Cartfile with dependency: github name/name
Build this framework by carthage.
And fails, of course, because framework doesn't know where is the library at carthage update phase.
How it should be configured?
Does it need special folder/project file for dependencies?
Update:
With podspec and Podfile you can convert dependency to framework.
It builds dependency tree.
Carthage build frameworks separately, it looks into dependency tree and fetch frameworks, It doesn't bother about dependencies, only about their existence in build directory. Plain structure?
However, how could be one dependency added as dependency ( framework, of course ) to a project which is a bigger framework?
Your framework can add Carthage/Build/<platform> to the framework search paths so that Xcode can find it. Or you can use Carthage's --use-submodules option to add your dependency as a submodule and then configure Xcode to use the dependency's Xcode project file.
@mdiep
it's clear now, thanks!
It could be necessary to update Readme with this information ( Framework Search Paths option is omitted in it ).
I can't git it to work with an external framework. Any help is appreciated I have added Carthage/Build/ to the framework search path. But is this relative to the project directory?
@doozMen: It seems Carthage adds aliases so that the paths are resolved through aliases (folder shortcuts)
@mdiep Are there any examples of using Carthage/Build/<platform> online? I keep getting: error: no such module if I try to nest frameworks when using Carthage.
I think Argo does things that way.
@mdiep So while trying Argo with carthage update. It also started to clone and build Runes. Is this because the Argo repo has a Cartfile with Runes in it? Sorry to have to ask such obvious questions, but there is very little info on Carthage + nested frameworks.
That means that Runes is set up as a submodule.
@mdiep Any examples of using Carthage + "framework nesting" not using submodules? If not is there a way to force carthage build to build in the order inside the Cartfile. As oppose to how it builds now in "ascending-alphabetic-order". If I could build the child .framework before the parent .framework I would be home free.
I've outlined 4 workflows concerning using Carthage in conjunction with nested frameworks:
http://stylekit.org/blog/2017/02/03/Carthage-and-nested-frameworks/
What do you think @mdiep ? Am I doing it right? Other options?
I don't know why you'd every do _The Manual workflow_.
And I like using submodules, so I definitely wouldn't say that you shouldn't. ☺️
@mdiep When researching the concept: "Carthage framework nesting" I came across this: https://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/
But it's a personal preference. Since projects such as AlamoFireObjectMapper project do use submodules in conjunction with Carthage framework nesting. To each their own.
"The manual workflow" is written down for debugging purposes? It was the first solution i figured out how to use so for completeness and a warning to future on-lookers to not try it.
@eonist Your blog seems to be no longer online (broken link). Is there anywhere else where I can read that post of yours?
@nicolas-miari Jupp: eon.codes
@eonist Thanks, your whole blog looks very interesting, I will bookmark it.
I'm not having luck with your automatic workflow, unfortunately. If you are interested, I put some comments on the (closed) issue #415.
Thanks. My init thought would be to make a simple demo. With demo code only. Then trickle in more complex dependencies.
@eonist That's exactly what I did; I made a minimally reproducible example and right now I'm looking into it to see if I figure out what's going on (also re-reading the Carthage docs to see if I'm doing something essentially wrong)...
Learning curve for Carthage is too high. I bet SPM will get iOS support this wwdc.
@eonist
Maybe so (haven't used SPM yet, because iOS), but I remember getting the basic functionality up and running very quickly and painlessly; no "podfile.lock is out of sync" BS. I want to really commend everyone involved in this great piece of software.
I do somewhat look forward to a truly first-party solution though.
My only problem is that, even though I've been using Xcode since 2009, I still find all the various build settings/search paths, etc. quite arcane and obscure (not Carthage's fault at all). Never really tried to learn those, nor knew where to start.
By the way, I got it working thanks to @ikesyo (see my posts on #415).
Sorry for hijacking the thread!
“Encyclopedia of obscure search paths” sigh btw there is always swift-Lang.slack.com
Most helpful comment
I can't git it to work with an external framework. Any help is appreciated I have added Carthage/Build/ to the framework search path. But is this relative to the project directory?