Class: Fastlane::Actions::UnityGetVersionNumberAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



26
27
28
# File 'lib/fastlane/plugin/unity_exporter/actions/unity_get_version_number.rb', line 26

def self.authors
  ["steft"]
end

.available_optionsObject



38
39
40
41
42
43
44
45
46
47
# File 'lib/fastlane/plugin/unity_exporter/actions/unity_get_version_number.rb', line 38

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :project_path,
                                 env_name: "FL_UNITY_PROJECT_PATH",
                                 description: "The path to the Unity project. The starting point for relative paths is the directory that contains the 'fastlane' folder",
                                 optional: true,
                                 type: String,
                                 conflicting_options: [:arguments])
  ]
end

.descriptionObject



22
23
24
# File 'lib/fastlane/plugin/unity_exporter/actions/unity_get_version_number.rb', line 22

def self.description
  "Will get the version number that was used for the latest Unity export action. Therefore make sure to call the Unity export action before you use this action."
end

.detailsObject



34
35
36
# File 'lib/fastlane/plugin/unity_exporter/actions/unity_get_version_number.rb', line 34

def self.details
  # Optional:
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


49
50
51
52
53
54
# File 'lib/fastlane/plugin/unity_exporter/actions/unity_get_version_number.rb', line 49

def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
  [:ios, :android].include?(platform)
  true
end

.return_valueObject



30
31
32
# File 'lib/fastlane/plugin/unity_exporter/actions/unity_get_version_number.rb', line 30

def self.return_value
  "Returns the version number that was used for the latest Unity export action. In case of error will return 'unity_exporter_error_occurred'."
end

.run(params) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fastlane/plugin/unity_exporter/actions/unity_get_version_number.rb', line 9

def self.run(params)
  if params[:project_path]
    Helper::UnityEditorHelper.instance_variable_set(:@project_path, params[:project_path])
  end

  version_number = Helper::BuildExporterHelper.version_number
  if version_number == ""
    return "unity_exporter_error_occurred"
  end

  return version_number
end