ruby 修改Xcode工程备忘录


# 静态引用工程时需要设置
# def change_player_project(root_path)
#   player_project_path = root_path + "/TXLiteAVDemo/SuperPlayer/Player.xcodeproj"
#   player_project = Xcodeproj::Project.open(player_project_path)
#   frameworks_group = player_project.root_object.main_group.children.select{|c| c.name=="Frameworks"}.first
#   frameworks_group.files.select { |file| not FileTest::exist?(file.real_path) }.each { |f| f.remove_from_project }
#   sdk_ref = frameworks_group.new_file("../../../SDK/TXLiteAVSDK_#{$target_name}.framework")
#   player_project.targets.select { |t| t.name=="SuperPlayer" }.each do |target|
#     target.frameworks_build_phases.files.delete_if{ |f| f.file_ref.nil? or !FileTest::exist?(file.real_path) }
#     target.frameworks_build_phase.add_file_reference(sdk_ref)
#     release_build_settings = target.build_settings('Release')
#     if release_build_settings['HEADER_SEARCH_PATHS'].class == Array
#       release_build_settings['HEADER_SEARCH_PATHS'].delete("$(SRCROOT)/../../../SDK/VSDK_Enterprise.framework/Headers")
#       release_build_settings['HEADER_SEARCH_PATHS'].push("$(SRCROOT)/../../../SDK/VSDK_#{$target_name}.framework/Headers")
#     end
#     debug_build_settings = target.build_settings('Debug')
#     if debug_build_settings['HEADER_SEARCH_PATHS'].class == Array
#       debug_build_settings['HEADER_SEARCH_PATHS'].delete("$(SRCROOT)/../../../SDK/VSDK_Enterprise.framework/Headers")
#       debug_build_settings['HEADER_SEARCH_PATHS'].push("$(SRCROOT)/../../../SDK/VSDK_#{$target_name}.framework/Headers")
#     end
#   end
#   player_project.save
# end

你可能感兴趣的:(ruby 修改Xcode工程备忘录)