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 default shared schemes? #215

Open
yonaskolb opened this issue Dec 27, 2017 · 7 comments
Open

Generate default shared schemes? #215

yonaskolb opened this issue Dec 27, 2017 · 7 comments

Comments

@yonaskolb
Copy link
Owner

yonaskolb commented Dec 27, 2017

At the moment shared schemes are only generated if they are defined in target.scheme or schemes. 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.

targets:
  MyTarget:
    scheme: {}

This issue is highlighted here #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?

@pepicrft
Copy link

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.

@LinusU
Copy link
Contributor

LinusU commented Mar 12, 2018

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!

@LinusU
Copy link
Contributor

LinusU commented Mar 13, 2018

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

@toshi0383
Copy link
Collaborator

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).

@yonaskolb
Copy link
Owner Author

@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

@yonaskolb
Copy link
Owner Author

Perhaps an option called generateDefaultSchemes?

@pm-dev
Copy link

pm-dev commented May 24, 2024

@yonaskolb I'd like to be able to turn off the "Autocreate Schemes" option. (Also discussed here)
At the time this issue was opened, xcodeproj didn't support this, but it looks like it now does.

tuist/XcodeProj#399

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

No branches or pull requests

5 participants