-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Add Support for Build Carbon Resources Build Phase #196
Conversation
@@ -40,6 +40,7 @@ final class PBXProjEncoder { | |||
write(section: "PBXLegacyTarget", proj: proj, object: proj.objects.legacyTargets) | |||
write(section: "PBXProject", proj: proj, object: proj.objects.projects) | |||
write(section: "PBXResourcesBuildPhase", proj: proj, object: proj.objects.resourcesBuildPhases) | |||
write(section: "PBXRezBuildPhase", proj: proj, object: proj.objects.carbonResourcesBuildPhases) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified Xcode writes the PBXRezBuildPhase section between PBXResourcesBuildPhase and PBXShellScriptBuildPhase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
b6a9fcd
to
fb7c56b
Compare
Generated by 🚫 Danger |
/// This is the element for the Build Carbon Resources build phase. | ||
final public class PBXRezBuildPhase: PBXBuildPhase { | ||
|
||
public override var buildPhase: BuildPhase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's a problem with how GitHub is representing the code here but it looks like the indentation of this property is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops. Had some tabs in there. Fixed. Nice catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment. I think this is the first time I hear about Build Carbon Resources
.
Some macOS apps still build legacy Carbon resources. Fortunately the Xcode project file models this in the same way as the abstract PBXBuildPhase so implementation of the build phase is as easy as adding a subclass, updating the BuildPhase enum, updating PBXProj, and adding decoding/encoding support. In addition to updating the tests, verified xcproj correctly round trips a project with this build phase.
fb7c56b
to
6167d59
Compare
@pepibumur I'm not able to figure out the Danger error for the PR. The Travis build log didn't seem to contain any error information. I tried running danger locally (e.g.
4 times. I didn't remove any text and there's not enough context to identify the first, though as far as I can tell the changelog follows existing conventions. Any pointers on how to debug and fix this? Thanks! |
@briantkelley I'm not sure about your local errors, but the danger bot posted in this PR with the changes that need to happen. Have you run |
Sorry @briantkelley, I see you've already committed the Carthage changes |
Unsurprisingly #197 is failing with presumably the same error. The build and tests passed and I did fix the original Danger error. Do you think the Danger PR error is ignorable and this is safe to merge? |
Merging this even though the tests failed, as pretty sure it's because of a messed up CI config |
Short description 📝
Some macOS apps still build legacy Carbon resources, which xcproj didn't support.
Solution 📦
The Xcode project file models this in the same way as the abstract
PBXBuildPhase
, so implementation of this build phase is as easy as adding and wiring up a trivial subclass.Implementation 👩💻👨💻
BuildPhase
with the comment used in the pbxproj filePBXBuildPhase
with theisa
name used in the pbxproj filePBXObject
PBXProj.Objects
, add decoding support, update thebuildPhases
computed property, and update the equality operator.PBXProjEncoder
andPBXProjObjects+Helpers.swift
PBXRezBuildPhase
in the same location in the project file with the same information.This change is