Skip to content

Commit

Permalink
[scan] add option to specify result bundle path (#20742)
Browse files Browse the repository at this point in the history
* add option to specify result bundle path

* run tests pls

* recheck cla
  • Loading branch information
Benedek Kozma committed Nov 16, 2022
1 parent bae43ea commit c5a95c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions scan/lib/scan/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ def self.available_options
env_name: "SCAN_OUTPUT_XCTESTRUN",
description: "Should provide additional copy of .xctestrun file (settings.xctestrun) and place in output path?",
default_value: false),
FastlaneCore::ConfigItem.new(key: :result_bundle_path,
env_name: "SCAN_RESULT_BUNDLE_PATH",
description: "Custom path for the result bundle, overrides result_bundle",
type: String,
optional: true),
FastlaneCore::ConfigItem.new(key: :result_bundle,
short_option: "-z",
env_name: "SCAN_RESULT_BUNDLE",
Expand Down
7 changes: 6 additions & 1 deletion scan/lib/scan/test_command_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ def options # rubocop:disable Metrics/PerceivedComplexity
if config[:use_system_scm] && !options.include?("-scmProvider system")
options << "-scmProvider system"
end
options << "-resultBundlePath '#{result_bundle_path(true)}'" if config[:result_bundle]
if config[:result_bundle_path]
options << "-resultBundlePath '#{config[:result_bundle_path].shellescape}'"
Scan.cache[:result_bundle_path] = config[:result_bundle_path]
elsif config[:result_bundle]
options << "-resultBundlePath '#{result_bundle_path(true)}'"
end
if FastlaneCore::Helper.xcode_at_least?(10)
options << "-parallel-testing-enabled #{config[:parallel_testing] ? 'YES' : 'NO'}" unless config[:parallel_testing].nil?
options << "-parallel-testing-worker-count #{config[:concurrent_workers]}" if config[:concurrent_workers]
Expand Down

0 comments on commit c5a95c2

Please sign in to comment.