Sha256: f1c20595ce528d7525aac23cfb53e105a4cbda3628b5dc0e9f882ec7b617c59a

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

module Fastlane
  module Actions
    module SharedValues
      SNAPSHOT_SCREENSHOTS_PATH = :SNAPSHOT_SCREENSHOTS_PATH
    end

    class SnapshotAction < Action
      def self.run(params)
        clean = true
        clean = false if params.include?(:noclean)
        $verbose = true if params.include?(:verbose)

        if Helper.test?
          Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] = Dir.pwd
          return clean
        end

        require 'snapshot'

        FastlaneCore::UpdateChecker.start_looking_for_update('snapshot')

        begin
          Dir.chdir(FastlaneFolder.path) do
            Snapshot::SnapshotConfig.shared_instance
            Snapshot::Runner.new.work(clean: clean)

            results_path = Snapshot::SnapshotConfig.shared_instance.screenshots_path

            Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] = File.expand_path(results_path) # absolute URL
          end
        ensure
          FastlaneCore::UpdateChecker.show_update_status('snapshot', Snapshot::VERSION)
        end
      end

      def self.description
        "Generate new localised screenshots on multiple devices"
      end

      def self.available_options
        [
          ['noclean', 'Skips the clean process when building the app'],
          ['verbose', 'Print out the UI Automation output']
        ]
      end

      def self.author
        "KrauseFx"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fastlane-0.10.0 lib/fastlane/actions/snapshot.rb
fastlane-0.9.0 lib/fastlane/actions/snapshot.rb
fastlane-0.8.1 lib/fastlane/actions/snapshot.rb
fastlane-0.8.0 lib/fastlane/actions/snapshot.rb
fastlane-0.7.0 lib/fastlane/actions/snapshot.rb