Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper for carthage related frameworks #488

Closed
yonaskolb opened this issue Jan 8, 2019 · 5 comments
Closed

Helper for carthage related frameworks #488

yonaskolb opened this issue Jan 8, 2019 · 5 comments
Labels

Comments

@yonaskolb
Copy link
Owner

yonaskolb commented Jan 8, 2019

This would add an option to a carthage dependency that would copy all of its related frameworks as well.
This is for some carthage dependencies that actually have multiple frameworks you need to embed.

For example https://github.com/DaveWoodCom/XCGLogger requires that you embed both XCGLogger and ObjcExceptionBridging.
XcodeGen could read the file in Carthage/Build/.XCGLogger.version to extract all the required build artifacts:

{
  "commitish" : "6.1.0",
  "iOS" : [
    {
      "name" : "ObjcExceptionBridging",
      "hash" : "582b2059fd03bce0a3d265aa19d12915182be37e77e5d8502973766c9867cd9e"
    },
    {
      "name" : "XCGLogger",
      "hash" : "0736e85cd58080ece86985b85acb4c53bade7b849543e6d3b178d65f894f97b6"
    }
  ]
}

This functionality could live behind a flag. Something like the following:

old:

targets:
  Target:
    dependencies:
      - carthage: XCGLogger
      - carthage: ObjcExceptionBridging

new:

targets:
  Target:
    dependencies:
      - carthage: XCGLogger
        includeRelated: true

This behaviour could even be made the default but it would be a breaking change as sometimes you don't want to embed all of a dependencies frameworks

@AlexisQapa
Copy link

Awesome ! +1 for it becoming the default as most of the time you want to embed those.
For example when migrating Cocoapods project you have to figure out which lib depend on what

@rpassis
Copy link
Contributor

rpassis commented Jan 26, 2019

@yonaskolb happy to take a stab at implementing this as it seems like it would be a useful feature.

@rpassis
Copy link
Contributor

rpassis commented Jan 26, 2019

After a quick glance there are a few different ways we can do this but it's mainly down to 2 choices:

  1. Include related dependencies during the parsing of the Target JSON/yaml file or;
  2. Add a includeRelated property to Dependency and work out the related dependencies while generating the project inside PBXProjGenerator

Option 1 is a lot simpler and cleaner but feels a bit wrong for some reason. We will have to reach into the Carthage build folder to get the .version file during parsing, process it and then add the related dependencies while building the Target.

Option 2 will likely require changing logic related to carthage dependencies in a few different places.

Keen to hear your thoughts on this.
Rog

@yonaskolb
Copy link
Owner Author

That would be great if you want to work on this @rpassis!
I would vote for option 2. We have more information at that point, are working with proper types and can access options (There could be a top level option to opt in or out, as well as the finer grained per dependency control that would override this).

@yonaskolb
Copy link
Owner Author

This was added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants