Sha256: b2034fd0131a36e3d38cdb43d01084a316b191649747d2ed5cc730e544fa6389

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

require_relative '../helper'
require_relative 'app_identifier_guesser'

module FastlaneCore
  class ActionLaunchContext
    UNKNOWN_P_HASH = 'unknown'

    attr_accessor :action_name
    attr_accessor :p_hash
    attr_accessor :platform
    attr_accessor :fastlane_client_language # example: ruby fastfile, swift fastfile

    def initialize(action_name: nil, p_hash: UNKNOWN_P_HASH, platform: nil, fastlane_client_language: nil)
      @action_name = action_name
      @p_hash = p_hash
      @platform = platform
      @fastlane_client_language = fastlane_client_language
    end

    def self.context_for_action_name(action_name, fastlane_client_language: :ruby, args: nil)
      app_id_guesser = FastlaneCore::AppIdentifierGuesser.new(args: args)
      return self.new(
        action_name: action_name,
        p_hash: app_id_guesser.p_hash || UNKNOWN_P_HASH,
        platform: app_id_guesser.platform,
        fastlane_client_language: fastlane_client_language
      )
    end

    def build_tool_version
      if platform == :android
        return 'android'
      else
        return "Xcode #{Helper.xcode_version}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastlane_hotfix-2.165.1 fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb
fastlane_hotfix-2.165.0 fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb
fastlane_hotfix-2.187.0 fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb