Method: Fastlane::SwiftLaneManager.collect_tool_paths_for_replacement

Defined in:
fastlane/lib/fastlane/swift_lane_manager.rb

.collect_tool_paths_for_replacement(all_user_tool_file_paths: nil, look_for_new_configs: nil) ⇒ Object

Find all the config files we care about (Deliverfile, Gymfile, etc), and build tuples of what file we’ll look for in the Xcode project, and what file paths we’ll need to swap (since we have to inject the user’s configs)

Return a mapping of what file paths we’re looking => new file pathes we’ll need to inject



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'fastlane/lib/fastlane/swift_lane_manager.rb', line 125

def self.collect_tool_paths_for_replacement(all_user_tool_file_paths: nil, look_for_new_configs: nil)
  new_user_tool_file_paths = all_user_tool_file_paths.select do |user_config, preinstalled_config_relative_path, user_config_relative_path|
    if look_for_new_configs
      File.exist?(user_config)
    else
      !File.exist?(user_config)
    end
  end

  # Now strip out the fastlane-relative path and leave us with xcodeproj relative paths
  new_user_tool_file_paths = new_user_tool_file_paths.map do |user_config, preinstalled_config_relative_path, user_config_relative_path|
    if look_for_new_configs
      [preinstalled_config_relative_path, user_config_relative_path]
    else
      [user_config_relative_path, preinstalled_config_relative_path]
    end
  end
  return new_user_tool_file_paths
end