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

Can't Add Local Swift Package as Dependency #721

Closed
jsorge opened this issue Nov 20, 2019 · 8 comments · Fixed by #796
Closed

Can't Add Local Swift Package as Dependency #721

jsorge opened this issue Nov 20, 2019 · 8 comments · Fixed by #796

Comments

@jsorge
Copy link
Contributor

jsorge commented Nov 20, 2019

Using Xcodegen v2.10.1 and adding a local Swift package to my project, and I want it to be a dependency for one of my targets. The following is not working for me:

name: MyApp
localPackages:
  - Modules/Utilities
packages:
  Pathos:
    from: 0.2.0
    url: https://github.com/dduan/Pathos.git
targets:
  MyApp:
    type: application
    platform: iOS
    sources:
      - MyApp/Sources
      - MyApp/Resources
    dependencies:
      - package: Utilities
    configFiles:
      Debug: xcconfigs/BindleWriter-Debug.xcconfig
      Release: xcconfigs/BindleWriter-Release.xcconfig

And the error I get is Spec validation error: Target "MyApp" has an invalid package dependency "Utilities". If I alter the dependency on Utilities to be on Pathos instead (which is a remote package) then the project generates just fine.

Am I holding it wrong?

@yonaskolb
Copy link
Owner

Hi @jsorge, currently local packages are only supported when they mirror remote packages. There is mention of that buried here https://github.com/yonaskolb/XcodeGen/blob/master/Docs/Usage.md

Additional work is required to support completely local packages

@jsorge
Copy link
Contributor Author

jsorge commented Nov 22, 2019

Ah that makes sense. I hadn't seen that note before. Thanks for letting me know.

@AV8R-
Copy link

AV8R- commented Nov 25, 2019

Hi @yonaskolb, what kind of additional work is required to make this feature work?
Actually I tried to remove any package validation form SpecValidation.swift (that was on line 168) and removed guard statement in PBXProjGenerator.swift on line 630.

And it works for me. Except I don't have any remote package validation for now.
What should I do additionally to make a pull request for this feature?

@WilliamIzzo83
Copy link

Hi everybody

I'm kinda interested too. Are there any news about this?

@freddi-kit
Copy link
Collaborator

I made a pull request and it would help this issue => #796

@WilliamIzzo83
Copy link

Great work guys. Thank you so much! Waiting for a new release :D

@freddi-kit
Copy link
Collaborator

freddi-kit commented Mar 25, 2020

Hello. v2.15.0 is released and we can use local Swift Package from now by following format.
Thank you all!

...
packages:
  MyLibrary: 
    path: Packages/MyLibrary
targets:
  GennedProj:
    ...
    dependencies:
      - package: MyLibrary

@ThePredators
Copy link

ThePredators commented May 30, 2023

Hello,

im under version 2.35.0 and unfortunately this doesn't work. Xcode find the packages as they are listed in project structure -> Packages, but i cannot import these dependencies !!

Any idea on how to resolve this ?

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

Successfully merging a pull request may close this issue.

6 participants