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 project with sub-projects #570

Closed
carterbitrix opened this issue Apr 18, 2019 · 6 comments · Fixed by #701
Closed

Generate project with sub-projects #570

carterbitrix opened this issue Apr 18, 2019 · 6 comments · Fixed by #701

Comments

@carterbitrix
Copy link

Is there way to generate project with sub-projects?

My frameworks builds in separate projects and I want to use them as dependencies in project which is generated by xcodegen

@dpfannenstiel
Copy link

Could you be a bit more descriptive? I'm successfully using xcodegen to build multiple projects that have responsibility to build multiple frameworks, executables, and test targets. All wrapped within a workspace.

@brennanMKE
Copy link

I am interested in this as well. The way Xcode does source dependencies is to have an Xcode project referenced in another Xcode project. I do not see support to do this with XcodeGen, unless I am just not finding it. I would need to also add a target from the sub-project as a Target Dependency so it builds before the project referencing it. This would put the build product in the same BUILT_PRODUCTS_DIR so that when it is needed it is there.

So far the examples I see are pre-built framework references like is done with Carthage.

@brennanMKE
Copy link

Btw, if this functionality is not built into XcodeGen, I'd be happy to work on it. I may need some pointers along the way. What I would do is generate a project and a sub-project with a separate project.yml and commit them to a local git repo. Then manually add the sub-project so that I can see the difference and work how how to do it with XcodeGen.

@toshi0383
Copy link
Collaborator

Looks similar to this issue.
#224

@yonaskolb
Copy link
Owner

Does the solution in #224 work? Create a workspace and use implicit? Is it required that there are specifically sub projects as opposed to sibling projects in a workspace?

@brennanMKE
Copy link

That won't work for me unfortunately due to how we have dependencies and transitive dependencies. It will work for the direct dependencies, but will not work for more complex package configurations. I've been given the green light to work on this update alongside my regular sprint tasks, so I will be figuring this out. I'll use the sample project below as a reference for how to add a group and project reference.

Ideally the changes to project.yml would be simple and logical. I'd like to place all dependencies into a group and then add the project references to that group and then the target dependencies. It may also be necessary to handle embedding, linking as well as copying headers depending on how the dependency is packaged. It may be a dynamic framework or a static library. My preference would be to handle it the same way Swift PM does it which I believe is static. Before I get that far I will need to prototype some options and collect commits that I can reference.

https://github.com/brennanMKE/AtomicXcodeGenSample

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.

5 participants