Method: Fastlane::Setup.setup_swift_support

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

.setup_swift_supportObject

rubocop:enable Metrics/BlockNesting



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'fastlane/lib/fastlane/setup/setup.rb', line 134

def self.setup_swift_support
  runner_source_resources = "#{Fastlane::ROOT}/swift/."
  destination_path = File.expand_path('swift', FastlaneCore::FastlaneFolder.path)

  # Return early if already setup
  return if File.exist?(destination_path)

  # Show message if Fastfile.swift exists but missing Swift classes and Xcode project
  if FastlaneCore::FastlaneFolder.swift?
    UI.important("Restoring Swift classes and FastlaneSwiftRunner.xcodeproj...")
  end

  FileUtils.cp_r(runner_source_resources, destination_path)
  UI.success("Copied Swift fastlane runner project to '#{destination_path}'.")

  Fastlane::SwiftLaneManager.first_time_setup
end