4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'fastlane/lib/fastlane/actions/spm.rb', line 4
def self.run(params)
cmd = ["swift"]
cmd << (package_commands.include?(params[:command]) ? "package" : params[:command])
cmd << "--scratch-path #{params[:scratch_path]}" if params[:scratch_path]
cmd << "--build-path #{params[:build_path]}" if params[:build_path]
cmd << "--package-path #{params[:package_path]}" if params[:package_path]
cmd << "--configuration #{params[:configuration]}" if params[:configuration]
cmd << "--disable-sandbox" if params[:disable_sandbox]
cmd << "--verbose" if params[:verbose]
cmd << "--very-verbose" if params[:very_verbose]
if params[:simulator]
simulator_platform = simulator_platform(simulator: params[:simulator], simulator_arch: params[:simulator_arch])
simulator_sdk = simulator_sdk(simulator: params[:simulator])
simulator_sdk_suffix = simulator_sdk_suffix(simulator: params[:simulator])
simulator_flags = [
"-Xswiftc", "-sdk",
"-Xswiftc", "$(xcrun --sdk #{params[:simulator]} --show-sdk-path)",
"-Xswiftc", "-target",
"-Xswiftc", "#{simulator_platform}#{simulator_sdk}#{simulator_sdk_suffix}"
]
cmd += simulator_flags
end
cmd << params[:command] if package_commands.include?(params[:command])
cmd << "--enable-code-coverage" if params[:enable_code_coverage] && (params[:command] == 'generate-xcodeproj' || params[:command] == 'test')
cmd << "--parallel" if params[:parallel] && params[:command] == 'test'
if params[:xcconfig]
cmd << "--xcconfig-overrides #{params[:xcconfig]}"
end
if params[:xcpretty_output]
cmd += ["2>&1", "|", "xcpretty", "--#{params[:xcpretty_output]}"]
if params[:xcpretty_args]
cmd << (params[:xcpretty_args]).to_s
end
cmd = %w(set -o pipefail &&) + cmd
end
FastlaneCore::CommandExecutor.execute(command: cmd.join(" "),
print_all: true,
print_command: true)
end
|