class Fastlane::Actions::CheckGoodVersionAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb, line 46
def self.authors
  ["lyndsey-ferguson/ldferguson"]
end
category() click to toggle source
# File lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb, line 54
def self.category
  :deprecated
end
deprecated_notes() click to toggle source
# File lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb, line 50
def self.deprecated_notes
  "This action is deprecated in favor of the blackberry_mam_version action from the blackberry_mam plugin"
end
description() click to toggle source
# File lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb, line 42
def self.description
  "Checks the version of the installed Good framework"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb, line 58
def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end
run(params) click to toggle source
# File lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb, line 8
def self.run(params)
  UI.error("[Deprecation] check_good_version is deprecated, use the blackberry_mam_version action from the blackberry_mam plugin instead")

  selected_xcode_dev_dirpath = sh(
    'xcode-select --print-path',
    print_command: false,
    print_command_output: false
  ).strip

  selected_xcode_frameworks_path = File.join(
    selected_xcode_dev_dirpath,
    'Platforms',
    'iPhoneOS.platform',
    'Developer',
    'SDKs',
    'iPhoneOS.sdk',
    'System',
    'Library',
    'Frameworks'
  )

  good_framework_path = File.join(selected_xcode_frameworks_path, 'GD.framework')
  unless Dir.exist?(good_framework_path)
    Actions.lane_context[SharedValues::CHECK_GOOD_VERSION_ACTION_VERSION_NUMBER] = "0"
    UI.user_error!("The Good framework is not installed")
    return
  end
  good_version_filepath = File.join(good_framework_path, 'version')
  good_version_filecontents = File.read(good_version_filepath)
  good_version = /version:\s+([\.0-9]+)/.match(good_version_filecontents)[1]

  Actions.lane_context[SharedValues::CHECK_GOOD_VERSION_ACTION_VERSION_NUMBER] = good_version
end