Class: Fastlane::Actions::CaptureIosScreenshotsAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/capture_ios_screenshots.rb

Direct Known Subclasses

CaptureScreenshotsAction, SnapshotAction

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, details, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject


37
38
39
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 37

def self.author
  "KrauseFx"
end

.available_optionsObject


25
26
27
28
29
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 25

def self.available_options
  return [] unless Helper.mac?
  require 'snapshot'
  Snapshot::Options.available_options
end

.categoryObject


56
57
58
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 56

def self.category
  :screenshots
end

.descriptionObject


21
22
23
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 21

def self.description
  "Generate new localized screenshots on multiple devices (via _snapshot_)"
end

.example_codeObject


45
46
47
48
49
50
51
52
53
54
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 45

def self.example_code
  [
    'capture_ios_screenshots',
    'snapshot # alias for "capture_ios_screenshots"',
    'capture_ios_screenshots(
      skip_open_summary: true,
      clean: true
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:


41
42
43
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 41

def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end

.outputObject


31
32
33
34
35
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 31

def self.output
  [
    ['SNAPSHOT_SCREENSHOTS_PATH', 'The path to the screenshots']
  ]
end

.run(params) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
# File 'fastlane/lib/fastlane/actions/capture_ios_screenshots.rb', line 8

def self.run(params)
  return nil unless Helper.mac?
  require 'snapshot'

  Snapshot.config = params
  Snapshot::DependencyChecker.check_simulators
  Snapshot::Runner.new.work

  Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] = File.expand_path(params[:output_directory]) # absolute URL

  true
end