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

Use (null) in comment when PBXBuildFile.name == nil #203

Merged
merged 2 commits into from
Dec 23, 2017

Conversation

briantkelley
Copy link
Contributor

@briantkelley briantkelley commented Dec 23, 2017

Short description 📝

When a PBXBuildFile is missing the name property, xcproj doesn't emit a comment for the encoding of the object or references to it. Xcode emites the string "(null)".

Solution 📦

Update the comment generation of PBXBuildFile and comment generation in PBXBuildPhase to use the string "(null)" when the PBXProj.Objects.fileName(buildFileReference:) return nil.


This change is Reviewable

When generating the comment for a PBXBuildFile or reference to a PBXBuildFile that doesn't have the name property set, Xcode emits the string "(null)" in lieu of an actual name. Update xcproj to match the behavior so it can roundtrip files without noise.
@yonaskolb
Copy link
Collaborator

That's pretty funny. Does Xcode actually go so far as to rewrite a missing comment as (null) when a project is opened?

@keith
Copy link
Contributor

keith commented Dec 23, 2017

It does 🙃

@yonaskolb
Copy link
Collaborator

Ok cool 🤷‍♂️

Feel free to merge. The downside of making people add their own changelogs is the merge conflicts...

@ghost
Copy link

ghost commented Dec 23, 2017

1 Error
🚫 Please rebase to get rid of the merge commits in this PR

Generated by 🚫 Danger

@yonaskolb
Copy link
Collaborator

To bad Shakira, Github's conflict resolver UI only does merge, not rebase. Squashing when merging this though 😉

@yonaskolb yonaskolb merged commit 259f667 into master Dec 23, 2017
@pepicrft pepicrft deleted the pbxbuildfile-null branch December 23, 2017 08:16
@pepicrft
Copy link
Contributor

Seriously? :trollface:, let's write "(null)" then. mmm interesting point about the CHANGELOG.md conflicts. Can't think of any way to solve that issue :/.

@yonaskolb
Copy link
Collaborator

Another way to manager the changelog is to have a release task write the list of merged PR's since the last version to the changelog automatically using the title, url and author 👍

@pepicrft
Copy link
Contributor

Yeah, I thought about that one @yonaskolb but then people would need to tag somehow the PRs to know the kind of change that they are introducing and use proper titles that very descriptive. I'll check how other open-source projects are doing it.

pepicrft pushed a commit that referenced this pull request Dec 26, 2017
When generating the comment for a PBXBuildFile or reference to a PBXBuildFile that doesn't have the name property set, Xcode emits the string "(null)" in lieu of an actual name. Update xcproj to match the behavior so it can roundtrip files without noise.
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.

4 participants