Skip to content

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

Description

@jn-nyc

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions