material-components-ios icon indicating copy to clipboard operation
material-components-ios copied to clipboard

Add Carthage support

Open jverkoey opened this issue 8 years ago • 40 comments

https://github.com/Carthage/Carthage

We should consider supporting this alongside CocoaPods.


Internal data

jverkoey avatar Feb 11 '16 17:02 jverkoey

Blocked on #841 so we can use dynamic frameworks.

ajsecord avatar Jan 03 '17 21:01 ajsecord

There are solid references on adding Carthage support in #1102.

ianegordon avatar May 12 '17 13:05 ianegordon

I don't want to look like the nagging type 😅 is this still in the roadmap?

sohayb avatar Jul 11 '17 01:07 sohayb

Hi @sohayb . We are still interested in supporting Carthage, but the last time we looked into it there was some functionality in our Cocoapods that was difficult to mimic in Carthage.

ianegordon avatar Feb 08 '18 19:02 ianegordon

@ianegordon curious to know what that functionality is.

AlexanderBollbach avatar May 15 '18 18:05 AlexanderBollbach

Hi @AlexanderBollbach thank you giving this issue a nudge. Unfortunately, we don't have currently have this on our immediate timeline. I'll raise this at our next planning meeting.

ianegordon avatar May 29 '18 21:05 ianegordon

@ianegordon Funny story: I asked about this specific issue when I attended Google I/O last month, someone at the code labs said you were there but I just missed you 😂 Thanks for bringing this issue at your planning meeting 🙌

sohayb avatar Jun 01 '18 04:06 sohayb

Hi @sohayb , I'm sorry to have missed you and for being so long since an update. I'd hoped to be able to share good news, but unfortunately we don't have this on our current roadmap. 😞

ianegordon avatar Aug 23 '18 21:08 ianegordon

The structure of our repo may be not be ideal for Carthage because we'd have to deploy a single .framework with all of our code in it (there's a lot of code). As a result, this likely isn't going to be an immediate priority for us unless there's a good proposal for a way to have each of the individual components be a separate Carthage dependency.

jverkoey avatar Aug 24 '18 01:08 jverkoey

Any workaround?

jbarros35 avatar Oct 09 '18 09:10 jbarros35

No workaround at present other than manually cloning the repository and adding it as a dependency via Xcode (similar to what Carthage would do).

jverkoey avatar Oct 09 '18 09:10 jverkoey

The structure of our repo may be not be ideal for Carthage because we'd have to deploy a single .framework with all of our code in it (there's a lot of code).

I don't understand this part. RxSwift has no issues deploying code from one repository in multiple frameworks. AFAIK it has nothing to do with repository structure, Carthage uses shared schemas and can build them all as separate build targets. So it's just a matter of Xcode Project setup.

lukas1 avatar Jan 08 '19 14:01 lukas1

+1 we also like to move from Cocoapods to Carthage.

"material-components" is one of the last few libs why we are still bound to Cococapods ;-)

awBSH avatar Feb 01 '19 12:02 awBSH

Bumping this up, it would be pretty good to get this support.

zaitsman avatar Mar 14 '19 03:03 zaitsman

I don't know much about Cocoapod and only ever used Carthage, but doesn't Cocoapod create XCode projects? Would it be possible to have a CI create an XCode project for each submodule, then push that somewhere else (material-components-ios-carthage or something) so that Carthage can import it? If that's possible, then it would not require any change to this repo and anyone could do it, but I guess it's not as it's not been done.

Ribesg avatar Mar 19 '19 15:03 Ribesg

Bumping up as well

doronkatz avatar Mar 20 '19 19:03 doronkatz

bump

ariantomichael avatar Mar 27 '19 09:03 ariantomichael

Carthage uses shared schemas and can build them all as separate build targets

Ah this is interesting. Is it possible to generate multiple libraries that will be resolved at link time with Carthage? This would let us deploy one Carthage binary for each subspec.

jverkoey avatar Mar 27 '19 12:03 jverkoey

Bumping this up as well.

nmartins avatar Mar 27 '19 15:03 nmartins

Is it possible to generate multiple libraries that will be resolved at link time with Carthage?

Not sure what this means. With Carthage, you can built multiple .framework files in one go. But this has nothing to do with linking. Carthage doesn't modify the XCode project of your app, so you have to link each dependency you need manually. Obviously, it is possible to link just the dependency that you need, even if Carthage will generate .framework files for multiple targets and you just need one. That has nothing to do with Carthage itself, it's as if those .framework files existed somehow on your filesystem already.

This would let us deploy one Carthage binary for each subspec.

Yes, Carthage does indeed allow you to deploy a binary for each schema. Important to note is, that it's not a Carthage binary. There's nothing special about these binaries that would tie them to Carthage. It's just a regular Swift .framework binary.

lukas1 avatar Apr 02 '19 08:04 lukas1

Thanks for the clarifications everyone. I believe then there are a couple levels to delivering support for this:

Level 1: Create a single Carthage-compatible .framework for MDC and upload it as part of our release process.

Level 2: Create individual Carthage-compatible .frameworks for each subspec in MDC, allowing a client to pick and use subsets of MDC as needed. These individual frameworks should be uploaded as part of our release process.

jverkoey avatar Apr 02 '19 08:04 jverkoey

bump

basicsbeauty avatar May 24 '19 02:05 basicsbeauty

Would be really interested in Carthage support as well.

odisei369 avatar Jun 06 '19 14:06 odisei369

bump

pabloviciano avatar Jul 02 '19 13:07 pabloviciano

Installation with Carthage

Create a new sample project (lets call it TestApp) and set it up with the following Podfile:

platform :ios, "10.0"
use_frameworks!

target 'TestApp' do
  pod 'MaterialComponents'
end

You must add use_frameworks! but can also install specific components rather than installing them all.

Run the app at least once then locate the project included frameworks. These will be in the Xcode Derived Data directory, a quick way to access them is by right clicking on the framework name under Products in Xcode Project Navigator and click Show in Finder.

If you install all the components, the following Material components will be installed:

- MaterialComponents.framework
- MDFIntertionalization.framework
- MDFTextAccessibility.framework
- MotionAnimator.framework
- MotionInterchange.framework
- MotionTransitioning.framework

Copy all these frameworks to the Carthage build directory of your actual project (e.g. Carthage/Build/iOS/....) and update the input list to Carthage copy-frameworks build step (it is better to use a tool like carting to perfrom this update).

Run your actual project and enjoy using Material Components.

abdulhaq-e avatar Jul 12 '19 16:07 abdulhaq-e

The internal issue b/117179591 is now closed. This issue is being closed as a result.

material-mirror avatar Jul 30 '19 16:07 material-mirror

Re-opening this due to community interest.

jverkoey avatar Jul 30 '19 16:07 jverkoey

Is there any progress or activity on this? Because I dont see anything.

zdnk avatar Aug 06 '19 09:08 zdnk

Any movement on carthage support?

cody1024d avatar Oct 26 '19 04:10 cody1024d

bump

loilee avatar Nov 01 '19 07:11 loilee