Class: Fastlane::Actions::GodotGetVersionAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



29
30
31
# File 'lib/fastlane/plugin/godot/actions/godot_get_version_action.rb', line 29

def self.authors
  ['Mad Science Software']
end

.available_optionsObject



40
41
42
43
44
45
46
47
48
# File 'lib/fastlane/plugin/godot/actions/godot_get_version_action.rb', line 40

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :project_path,
                                 env_name: 'FL_GODOT_PROJECT_PATH',
                                 description: 'Directory containing project.godot',
                                 type: String,
                                 default_value: '.')
  ]
end

.descriptionObject



21
22
23
# File 'lib/fastlane/plugin/godot/actions/godot_get_version_action.rb', line 21

def self.description
  'Read the version name and build number from export_presets.cfg'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/fastlane/plugin/godot/actions/godot_get_version_action.rb', line 50

def self.is_supported?(platform)
  true
end

.outputObject



33
34
35
36
37
38
# File 'lib/fastlane/plugin/godot/actions/godot_get_version_action.rb', line 33

def self.output
  [
    ['GODOT_VERSION_NAME', 'Version name, e.g. "1.2.0"'],
    ['GODOT_VERSION_CODE', 'Build number / version code']
  ]
end

.return_valueObject



25
26
27
# File 'lib/fastlane/plugin/godot/actions/godot_get_version_action.rb', line 25

def self.return_value
  'Hash with :version_name (e.g. "1.2.0") and :version_code (integer build number)'
end

.run(params) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/fastlane/plugin/godot/actions/godot_get_version_action.rb', line 12

def self.run(params)
  cfg_path = File.join(File.expand_path(params[:project_path]), 'export_presets.cfg')
  versions = Helper::GodotVersions.read(cfg_path)
  UI.message("Version #{versions[:version_name]} (build #{versions[:version_code]})")
  Actions.lane_context[SharedValues::GODOT_VERSION_NAME] = versions[:version_name]
  Actions.lane_context[SharedValues::GODOT_VERSION_CODE] = versions[:version_code]
  versions
end