Class: Fastlane::Actions::GetBuildNumberRepositoryAction
Class Method Summary
collapse
action_name, author, details, method_missing, other_action, sh, step_text
Class Method Details
.authors ⇒ Object
93
94
95
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 93
def self.authors
["bartoszj", "pbrooks", "armadsen"]
end
|
.available_options ⇒ Object
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 72
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
|
.command(use_hg_revision_number) ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 36
def self.command(use_hg_revision_number)
if is_svn?
UI.message "Detected repo: svn"
return 'svn info | grep Revision | egrep -o "[0-9]+"'
elsif is_git_svn?
UI.message "Detected repo: git-svn"
return 'git svn info | grep Revision | egrep -o "[0-9]+"'
elsif is_git?
UI.message "Detected repo: git"
return 'git rev-parse --short HEAD'
elsif is_hg?
UI.message "Detected repo: hg"
if use_hg_revision_number
return 'hg parent --template {rev}'
else
return 'hg parent --template "{node|short}"'
end
else
UI.user_error!("No repository detected")
end
end
|
.description ⇒ Object
68
69
70
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 68
def self.description
"Get the build number from the current repository"
end
|
.is_git? ⇒ Boolean
15
16
17
18
19
20
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 15
def self.is_git?
Actions.sh 'git rev-parse HEAD'
return true
rescue
return false
end
|
.is_git_svn? ⇒ Boolean
22
23
24
25
26
27
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 22
def self.is_git_svn?
Actions.sh 'git svn info'
return true
rescue
return false
end
|
.is_hg? ⇒ Boolean
29
30
31
32
33
34
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 29
def self.is_hg?
Actions.sh 'hg status'
return true
rescue
return false
end
|
.is_supported?(platform) ⇒ Boolean
97
98
99
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 97
def self.is_supported?(platform)
[:ios, :mac].include? platform
end
|
.is_svn? ⇒ Boolean
8
9
10
11
12
13
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 8
def self.is_svn?
Actions.sh 'svn info'
return true
rescue
return false
end
|
.output ⇒ Object
83
84
85
86
87
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 83
def self.output
[
['BUILD_NUMBER_REPOSITORY', 'The build number from the current repository']
]
end
|
.return_value ⇒ Object
89
90
91
|
# File 'lib/fastlane/actions/get_build_number_repository.rb', line 89
def self.return_value
"The build number from the current repository"
end
|