fastlane-plugin-upload_symbols_to_shake 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a802fbb19af43ac392ec53afbc7ab62a7ec6866aa2a911bce8b7f7425261dddf
4
- data.tar.gz: 69921bf9370464cbebe1256687e79e74e8dc3df51b9c0da5a97bebe7a3537583
3
+ metadata.gz: 19320c659a5b7cc5707f5557188fa6192b30eb50148cd4807a514c48f380e7e9
4
+ data.tar.gz: 1b751ff6b8b3cd87ce02e7a2102322a9c202dd0f3d45eda5d9a129b1327990d6
5
5
  SHA512:
6
- metadata.gz: 28d40a3c0403b08381acb3ac4ebd4a80612dee74ee3b223fd58a688d21f045cf1746c798d7d593569c6473d882f3b7f260c7efdae6e9e9a654222e63199b697a
7
- data.tar.gz: 262eccf39d3f0fc8543861b86129d1414b66762e80dc0e8f3883d4d9ca0d2144043f4788c201016ab9c2ba4af35eb6a82f5a3bb32e355d823ef6918452a9a136
6
+ metadata.gz: 82c7061eee7f2aa2712b8fa084636088451f7d8f6ec4ea58606d220ac08787af7050bcb80b9a0a930f2cd1059690b303373ec817f73e8ef1ac374e42c113a223
7
+ data.tar.gz: 9285e4f83105c3d114abcc355c12cb3b186bbe8343865f89d47cf3022d338388255d5a6104b1a85958c63fc19957614547c7f214b8f8b144a77608384668b20f
@@ -11,21 +11,40 @@ module Fastlane
11
11
 
12
12
  client_id = params[:client_id]
13
13
  client_secret = params[:client_secret]
14
- auth_endpoint = 'https://api.shakebugs.com/auth/oauth2/token'
14
+ endpoint_url = params[:upload_url]
15
+
16
+ auth_endpoint = "#{endpoint_url}/auth/oauth2/token"
15
17
  command = "curl --silent -d \"grant_type=client_credentials&client_id=#{client_id}&client_secret=#{client_secret}\" #{auth_endpoint}"
16
18
 
17
19
  result = Actions.sh(command)
18
20
 
19
21
  json_data = JSON.parse(result)
20
-
22
+ if json_data.has_key? 'error'
23
+ UI.error('Please check your credentials')
24
+ return 1
25
+ end
26
+
21
27
  api_token = json_data['access_token']
22
28
 
23
- path = params[:plist_path]
24
- code = GetInfoPlistValueAction.run(path: path, key: "CFBundleVersion")
25
- name = GetInfoPlistValueAction.run(path: path, key: "CFBundleShortVersionString")
29
+ if params[:app_version_name] == nil && params[:app_version_code] == nil
30
+ if params[:plist_path] == nil
31
+ UI.error('Please enter app_version_name and app_version_code or provide path to Info.plist')
32
+ return 1
33
+ end
34
+ UI.message('Using application version name and code from Info.plist')
35
+ path = params[:plist_path]
36
+ UI.verbose "Path to Info.plist: '#{path}'"
37
+ code = GetInfoPlistValueAction.run(path: path, key: "CFBundleVersion")
38
+ name = GetInfoPlistValueAction.run(path: path, key: "CFBundleShortVersionString")
39
+
40
+ else
41
+ name = params[:app_version_name]
42
+ code = params[:app_version_code]
43
+ UI.verbose "Using provided app_version_name(#{name}) and app_version_code(#{code})"
44
+ end
26
45
 
27
46
  bundle_id = params[:bundle_id]
28
- upload_file_endpoint = "https://api.shakebugs.com/api/1.0/crash_reporting/app_debug_file/#{bundle_id}"
47
+ upload_file_endpoint = "#{endpoint_url}/api/1.0/crash_reporting/app_debug_file/#{bundle_id}"
29
48
  command = "curl #{upload_file_endpoint} --write-out %{http_code} --silent --output /dev/null -H \"Authorization: Bearer #{api_token}\" -F os=\"iOS\" -F platform=\"iOS\" -F app_version_name=\"#{name}\" -F app_version_code=\"#{code}\" -F file="
30
49
 
31
50
  dsym_paths = []
@@ -102,17 +121,37 @@ module Fastlane
102
121
  end),
103
122
 
104
123
  FastlaneCore::ConfigItem.new(key: :bundle_id,
105
- description: "Bundle id",
124
+ description: "Bundle id",
106
125
  type: String),
107
126
 
108
127
  FastlaneCore::ConfigItem.new(key: :plist_path,
109
- description: "Info.plist path",
128
+ description: "Info.plist path",
129
+ optional: true,
130
+ default_value: default_info_plist_path,
110
131
  type: String),
111
132
 
112
133
  FastlaneCore::ConfigItem.new(key: :dsym_array_paths,
113
- type: Array,
134
+ type: Array,
135
+ optional: true,
136
+ description: "Array of paths to *.dSYM files"),
137
+
138
+ FastlaneCore::ConfigItem.new(key: :app_version_name,
139
+ description: "Application version name",
114
140
  optional: true,
115
- description: 'Array of paths to *.dSYM files')
141
+ default_value: nil,
142
+ type: String),
143
+
144
+ FastlaneCore::ConfigItem.new(key: :app_version_code,
145
+ description: "Application version code",
146
+ optional: true,
147
+ default_value: nil,
148
+ type: Integer),
149
+
150
+ FastlaneCore::ConfigItem.new(key: :upload_url,
151
+ description: "Custom endpoint url",
152
+ default_value: "https://api.shakebugs.com",
153
+ optional: true,
154
+ type: String),
116
155
  ]
117
156
  end
118
157
 
@@ -135,6 +174,10 @@ module Fastlane
135
174
  FileUtils.rm_rf directory_path
136
175
  end
137
176
 
177
+ def self.default_info_plist_path
178
+ return Dir.glob("./*/Info.plist").reject{|path| path =~ /build|test|Shake.framework/i }.first
179
+ end
180
+
138
181
  def self.copy_dsmy_paths_into_directory(dsym_paths, directory_path)
139
182
  dsym_paths.each do |path|
140
183
  if File.extname(path) == '.dSYM'
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UploadSymbolsToShake
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-upload_symbols_to_shake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shake Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2021-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry