Class: Fastlane::Actions::GetAppBuildAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



33
34
35
# File 'lib/fastlane/plugin/generic_version/actions/get_app_build_action.rb', line 33

def self.authors
  ["Felix Rudat"]
end

.available_optionsObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/fastlane/plugin/generic_version/actions/get_app_build_action.rb', line 45

def self.available_options
  [
    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



29
30
31
# File 'lib/fastlane/plugin/generic_version/actions/get_app_build_action.rb', line 29

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

.detailsObject



41
42
43
# File 'lib/fastlane/plugin/generic_version/actions/get_app_build_action.rb', line 41

def self.details
  "With this plugin you have a unified way to manage your cross platform app build."
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/fastlane/plugin/generic_version/actions/get_app_build_action.rb', line 60

def self.is_supported?(platform)
  true
end

.return_valueObject



37
38
39
# File 'lib/fastlane/plugin/generic_version/actions/get_app_build_action.rb', line 37

def self.return_value
  "The current app build"
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
# File 'lib/fastlane/plugin/generic_version/actions/get_app_build_action.rb', line 7

def self.run(params)
  platform = other_action.lane_context[SharedValues::PLATFORM_NAME]
  build = nil

  if platform == :android
    # android
    Helper::GenericVersionHelper.load_dependencies('fastlane-plugin-versioning_android')

    build = other_action.android_get_version_code
  else
    # ios or osx
    Helper::GenericVersionHelper.load_dependencies('fastlane-plugin-versioning')

    build = other_action.get_build_number_from_xcodeproj(
      target: params[:target],
      scheme: params[:scheme]
    )
  end

  build
end