0

我想使用 ruby​​ 将“文件夹引用”添加到 PBXGroup。在 github.com/CocoaPods/Xcodeproj 中找不到解决方案

   file_path = File.join(to_folder, folder_to_fetch)
    file_reference = destination_group.new_file(file_path, :group)

    project.native_targets.each do |target|
#        ... ???
    end
4

1 回答 1

0

建立了一个解决方案——盲人:

file_path = destination_folder_path 
file_reference = destination_group.new_file(file_path, :project)
file_reference.path = file_path 
file_reference.include_in_index = '0' 
file_reference.set_explicit_file_type('folder') 
file_reference.last_known_file_type = 'folder'

project.native_targets.each do |target| 
   target.add_resources([file_reference]) 
end 

project.save
于 2019-07-12T13:56:43.183 回答