Class: Fastlane::Actions::CheckGoodVersionAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



46
47
48
# File 'lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb', line 46

def self.authors
  ["lyndsey-ferguson/ldferguson"]
end

.categoryObject



54
55
56
# File 'lib/fastlane/plugin/check_good_version/actions/check_good_version_action.rb', line 54

def self.category
  :deprecated
end

.deprecated_notesObject



50
51
52
# 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

.descriptionObject



42
43
44
# 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) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
# 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) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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