我想使用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
答案 0 :(得分: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