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: 3f2c7d8868f7b7d1665c1b4c1b9db5f117a350ed
4
- data.tar.gz: '08915b122e5998b94d8a0ed804cd29fd04eac31f'
3
+ metadata.gz: 26d368711b34ebf97308c8831f992868b3e1ea44
4
+ data.tar.gz: ec1a7734bcd93fd20a9b88ba693cea91914a59f1
5
5
  SHA512:
6
- metadata.gz: b7a2711258a67bf67a4f5ab6e97f5b4285f7e9b381c160061b6e28870abcf4de662854faab25bb81520d38c5ceee58687a664200ce58b84c51e397588b9f7e10
7
- data.tar.gz: 3445daf506be789d97dee6ad1ecbc8b389393de1c899bbecdf7b90c21367fac4fdc939c19e5070998c86730d94d2e42e87f505d57f765c4d497f598ef8a337d5
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
- 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 = getApplicationId(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})!")
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
- Dir.glob("**/#{app_folder_name}/build.gradle") do |path|
16
- UI.message(" -> Found a build.gradle file at path: (#{path})!")
17
- application_id = getApplicationId(path, constant_name)
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
- if applicationId.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"]= applicationId
26
- UI.success("👍 applicationId found: #{applicationId}")
27
- end
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
- return applicationId
29
+ return application_id
30
30
  end
31
31
 
32
- def self.getApplicationId(path, constant_name)
33
- applicationId = nil
34
- if !File.file?(path)
35
- UI.message(" -> No file exists at path: (#{path})!")
36
- return applicationId
37
- end
38
- begin
39
- file = File.new(path, "r")
40
- while (line = file.gets)
41
- if line.include? constant_name
42
- components = line.strip.split(' ')
43
- applicationId = components[components.length - 1].tr("\"","")
44
- break
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
- return applicationId
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
- "Get the applicationId of an Android project."
55
+ 'Get the applicationId of an Android project.'
57
56
  end
58
57
 
59
58
  def self.authors
60
- ["Helder Pinhal"]
59
+ ['Helder Pinhal']
61
60
  end
62
61
 
63
62
  def self.return_value
64
- "Returns the applicationId."
63
+ 'Returns the applicationId.'
65
64
  end
66
65
 
67
66
  def self.details
68
- "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."
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
- env_name: "GETAPPLICATIONID_APP_NAME",
75
- description: "The name of the application source folder in the Android project (default: app)",
76
- optional: true,
77
- type: String,
78
- default_value:"app"),
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
- env_name: "GETAPPLICATIONID_GRADLE_FILE_PATH",
81
- description: "The relative path to the gradle file containing the applicationId parameter (default:app/build.gradle)",
82
- optional: true,
83
- type: String,
84
- default_value: nil),
85
- FastlaneCore::ConfigItem.new(key: :ext_constant_name,
86
- env_name: "GETAPPLICATIONID_EXT_CONSTANT_NAME",
87
- description: "If the applicationId is set in an ext constant, specify the constant name (optional)",
88
- optional: true,
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
- default_value: "applicationId")
91
- ]
89
+ default_value: 'applicationId')
90
+ ]
92
91
  end
93
92
 
94
- def self.output
95
- [
93
+ def self.outpu
94
+ [
96
95
  ['APPLICATION_ID', 'The applicationId']
97
- ]
98
- end
96
+ ]
97
+ end
99
98
 
100
99
  def self.is_supported?(platform)
101
100
  [:android].include?(platform)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GetApplicationId
3
- VERSION = "0.1.1"
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-get_application_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helder Pinhal