Repository navigation
Add ability to use multiple groups for local Swift Package #1118
Description
Activity
@yonaskolb, Hi! Is this a desired feature? I think I could help and make a PR if you don't mind. I kind of need that too now :)
Reacted by timkulikov-weatherwell and Nayanda HabertyReacted by timkulikov-weatherwellI'm not sure what you mean. Do you mean the
Package Dependenciessection in the navigator? Xcode automatically builds that from your list of resolved Swift packages. Is there a way to do what you're doing without XcodeGen?As I understand, it's about the
Packagesfolder on the top controlled bylocalPackagesGroup. It can only be flat for now, but it would be nice to have the ability to parse and preserve a hierarchy of folders if needed. When you have a lot of local packages, it seems useful.And when I define the package dependency from path it will create intermediate folders for me
packages: AlamofireNetworkClient: path: Packages/AlamofireNetworkClient AppEnvironment: path: Packages/Group2/AppEnvironment ...
Something like:
Reacted by Nayanda Haberty, John Connolly, Martin Pfundmair and Ibrahim MostafaExactly
@hainayanda have you tried setting the group via the optional parameter added in #1175?
You might be able to do something like
packages: AlamofireNetworkClient: path: Packages/AlamofireNetworkClient group: Packages/Group1 AppEnvironment: path: Packages/Group2/AppEnvironment group: Packages/Group2 ...
See documentation.
Sorry, but it's not working for me. When I set the package like
packages: AppFeature: path: Packages/Features/AppFeature group: Features/AppFeatureor
packages: AppFeature: path: Packages/Features/AppFeature group: Featuresor
packages: AppFeature: path: Packages/Features/AppFeature group: Packages/Featuresand regenerating the project, the groups are not created, and the package is absent. @John-Connolly, could you please guide me on how to use the configuration? I have
createIntermediateGroupsset totrueon the root level, spec validation doesn't find any mistakes@hainayanda have you tried setting the group via the optional parameter added in #1175?
You could do something like
packages: AlamofireNetworkClient: path: Packages/AlamofireNetworkClient group: Packages/Group1 AppEnvironment: path: Packages/Group2/AppEnvironment group: Packages/Group2 ...
See documentation.
Already tried that, but it does not work if the group is logical. Is that intentional by design?
Hi @hainayanda Did you find a solution ?
Hi @himammz it's working, but with some limitations as I mentioned before, it will not work if you want the group to be logical.

By default, any Swift Package added via xcodegen will be populated into one group named "Packages". It's not always ideal since in my case, I have 2 groups of packages:
Using the current xcodegen will put all the packages in the same group and will create confusion for my team. I am using git modules because I need to have access to shared packages and the ability to fix and update them right away instead of updating via Swift Package Manager manually.
Can xcodegen have the ability to configure multiple groups for packages instead of using the default Packages group?