CocoaPods / CocoaPods/Xcodeproj

build_phase.rb is missing a PBXAppleScriptBuildPhase class (unknown ISA for AppleScript build phases)

Open Beginner friendly
#1,048 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
2.4k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

### Summary

`lib/xcodeproj/project/object/build_phase.rb` defines classes for the standard
build-phase ISAs — `PBXHeadersBuildPhase`, `PBXSourcesBuildPhase`,
`PBXFrameworksBuildPhase`, `PBXResourcesBuildPhase`, `PBXCopyFilesBuildPhase`,
`PBXShellScriptBuildPhase`, `PBXRezBuildPhase` — but there is no
`PBXAppleScriptBuildPhase`.

Xcode does emit `PBXAppleScriptBuildPhase` objects (targets that compile/run
AppleScript). Because the class is absent, xcodeproj cannot represent this
build phase, and opening or re-saving any `.pbxproj` that contains one is
unreliable.

### Expected

`PBXAppleScriptBuildPhase` is a first-class `AbstractBuildPhase` subclass, so
projects containing AppleScript build phases round-trip cleanly.

### Actual

The ISA is unknown to xcodeproj. Consumers have to monkey-patch the gem after
every install/update to add the class, e.g.:

class PBXAppleScriptBuildPhase < AbstractBuildPhase
attribute :contextName, String, ''
attribute :isSharedContext, String, '0'
end

### Suggested fix

Add a `PBXAppleScriptBuildPhase < AbstractBuildPhase` class to
`build_phase.rb` with its `contextName` and `isSharedContext` string
attributes, alongside the other phase classes.

### Environment

- xcodeproj: 1.28.1
- Ruby: 2.6.0 (system Ruby, macOS)

Contributor guide

No contributing guide indexed for this repository

Research direction

Read lib/xcodeproj/project/object/build_phase.rb and compare the existing build-phase classes. Add the missing AppleScript build-phase definition with the attributes named in the issue, then verify that a project containing PBXAppleScriptBuildPhase can be opened and re-saved without the ISA being unknown.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.