fastlane-plugin-upload_dsym_to_bugly 0.2.0 → 1.0.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5c6d8fb01161391981fb9bde20dea2336c107189dd84b16854bf00c33a632b2
|
4
|
+
data.tar.gz: ed3378e92801987b5972afcc097956b7c7fb864f0e26af538bbbcc6e1e8fa927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 177bde3c38855222dff3aa3ebef497041c486d57c7695dbb69c00a1e15cd239f23eebc0f4a0db2d119010665d0e089edf02c2fd27b59061e49cc60f0986df1f8
|
7
|
+
data.tar.gz: 8d54f91666b357f88e83aa7c1d66abc767dcb980d84b4e4bd48c1a0361ec84198db351427c4009b0edb03428ae7243f4a284fd35bdd7831b3e27f0718139df6d
|
@@ -5,7 +5,42 @@ module Fastlane
|
|
5
5
|
module Actions
|
6
6
|
class UploadDsymToBuglyAction < Action
|
7
7
|
def self.run(params)
|
8
|
-
|
8
|
+
require 'json'
|
9
|
+
# fastlane will take care of reading in the parameter and fetching the environment variable:
|
10
|
+
UI.message "file path: #{params[:file_path]}"
|
11
|
+
|
12
|
+
json_file = 'upload_dsym_to_bugly_result.json'
|
13
|
+
|
14
|
+
begin
|
15
|
+
api_version = ''
|
16
|
+
if !params[:api_version].nil? && params[:api_version] > 0
|
17
|
+
api_version = " --form \"api_version=#{params[:api_version]}\" "
|
18
|
+
UI.message "api_version: #{api_version}"
|
19
|
+
end
|
20
|
+
rescue Exception => e
|
21
|
+
UI.message "error at checking api version, caused by #{e}"
|
22
|
+
end
|
23
|
+
|
24
|
+
begin
|
25
|
+
channel = ''
|
26
|
+
if !params[:channel].nil? && !params[:channel].empty?
|
27
|
+
channel = " --form \"channel=#{params[:channel]}\" "
|
28
|
+
UI.message "channel: #{channel}"
|
29
|
+
end
|
30
|
+
rescue Exception => e
|
31
|
+
UI.message "error at checking api version, caused by #{e}"
|
32
|
+
end
|
33
|
+
|
34
|
+
cmd = "curl -k \"https://api.bugly.qq.com/openapi/file/upload/symbol?app_key=#{params[:app_key]}&app_id=#{params[:app_id]}\"" + api_version + " --form \"app_id=#{params[:app_id]}\"" + " --form \"app_key=#{params[:app_key]}\"" + " --form \"symbolType=#{params[:symbol_type]}\"" + " --form \"bundleId=#{params[:bundle_id]}\"" + " --form \"productVersion=#{params[:product_version]}\"" + channel + " --form \"fileName=#{params[:file_name]}\"" + " --form \"file=@#{params[:file_path]}\"" + " -o " + json_file
|
35
|
+
sh(cmd)
|
36
|
+
obj = JSON.parse(File.read(json_file))
|
37
|
+
ret = obj['rtcode']
|
38
|
+
if ret == 0
|
39
|
+
UI.message "upload success"
|
40
|
+
else
|
41
|
+
UI.message "upload failed, result is #{obj}"
|
42
|
+
end
|
43
|
+
`rm upload_dsym_to_bugly_result.json`
|
9
44
|
end
|
10
45
|
|
11
46
|
def self.description
|
@@ -27,11 +62,6 @@ module Fastlane
|
|
27
62
|
|
28
63
|
def self.available_options
|
29
64
|
[
|
30
|
-
# FastlaneCore::ConfigItem.new(key: :your_option,
|
31
|
-
# env_name: "UPLOAD_DSYM_TO_BUGLY_YOUR_OPTION",
|
32
|
-
# description: "A description of your option",
|
33
|
-
# optional: false,
|
34
|
-
# type: String)
|
35
65
|
FastlaneCore::ConfigItem.new(key: :api_version,
|
36
66
|
env_name: "FL_UPLOAD_DSYM_TO_BUGLY_API_VERSION",
|
37
67
|
description: "api version for UploadDsymToBuglyAction",
|