Sal Aldana
Sal Aldana

Reputation: 1235

Update File Target Membership in Post Install Script or Build Phase

I have this weird issue that I'm getting after the pod install finishes where a handful of files are missing 1 Target Membership check. I'm trying to figure out if there's a way to add a target membership to a file via the post install script or within a Xcodes build phase scripts. Below is a sudo code idea that I have for the post install option.

all_files = installer.pods_project.files 
all_files.each do |fileref|
  if fileref.path.end_with? ".xyz" and fileref.target_membership includes?('FrameworkA') 
and unless fileref_target_membership includes? ('FrameworkB')
    fileref.add_target_membership('FrameworkB')
  end 
end

Upvotes: 0

Views: 35

Answers (0)

Related Questions