Class: Fastlane::Actions::SetAppBuildAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



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

def self.authors
  ["Felix Rudat"]
end

.available_optionsObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/fastlane/plugin/generic_version/actions/set_app_build_action.rb', line 53

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :build,
                                 env_name: "GENERIC_VERSION_SET_APP_BUILD",
                                 description: "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



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

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

.detailsObject



49
50
51
# File 'lib/fastlane/plugin/generic_version/actions/set_app_build_action.rb', line 49

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)


73
74
75
# File 'lib/fastlane/plugin/generic_version/actions/set_app_build_action.rb', line 73

def self.is_supported?(platform)
  true
end

.return_valueObject



45
46
47
# File 'lib/fastlane/plugin/generic_version/actions/set_app_build_action.rb', line 45

def self.return_value
  "The new 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
28
29
30
31
32
33
34
35
# File 'lib/fastlane/plugin/generic_version/actions/set_app_build_action.rb', line 7

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

  unless build
    # just a notification
    UI.important("No specific build was given. The current build will be incremented.")
  end

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

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

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

  build
end