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

Prefer default Debug and Release configs #752

Merged
merged 2 commits into from
Jan 15, 2020

Conversation

john-flanagan
Copy link
Contributor

The default schemes generated for a target is using the suitableConfig helper function to prefer configs named "Debug" or "Release" over the alphabetically first scheme of the matching type:

let debugConfig = suitableConfig(for: .debug, in: project)
let releaseConfig = suitableConfig(for: .release, in: project)

but generateScheme(_: Scheme) was using the computed default<ConfigType>Config properties which only took into account the sorting order for top level schemes.

let archiveAction = XCScheme.ArchiveAction(
buildConfiguration: scheme.archive?.config ?? defaultReleaseConfig.name,
revealArchiveInOrganizer: scheme.archive?.revealArchiveInOrganizer ?? true,
customArchiveName: scheme.archive?.customArchiveName,
preActions: scheme.archive?.preActions.map(getExecutionAction) ?? [],
postActions: scheme.archive?.postActions.map(getExecutionAction) ?? []
)

This change uses the same suitableConfig function to back the default<ConfigType>Config properties so that top level schemes and target schemes will have the same default config behavior.

@yonaskolb
Copy link
Owner

Great, thanks @john-flanagan! Could you please add a changelog entry as well

@yonaskolb yonaskolb merged commit e0a8068 into yonaskolb:master Jan 15, 2020
@john-flanagan john-flanagan deleted the better-default-config branch January 15, 2020 16:25
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.

2 participants