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 handling of SWIFT_INSTALL_OBJC_HEADER when its value is YES/NO. #827

Merged
merged 3 commits into from
Apr 15, 2020

Conversation

ileitch
Copy link
Contributor

@ileitch ileitch commented Apr 8, 2020

I'm not sure if true/false literals are valid values for xcconfig, but I guess we'll need to continue supporting it for backwards compatibility.

For reference: #805
/cc @kateinoigakukun

@kateinoigakukun
Copy link
Collaborator

Thanks. @yonaskolb Do you think we need to keep true/false literal compatibility that is invalid value on Xcode?

@ileitch ileitch force-pushed the fix-SWIFT_INSTALL_OBJC_HEADER branch from 3c27dc1 to 8b24d99 Compare April 10, 2020 09:11
Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

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

Thanks @ileitch!
Yeah we probably don't need to maintain compatibility with true/false for this one specific case. Having said that it might be useful to have a wrapper around getCombinedBuildSetting called getBoolBuildSetting which checks for YES/NO and true/false. That could be used here if you'd like to add it @ileitch

let swiftInstallObjCHeader = project.getCombinedBuildSetting("SWIFT_INSTALL_OBJC_HEADER", target: target, config: project.configs[0]) as? Bool
let swiftInstallObjCHeaderValue = project.getCombinedBuildSetting("SWIFT_INSTALL_OBJC_HEADER", target: target, config: project.configs[0])

var swiftInstallObjCHeader = true // Xcode default
Copy link
Owner

Choose a reason for hiding this comment

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

Now that this is a non optional, can we update the confusing line below

&& swiftInstallObjCHeader != false

to just:

&& swiftInstallObjCHeader

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

@ileitch ileitch force-pushed the fix-SWIFT_INSTALL_OBJC_HEADER branch from 8b24d99 to c3ecf4a Compare April 13, 2020 15:38
Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

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

Fantastic, thanks @ikesyo!

@yonaskolb yonaskolb merged commit 4ae0845 into yonaskolb:master Apr 15, 2020
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.

3 participants