fastlane-plugin-get_application_id 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26d368711b34ebf97308c8831f992868b3e1ea44
|
4
|
+
data.tar.gz: ec1a7734bcd93fd20a9b88ba693cea91914a59f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d003531041aaa1a90dc361d53fab28a92612a1cb58b56bf7f56b20162e1b4049903621c36e6567b43d420f1368ce13adab4d2d43090802f3d262a3b3f0b9f5c
|
7
|
+
data.tar.gz: 6d9a9c5d394199b45d5f2d641986c255d79694889cc5adf108bc9a070270a9411b2063bbdecc51fb82ca1d40901f29e0e8caefdb17900f642bb285796903a3ed
|
@@ -3,99 +3,98 @@ module Fastlane
|
|
3
3
|
class GetApplicationIdAction < Action
|
4
4
|
def self.run(params)
|
5
5
|
application_id = nil
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
constant_name ||= params[:ext_constant_name]
|
7
|
+
gradle_file_path ||= params[:gradle_file_path]
|
8
|
+
if !gradle_file_path.nil?
|
9
|
+
UI.message("The get_application_id plugin will use gradle file at (#{gradle_file_path})!")
|
10
|
+
application_id = get_application_id(gradle_file_path, constant_name)
|
11
|
+
else
|
12
|
+
app_folder_name ||= params[:app_folder_name]
|
13
|
+
UI.message("The get_application_id plugin is looking inside your project folder (#{app_folder_name})!")
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
15
|
+
Dir.glob("**/#{app_folder_name}/build.gradle") do |path|
|
16
|
+
UI.message(" -> Found a build.gradle file at path: (#{path})!")
|
17
|
+
application_id = get_application_id(path, constant_name)
|
19
18
|
end
|
19
|
+
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
if application_id.nil?
|
22
|
+
UI.user_error!('Impossible to find the applicationId with the specified properties 😭')
|
23
|
+
else
|
24
|
+
# Store the applicationId in the shared hash
|
25
|
+
Actions.lane_context['APPLICATION_ID'] = application_id
|
26
|
+
UI.success("👍 applicationId found: #{application_id}")
|
27
|
+
end
|
28
28
|
|
29
|
-
|
29
|
+
return application_id
|
30
30
|
end
|
31
31
|
|
32
|
-
def self.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
end
|
46
|
-
end
|
47
|
-
file.close
|
48
|
-
rescue => err
|
49
|
-
UI.error("An exception occured while reading the gradle file: #{err}")
|
50
|
-
err
|
32
|
+
def self.get_application_id(path, constant_name)
|
33
|
+
application_id = nil
|
34
|
+
unless File.file?(path)
|
35
|
+
UI.message(" -> No file exists at path: (#{path})!")
|
36
|
+
return application_id
|
37
|
+
end
|
38
|
+
begin
|
39
|
+
file = File.new(path, 'r')
|
40
|
+
while (line = file.gets)
|
41
|
+
next unless line.include? constant_name
|
42
|
+
components = line.strip.split(' ')
|
43
|
+
application_id = components[components.length - 1].tr("\"", '')
|
44
|
+
break
|
51
45
|
end
|
52
|
-
|
46
|
+
file.close
|
47
|
+
rescue => err
|
48
|
+
UI.error("An exception occurred while reading the gradle file: #{err}")
|
49
|
+
err
|
50
|
+
end
|
51
|
+
return application_id
|
53
52
|
end
|
54
53
|
|
55
54
|
def self.description
|
56
|
-
|
55
|
+
'Get the applicationId of an Android project.'
|
57
56
|
end
|
58
57
|
|
59
58
|
def self.authors
|
60
|
-
[
|
59
|
+
['Helder Pinhal']
|
61
60
|
end
|
62
61
|
|
63
62
|
def self.return_value
|
64
|
-
|
63
|
+
'Returns the applicationId.'
|
65
64
|
end
|
66
65
|
|
67
66
|
def self.details
|
68
|
-
|
67
|
+
'Get the applicationId of an Android project. This action will return the applicationId of your project according to the one set in your build.gradle file.'
|
69
68
|
end
|
70
69
|
|
71
70
|
def self.available_options
|
72
71
|
[
|
73
72
|
FastlaneCore::ConfigItem.new(key: :app_folder_name,
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
73
|
+
env_name: 'GETAPPLICATIONID_APP_NAME',
|
74
|
+
description: 'The name of the application source folder in the Android project (default: app)',
|
75
|
+
optional: true,
|
76
|
+
type: String,
|
77
|
+
default_value: 'app'),
|
79
78
|
FastlaneCore::ConfigItem.new(key: :gradle_file_path,
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
79
|
+
env_name: 'GETAPPLICATIONID_GRADLE_FILE_PATH',
|
80
|
+
description: 'The relative path to the gradle file containing the applicationId parameter (default:app/build.gradle)',
|
81
|
+
optional: true,
|
82
|
+
type: String,
|
83
|
+
default_value: nil),
|
84
|
+
FastlaneCore::ConfigItem.new(key: :ext_constant_name,
|
85
|
+
env_name: 'GETAPPLICATIONID_EXT_CONSTANT_NAME',
|
86
|
+
description: 'If the applicationId is set in an ext constant, specify the constant name (optional)',
|
87
|
+
optional: true,
|
89
88
|
type: String,
|
90
|
-
|
91
|
-
|
89
|
+
default_value: 'applicationId')
|
90
|
+
]
|
92
91
|
end
|
93
92
|
|
94
|
-
def self.
|
95
|
-
|
93
|
+
def self.outpu
|
94
|
+
[
|
96
95
|
['APPLICATION_ID', 'The applicationId']
|
97
|
-
|
98
|
-
|
96
|
+
]
|
97
|
+
end
|
99
98
|
|
100
99
|
def self.is_supported?(platform)
|
101
100
|
[:android].include?(platform)
|