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

Generate from Swift PM Package #196

Closed
yonaskolb opened this issue Dec 20, 2017 · 8 comments
Closed

Generate from Swift PM Package #196

yonaskolb opened this issue Dec 20, 2017 · 8 comments
Labels

Comments

@yonaskolb
Copy link
Owner

This would allow SwiftPM to be used as a dependency manager, but allow XcodeGen to generate the project. This means you can use your own build settings, and also allows for iOS development via Swift PM

@pepicrft
Copy link

This is a great idea! Would you then parse the Package.swift and figure out how the Xcode projects for the dependencies should be? @yonaskolb

@yonaskolb
Copy link
Owner Author

I think there are a few options:

  1. specify swiftPM dependency type, and then link dependencies from:
    • an existing Package.swift
    • a Package.swift we generate
  2. generate directly from an existing Package.swift file and provide some command line options
  3. add some sort of package option in the project spec which then generates the target specs from that, and lets you override settings
  4. create a new sort of spec file that provides overrides (mostly build settings) for an existing Package.swift file
  5. probably some other solutions I haven't thought of

@yonaskolb
Copy link
Owner Author

yonaskolb commented Dec 20, 2017

It's basically a question of where the source of truth should be. Considering that Swift PM is the future, I would say there. Hopefully Swift PM finally gets to a point that it can remove the need for XcodeGen, thought it might be a few years till it supports everything we do.

@LinusU
Copy link
Contributor

LinusU commented Mar 8, 2018

This would be amazing 😍

There is currently a way to use SPM to handle dependencies for iOS app. Basically you set up a subproject that builds all the deps, and then embed that project in the main project. Here is a tutorial: http://www.ralfebert.de/ios-examples/xcode/ios-dependency-management-with-swift-package-manager/

It would be amazing if this project could use Package.swift as the source of truth, and then generate a project that is ready to use the dependencies.

Is there anything that I would be able to help with to move this forward?

@LinusU
Copy link
Contributor

LinusU commented Mar 9, 2018

The swift package manager is able to generate an Xcode project that builds .framework files from each dependency. It seems to add all of the source files in a "Dependencies" group (relevant code), and then create products for each framework (relevant code).

Would it be within the scope of this package to do something similar? Effectively allowing SwiftPM to be used for managing dependencies for an iOS app.

@danramteke
Copy link

Hello. Any updates on this? This would be pretty sweet.

My use case is: I have a server written in swift and an iOS app in the App Store. And the two share some code.

Currently, I have a local cocoapods podspec that points to several directories in my server code. But that doesn’t feel elegant.

@moppymopperson
Copy link

I'd really like to see this happen to. I'm interested in being able to generate a new iOS project from the command line.

@yonaskolb
Copy link
Owner Author

I feel this is adequately solved by #624

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

5 participants