Open yonaskolb opened 6 years ago
Given that developers using XcodeGen will very likely not include the Xcode project in the repository, I'd default a shared scheme for each target. I think it's better than having to define an empty dictionary in the yaml. I can't think of a case where you don't want a shared scheme to be generated.
I would love to have XcodeGen generate shared schemes so that I can use it together with libraries installable via Carthage.
My plan is to have the project.yml
file committed, and then have a release process which would generate the Xcode config, commit it to a separate branch and tag the release. That way I would get all the benefits of not having Xcode-projects checked in, but it would still work together with Carthage!
If anyone else is interested in this, here is the project.yml
that I'm currently using: https://github.com/LinusU/BioPass/blob/acab045b72041dee3289830a6215f7ac9be8a479/project.yml
Xcode does not generate shared schemes automatically, so I think we should stick with that behavior.
Which schemes to generate is up to each member of the project, so I would add --shared-targets
option. (as mentioned in #57 )
xcodegen --shared-targets "App AppTests Lib LibTests"
This would generate additional xcscheme if ones are not specified in project.yml
.
This way one can generate missing xcschemes on the fly (e.g. on CI server).
@LinusU The spec you linked to has a scheme: {}
so will generate a shared scheme for your purposes.
@toshi0383 making it configurable via the command line is an interesting option, but I don't see any cases where you'd only sometimes want that, so it seems it's better to define it in the project.yml
Perhaps an option called generateDefaultSchemes
?
At the moment shared schemes are only generated if they are defined in
target.scheme
orschemes
. The problem is if someone wants to generate a simple shared scheme with no special options, the best way is to specify a target scheme with no options which looks a bit weird.This issue is highlighted here https://github.com/yonaskolb/XcodeGen/issues/57
When Xcode opens a project it creates default private schemes for each target if they don't exist already. What we could do is generate a default shared scheme for each target, possibly just app targets. You could still provide options for this via
target.scheme
, and if a top level scheme with the same name was created, it would override this default scheme. Possibly this could even live behind an option. Thoughts?