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

Select suitable configs for auto-generated schemes #673

Merged
merged 8 commits into from Oct 6, 2019

Conversation

giginet
Copy link
Collaborator

@giginet giginet commented Oct 2, 2019

Motivation and Context

In a situation, there is the following project definition.

name: MyApp
configs:
  Beta: debug
  Debug: debug
  Production: release
  Release: release
targets:
  MyFramework:
    type: framework
    platform: iOS
    sources: MyFramework
    scheme:
      testTargets:
        - MyFrameworkTests
  MyFrameworkTests:
    type: bundle.unit-test
    platform: iOS
    sources: MyFrameworkTests

Auto-generated schemes select Beta as debug config and Production as release config.
Because there are prior ones by alphabetical order.

Screen Shot 2019-10-03 at 0 19 24

However, we'll expect they select Debug and Release configuration.
This behavior seems to be ambigious.

Description

This PR make to use Debug and Release piror to first ones.

And I added test cases for SchemeGenerator.

Before After
Screen Shot 2019-10-03 at 0 19 24 Screen Shot 2019-10-03 at 0 19 59

@giginet giginet changed the title Select suitable configs for autogenerated schemes Select suitable configs for auto-generated schemes Oct 2, 2019
@yonaskolb yonaskolb merged commit c46022c into yonaskolb:master Oct 6, 2019
@yonaskolb
Copy link
Owner

Thanks @giginet!

@giginet giginet deleted the improve-default-config-selector branch October 8, 2019 13:05
@philippelatulippe
Copy link

Hi! Is there a way to disable this change, or to explicitly state which build configuration I want to use for a target's generated change? My "Release" targets used the build configuration "AdHoc", but with this change they suddenly started using the wrong build configuration.

I understand that it's just by luck of alphabetical sorting that it worked in the past, but now I can't find a way to set the build configuration of the convenience target scheme.

@giginet
Copy link
Collaborator Author

giginet commented Oct 14, 2019

@philippelatulippe Hi ✋

I think you're better to specify configurations expressly on project scheme section.
https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md#scheme

schemes:
  Release:
    build:
      targets:
        Release: all
    archive:
      config: AdHoc

@giginet
Copy link
Collaborator Author

giginet commented Oct 14, 2019

Your previous usage may be a bit fragile.

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 this pull request may close these issues.

None yet

3 participants