Class: Fastlane::Actions::SetBuildNumberRepositoryAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/set_build_number_repository.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, lane_context, method_missing, other_action, output, return_value, sample_return_value, sh, step_text

Class Method Details

.authorsObject



46
47
48
# File 'lib/fastlane/actions/set_build_number_repository.rb', line 46

def self.authors
  ["pbrooks", "armadsen"]
end

.available_optionsObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/fastlane/actions/set_build_number_repository.rb', line 35

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :use_hg_revision_number,
                                 env_name: "USE_HG_REVISION_NUMBER",
                                 description: "Use hg revision number instead of hash (ignored for non-hg repos)",
                                 optional: true,
                                 is_string: false,
                                 default_value: false)
  ]
end

.categoryObject



56
57
58
# File 'lib/fastlane/actions/set_build_number_repository.rb', line 56

def self.category
  :project
end

.descriptionObject



23
24
25
# File 'lib/fastlane/actions/set_build_number_repository.rb', line 23

def self.description
  "Set the build number from the current repository"
end

.detailsObject



27
28
29
30
31
32
33
# File 'lib/fastlane/actions/set_build_number_repository.rb', line 27

def self.details
  [
    "This action will set the **build number** according to what the SCM HEAD reports.",
    "Currently supported SCMs are svn (uses root revision), git-svn (uses svn revision) and git (uses short hash) and mercurial (uses short hash or revision number).",
    "There is an option, `:use_hg_revision_number`, which allows to use mercurial revision number instead of hash"
  ].join("\n")
end

.example_codeObject



50
51
52
53
54
# File 'lib/fastlane/actions/set_build_number_repository.rb', line 50

def self.example_code
  [
    'set_build_number_repository'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/fastlane/actions/set_build_number_repository.rb', line 7

def self.is_supported?(platform)
  [:ios, :mac].include? platform
end

.run(params) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/fastlane/actions/set_build_number_repository.rb', line 11

def self.run(params)
  build_number = Fastlane::Actions::GetBuildNumberRepositoryAction.run(
    use_hg_revision_number: params[:use_hg_revision_number]
  )

  Fastlane::Actions::IncrementBuildNumberAction.run(build_number: build_number)
end