Class: Fastlane::Actions::GenericVersionAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



34
35
36
# File 'lib/fastlane/plugin/generic_version/actions/generic_version_action.rb', line 34

def self.authors
  ["Felix Rudat"]
end

.available_optionsObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/fastlane/plugin/generic_version/actions/generic_version_action.rb', line 46

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :version,
                                 env_name: "GENERIC_VERSION_SET_APP_VERSION",
                                 description: "App version",
                                 optional: true,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :build,
                                 env_name: "GENERIC_VERSION_SET_APP_BUILD",
                                 description: "App build",
                                 optional: true,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :target,
                                 env_name: "GENERIC_VERSION_APP_TARGET",
                                 optional: true,
                                 conflicting_options: [:scheme],
                                 description: "Specify a specific target if you have multiple per project, optional"),
    FastlaneCore::ConfigItem.new(key: :scheme,
                                env_name: "GENERIC_VERSION_APP_SCHEME",
                                optional: true,
                                conflicting_options: [:target],
                                description: "Specify a specific scheme if you have multiple per project, optional")
  ]
end

.descriptionObject



30
31
32
# File 'lib/fastlane/plugin/generic_version/actions/generic_version_action.rb', line 30

def self.description
  "Manage your app version for Android and iOS"
end

.detailsObject



42
43
44
# File 'lib/fastlane/plugin/generic_version/actions/generic_version_action.rb', line 42

def self.details
  "With this plugin you have a unified way to manage your cross platform app version. Also it delivers some handy tools."
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/fastlane/plugin/generic_version/actions/generic_version_action.rb', line 71

def self.is_supported?(platform)
  true
end

.return_valueObject



38
39
40
# File 'lib/fastlane/plugin/generic_version/actions/generic_version_action.rb', line 38

def self.return_value
  "Whenever a specific version was set it will be returned, nil otherwise."
end

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fastlane/plugin/generic_version/actions/generic_version_action.rb', line 7

def self.run(params)
  version = Helper::GenericVersionHelper.strip_tags(params[:version])
  build = Helper::GenericVersionHelper.strip_tags(params[:build])

  new_version = other_action.set_app_version(
    version: version,
    target: params[:target],
    scheme: params[:scheme]
  )

  new_build = other_action.set_app_build(
    build: build,
    target: params[:target],
    scheme: params[:scheme]
  )

  UI.important("New version is:")
  UI.message("  Version: #{new_version}")
  UI.message("  Build: #{new_build}")

  version
end