fastlane-plugin-bugsnag 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +20 -0
- data/bugsnag-dsym-upload +161 -0
- data/lib/fastlane/plugin/bugsnag/version.rb +1 -1
- data/spec/bugsnag_upload_dsym_action_spec.rb +13 -2
- metadata +2 -2
- data/LICENSE.txt +0 -1
- data/bugsnag-dsym-upload +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02c60ef7d341ce29ce5d18ec3f5c93362c7ed029e9d3d1ea7d088a71d82c5236
|
4
|
+
data.tar.gz: e03e1f3969e5b1c41b13ce7c0f92b3e3cd4f09bd684d861f3b5d48099d18455b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76f80373a17c95b8887cc7cfbd1fbff3e58742c989bb83623277de768eb82ed1a9ef32ef613ab6194f2d719003f762fec780ed2ca56a7bae98cf23f531a3df3d
|
7
|
+
data.tar.gz: 2e339494643b6e71de5b8c70bcbef48e7d876930009aca03c6236ffbbe58d85f67999bd383cfed2b0330fca7c3d4ad5de80c34ca5c51bcc14b82781f6ffe2737
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2016 Bugsnag, Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/bugsnag-dsym-upload
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
#
|
3
|
+
# Given a directory, uploads any *.dSYM bundles with the directory to
|
4
|
+
# Bugsnag. As a pre-upload step, bitcode symbol maps can be combined with
|
5
|
+
# dSYM files to ensure symbols are sent for bitcode-enabled binaries.
|
6
|
+
#
|
7
|
+
# Depends on:
|
8
|
+
# * curl
|
9
|
+
# * dwarfdump
|
10
|
+
# * dsymutil (for --symbol-maps, optional)
|
11
|
+
# * unzip (for uploading a .zip file, optional)
|
12
|
+
|
13
|
+
function print_usage() {
|
14
|
+
echo "Usage: $0 [--symbol-maps DIR] dSYMS_PATH"
|
15
|
+
echo
|
16
|
+
echo "-h, --help Displays this message"
|
17
|
+
echo "-v, --verbose Print verbose logging output during execution"
|
18
|
+
echo "--symbol-maps DIR Path to a directory of bitcode symbol maps. The"
|
19
|
+
echo " dSYM files will be restored with symbols prior to"
|
20
|
+
echo " upload. Requires dsymutil."
|
21
|
+
echo "--upload-server URL The server receiving dSYM files. Set this value if"
|
22
|
+
echo " using an on-premise Bugsnag installation"
|
23
|
+
echo "--project-root DIR The root directory of the project. This will help to"
|
24
|
+
echo " group error reports by project"
|
25
|
+
echo "dSYMS_PATH A directory or .zip file containing *.dSYM bundles to"
|
26
|
+
echo " upload"
|
27
|
+
}
|
28
|
+
|
29
|
+
function exit_with_usage() {
|
30
|
+
echo $1
|
31
|
+
echo
|
32
|
+
print_usage
|
33
|
+
exit 1
|
34
|
+
}
|
35
|
+
|
36
|
+
function log() {
|
37
|
+
if [[ $silent != 1 ]]; then
|
38
|
+
echo $@
|
39
|
+
fi
|
40
|
+
}
|
41
|
+
|
42
|
+
function log_verbose() {
|
43
|
+
if [[ $verbose == 1 ]]; then
|
44
|
+
log $@
|
45
|
+
fi
|
46
|
+
}
|
47
|
+
|
48
|
+
upload_server=https://upload.bugsnag.com
|
49
|
+
unset symbol_maps
|
50
|
+
unset dsym_dir
|
51
|
+
unset verbose
|
52
|
+
unset silent
|
53
|
+
unset project_root
|
54
|
+
|
55
|
+
while [[ $# -gt 0 ]]; do
|
56
|
+
case $1 in
|
57
|
+
-h|--help)
|
58
|
+
print_usage
|
59
|
+
exit 0;;
|
60
|
+
-s|--silent)
|
61
|
+
silent=1
|
62
|
+
shift;;
|
63
|
+
-v|--verbose)
|
64
|
+
verbose=1
|
65
|
+
shift;;
|
66
|
+
--symbol-maps)
|
67
|
+
symbol_maps=$2
|
68
|
+
shift
|
69
|
+
shift;;
|
70
|
+
--upload-server)
|
71
|
+
upload_server=$2
|
72
|
+
shift
|
73
|
+
shift;;
|
74
|
+
--project-root)
|
75
|
+
project_root=$2
|
76
|
+
shift
|
77
|
+
shift;;
|
78
|
+
-*)
|
79
|
+
exit_with_usage "Invalid parameter provided: $1";;
|
80
|
+
*)
|
81
|
+
dsym_dir=$1
|
82
|
+
break;;
|
83
|
+
esac
|
84
|
+
done
|
85
|
+
|
86
|
+
# Set IFS to ensure that file paths with spaces in get processed correctly
|
87
|
+
IFS=$'\n'
|
88
|
+
|
89
|
+
if [[ ! -z $symbol_maps ]]; then
|
90
|
+
if [[ ! -d $symbol_maps ]]; then
|
91
|
+
exit_with_usage "Bitcode symbol map parameter is not a directory"
|
92
|
+
elif [[ ! -x "$(command -v dsymutil 2>/dev/null)" ]]; then
|
93
|
+
exit_with_usage "dsymutil command not found."
|
94
|
+
fi
|
95
|
+
fi
|
96
|
+
if [[ -z $dsym_dir ]]; then
|
97
|
+
exit_with_usage "No dSYM directory provided"
|
98
|
+
fi
|
99
|
+
if [[ ! -d $dsym_dir ]]; then
|
100
|
+
if [[ $dsym_dir == *".zip" ]]; then
|
101
|
+
if [[ ! -x "$(command -v unzip 2>/dev/null)" ]]; then
|
102
|
+
exit_with_usage "unzip command not found."
|
103
|
+
fi
|
104
|
+
temp_dir=$(mktemp -dt "bugsnag-dsym-upload.XXX")
|
105
|
+
unzip -qq $dsym_dir -d $temp_dir
|
106
|
+
dsym_dir=$temp_dir
|
107
|
+
else
|
108
|
+
exit_with_usage "'$dsym_dir' is not a directory or a zip file"
|
109
|
+
fi
|
110
|
+
fi
|
111
|
+
|
112
|
+
log_verbose "Uploading files to $upload_server"
|
113
|
+
success_count=0
|
114
|
+
fail_count=0
|
115
|
+
|
116
|
+
for dsym in $dsym_dir/*.dSYM; do
|
117
|
+
log_verbose "Preparing to upload $dsym"
|
118
|
+
|
119
|
+
if [[ -d $symbol_maps ]]; then
|
120
|
+
log_verbose "Updating file with bitcode symbol maps in $symbol_maps"
|
121
|
+
dsymutil "$dsym" --symbol-map "$symbol_maps"
|
122
|
+
fi
|
123
|
+
|
124
|
+
dwarf_data=$dsym/Contents/Resources/DWARF
|
125
|
+
if [[ ! -d $dwarf_data ]]; then
|
126
|
+
log_verbose "Skipping file missing DWARF data: $dsym"
|
127
|
+
fail_count=$((fail_count+1))
|
128
|
+
continue
|
129
|
+
fi
|
130
|
+
for file in $dwarf_data/*; do
|
131
|
+
uuid=$(dwarfdump -u $file 2>/dev/null)
|
132
|
+
if [[ $uuid == UUID* ]]; then
|
133
|
+
log Uploading $uuid
|
134
|
+
if [[ ! -z $project_root ]]; then
|
135
|
+
output=$(curl --silent --show-error $upload_server -F dsym=@\"$file\" -F projectRoot=$project_root)
|
136
|
+
else
|
137
|
+
output=$(curl --silent --show-error $upload_server -F dsym=@\"$file\")
|
138
|
+
fi
|
139
|
+
if [ $? -eq 0 ]; then
|
140
|
+
success_count=$((success_count+1))
|
141
|
+
else
|
142
|
+
fail_count=$((fail_count+1))
|
143
|
+
log_verbose "Failed to upload file: $file"
|
144
|
+
fi
|
145
|
+
echo $output | grep -v '^OK$'
|
146
|
+
log
|
147
|
+
else
|
148
|
+
log_verbose "Skipping file without UUID: $file"
|
149
|
+
fail_count=$((fail_count+1))
|
150
|
+
fi
|
151
|
+
done
|
152
|
+
done
|
153
|
+
|
154
|
+
if [ $success_count -gt 0 ]; then
|
155
|
+
log "$success_count files uploaded successfully"
|
156
|
+
fi
|
157
|
+
|
158
|
+
if [ $fail_count -gt 0 ]; then
|
159
|
+
log "$fail_count files failed to upload"
|
160
|
+
exit 1
|
161
|
+
fi
|
@@ -4,8 +4,19 @@ Action = Fastlane::Actions::UploadSymbolsToBugsnagAction
|
|
4
4
|
|
5
5
|
describe Action do
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
context "the packaged gem" do
|
8
|
+
gem_name = "fastlane-plugin-bugsnag-#{Fastlane::Bugsnag::VERSION}"
|
9
|
+
|
10
|
+
after do
|
11
|
+
FileUtils.rm_rf(gem_name)
|
12
|
+
FileUtils.rm_rf("#{gem_name}.gem")
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'has an executable upload script' do
|
16
|
+
system('rake build')
|
17
|
+
system("gem unpack #{gem_name}.gem")
|
18
|
+
expect(File.exist?(File.join("#{gem_name}/bugsnag-dsym-upload"))).to be true
|
19
|
+
end
|
9
20
|
end
|
10
21
|
|
11
22
|
describe '#run' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delisa Mason
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xml-simple
|
data/LICENSE.txt
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
./../../LICENSE.txt
|
data/bugsnag-dsym-upload
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
./../../bin/bugsnag-dsym-upload
|