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

Fix target attribute optionality #519

Merged
merged 3 commits into from
Feb 2, 2020
Merged

Fix target attribute optionality #519

merged 3 commits into from
Feb 2, 2020

Conversation

yonaskolb
Copy link
Collaborator

#517 made a breaking change to make targetAttributes optional.

This PR fixes:

  • project equality always returning false if targetAttributes were optional
  • makes targetAttributes non optional, as they are always set in both the initializers. The attributes are always still written which solves the aim of Make target attributes optional #517

@github-actions
Copy link

github-actions bot commented Feb 1, 2020

@yonaskolb your pull request is missing a changelog!

guard let targetAttributeReferences = targetAttributeReferences,
let rhsTargetAttributeReferences = rhs.targetAttributeReferences,
NSDictionary(dictionary: targetAttributeReferences).isEqual(to: rhsTargetAttributeReferences) else { return false }
if !NSDictionary(dictionary: targetAttributeReferences).isEqual(to: rhs.targetAttributeReferences) { return false }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixes incorrect case were both were nil

@pepicrft
Copy link
Contributor

pepicrft commented Feb 2, 2020

project equality always returning false if targetAttributes were optional

Awesome! Thanks for tackling this.

makes targetAttributes non optional, as they are always set in both the initializers. The attributes are always still written which solves the aim of #517

The rule we have been following to decide whether an attribute should be or not optional is that the attribute should be optional if Xcode is able to open a project with the attribute not define. That's the case for targetAttributes and therefore should remain as optional. It's an unfortunate breaking change.

@yonaskolb
Copy link
Collaborator Author

The rule we have been following to decide whether an attribute should be or not optional is that the attribute should be optional if Xcode is able to open a project with the attribute not define. That's the case for targetAttributes and therefore should remain as optional. It's an unfortunate breaking change.

As per #517 though, this property is always written so that Fastlane can open it. There's no room for it to be optional

@pepicrft
Copy link
Contributor

pepicrft commented Feb 2, 2020

As per #517 though, this property is always written so that Fastlane can open it. There's no room for it to be optional

Although I disagree with going down that path, it's not a big deal so let's merge this and revisit it before the next major version to avoid breaking changes.

@pepicrft
Copy link
Contributor

pepicrft commented Feb 2, 2020

I'll release a new version right after the merge

@yonaskolb
Copy link
Collaborator Author

Thank you @pepibumur! :)

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

2 participants