Closed t-unit closed 8 years ago
It would be nice to support it, but it’s not something that’s come up as a request before. My guess is it’s most likely to happen as a result of someone contributing it as a PR. Want to do it? :)
I'll try to have a look into into.
Since Carthage depends on shared schemes, do you have special requirements (e.g. CI) for it?
WIP (not yet working) can found at https://github.com/tomco/couchbase-lite-ios
Just add new schemes instead of altering existing ones, as we use some of the existing ones on our Xcode build bot. It would help if the new schemes had "Carthage" in their names so we'll remember what they're for.
@snej It seems like we should be able to just mark the iOS framework scheme created in #597 as shared, no? It's serving the same purpose. Unfortunately, it doesn't seem to be building for me at the moment.
I was able to get this building with carthage simply by making the existing iOS framework schemes shared in CBL, BLIP, and CBForest. Only other thing I had to do was change the team in CBL to None so that signing worked properly. I'll submit PRs to BLIP and CBForest shortly...not sure how you'd want to handle pulling those in via submodule updates.
Cool! But I'd rather you created new schemes — give yours names with a "Carthage" prefix. The reason is that working on CBL when using a shared scheme is a pain, since any time you change things like command-line arguments or diagnostics it marks the scheme file as dirty, which makes looking at changes more difficult, and it's easy to accidentally check in the changes.
Sure. I was worried that creating another scheme would add to maintenance headache any time new build changes were needed and that the the chance of them getting our of sync in the future would increase. I imagine the majority of people integrating as a dynamic framework will likely be using Carthage to do it. However, if that's what you prefer I'm happy to duplicate the existing framework scheme and re-label with a Carthage prefix.
Why do you need to create schemes for CBForest and BLIP? All you should need is a scheme for CouchbaseLite, I would think...
That's what I thought too, but Carthage failed out saying it found no shared schemes in each of them when attempting to build. It appears that any schemes in sub-project dependencies must also be shared.
You can verify using this branch, where I've done things in separate commits: https://github.com/buzzfeed/couchbase-lite-ios/commits/feature/carthage
First running Carthage using the commit where I've only created a shared scheme in the CBL project and changed the team for the framework target to none.
Cartfile:
github "buzzfeed/couchbase-lite-ios" "30f9df20b23718e552b322b060332a11cbd45d3f"
Error:
Failed to discover shared schemes in project BLIP.xcodeproj—either the project does not have any shared schemes, or xcodebuild never returned
If you believe this to be a project configuration error, please file an issue with the maintainers at https://github.com/buzzfeed/couchbase-lite-ios/issues/new
Then using the commit after where I've also updated the submodules to point towards our forks where I've created shared schemes.
Cartfile:
github "buzzfeed/couchbase-lite-ios" "32a4e53ff61438a2f9b21485b22990f9d896f9a2"
The latter builds successfully. I haven't delved into the Carthage internals to see why exactly the sub-projects must also share their schemes.
Just an FYI, carthage does not support static libraries so this limits it to iOS 8+
This is using a new scheme so it's only an additional way to install the library that many devs are now using. Everything else is left as is. On Fri, Nov 13, 2015 at 7:47 PM Jim Borden notifications@github.com wrote:
Just an FYI, carthage does not support static libraries so this limits it to iOS 8+
— Reply to this email directly or view it on GitHub https://github.com/couchbase/couchbase-lite-ios/issues/928#issuecomment-156592157 .
@lordkev Thanks for the contribution -- I really need this too! Can you send a pull request for your changes?
@snej I caught up with @zgramana a bit this morning, and he mentioned you had some pushback about Carthage being able to only consume source code projects -- but it looks like that's not the case. From the Carthage README:
Carthage can automatically use prebuilt frameworks, instead of building from scratch, if they are attached to a GitHub Release on your project’s repository.
@tleyden The PRs for support have been open since the beginning of November.
@snej What's the reasoning on wanting to use a prebuilt framework for Carthage when there is already a dynamic framework target to build from source that's working properly? (If you indeed have pushback about it)
@lordkev ok the dependent PR's are merged, can you create another PR for the couchbase-lite-ios repo?
Couchbase generally prefers that people use the binaries we've built, which have already been QA'd and blessed. It just makes support simpler, ruling out problems caused by bad builds. But there's nothing wrong with people building their own if they'd rather.
Hopefully our Github Releases are packaged in a way that Carthage can easily consume.
Sure, I understand. Hmm...I swear I had opened one already. I'll create another real quick.
Github swears you didn't :P
Github never lies. :)
I remember now. I had only done it on our fork. I wanted to open a PR here but couldn't until the other PRs were merged.
Opened now ^^
@snej can this be merged?
Merged! Sorry for the delay, I just kept procrastinating… :-p
Seems like integrating couchbase lite using Carthage does not work at the moment.
Any change to support it in the future?