Skip to content

Bugfix: settings override on occasion (v. 2.14.0) #812

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tralf
Copy link

@tralf tralf commented Mar 21, 2020

Problem
On our project we have to use build configurations with prefixed names (e. g. Test and ABTest), and it leads to a situation, when ABTest build settings are overridden with Test ones.

Solution
Updated getBuildSettings function of Project to take this edge case into consideration.

Unit testing note
As getBuildSettings result depends on settings.configSettings enumeration order, which is undefined, sometimes this function works correctly even without a provided fix. So, added unit test case may not fail on old implementation from time to time.

@@ -81,7 +81,7 @@ extension Project {
buildSettings += settings.buildSettings

for (configVariant, settings) in settings.configSettings {
let isPartialMatch = config.name.lowercased().contains(configVariant.lowercased())
let isPartialMatch = config.name.lowercased().split(separator: " ").contains(Substring(configVariant.lowercased()))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see this would be a breaking change, as putting stag for Staging Release would now fail, as this is now matching whole words instead of any substring.
We could change this so it finds a config in the following order:

  • an exact match
  • matching a word (space delimited)
  • any substring

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got your point, thank you! I'll update the fix and add extra tests to cover this scenario as soon as have time.

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