Class: Fastlane::Actions::AndroidGetVersionCodeAction
- Inherits:
-
AndroidBaseAction
show all
- Defined in:
- lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb
Class Method Summary
collapse
app_project_dir_action, authors, find_build_gradle, is_supported?
Class Method Details
.available_options ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb', line 38
def self.available_options
[
app_project_dir_action,
FastlaneCore::ConfigItem.new(key: :key,
env_name: "FL_ANDROID_GET_VERSION_CODE_KEY",
description: "The property key",
optional: true,
type: String,
default_value: "versionCode"),
]
end
|
.category ⇒ Object
56
57
58
59
|
# File 'lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb', line 56
def self.category
:project
end
|
.description ⇒ Object
30
31
32
|
# File 'lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb', line 30
def self.description
"Returns the version code of the android project"
end
|
.details ⇒ Object
34
35
36
|
# File 'lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb', line 34
def self.details
"Based on the provided params, returns the value of the version code of the build.gradle file as a number"
end
|
.output ⇒ Object
50
51
52
53
54
|
# File 'lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb', line 50
def self.output
[
["ANDROID_VERSION_CODE", "The version code specified on the build.gradle file of the project"],
]
end
|
.return_type ⇒ Object
75
76
77
78
|
# File 'lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb', line 75
def self.return_type
:int
end
|
.return_value ⇒ Object
def self.example_code
[
'version = get_version_number(xcodeproj: "Project.xcodeproj")',
'version = get_version_number(
xcodeproj: "Project.xcodeproj",
target: "App"
)'
]
end
71
72
73
|
# File 'lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb', line 71
def self.return_value
"The Android app version code"
end
|
.run(params) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/fastlane/plugin/android_version_manager/actions/android_get_version_code_action.rb', line 12
def self.run(params)
UI.message("Parameter app_project_dir: #{params[:app_project_dir]}")
UI.message("Parameter key: #{params[:key]}")
file_path = find_build_gradle(params[:app_project_dir])
version_code = Helper::AndroidVersionManagerHelper.get_version_code_from_gradle_file(file_path, params[:key])
Actions.lane_context[Fastlane::Actions::SharedValues::ANDROID_VERSION_CODE] = version_code
return version_code
end
|