fastlane-plugin-bugsnag 1.2.1 → 1.3.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
  SHA1:
3
- metadata.gz: d54ad579cd0a281435a4f43689f426a9a911ca1e
4
- data.tar.gz: 588f1effd56cb664c7e0106c54022296c51be9e6
3
+ metadata.gz: 699cd6ec58789101875e421f44903f7e63f4fa47
4
+ data.tar.gz: 6c24799a2a13a819bc1a6e36840b82aa9cf1bd87
5
5
  SHA512:
6
- metadata.gz: 861014d528c7e88bbbaebe096ebe1f96782e50ac1f08645f40ef4a315fbbf3695e5d778aabb14dd8e33b38bc603b1bce7838ebe5b12f7401e704d3c606fb7d4d
7
- data.tar.gz: f0ad580b698cb1478f2b76d4a0448d6856ad2a7d11a8cdfd38cc3aba6e3368e4cfed76f015661dfab9d828541dc1ef73f7530ecf05740909179f457c922fb8e8
6
+ metadata.gz: 2ebfc59a0886a70e3bbdf01ff9ffc227e7de5f3449c7e175f60c7faf5cf9e809f8574db9e754cc643e67b1d9a388084a6baedf4865fdc5380c69da34c987c147
7
+ data.tar.gz: c45e9a8d16301c30c684c6abac68b298925284a1f0af6d5d241a1cff40ec43dbb798740b7337075787dfa6e2c48bdb827b821ad025d7801f88ff557fc6e3859f
@@ -20,7 +20,8 @@ function print_usage() {
20
20
  echo " upload. Requires dsymutil."
21
21
  echo "--upload-server URL The server receiving dSYM files. Set this value if"
22
22
  echo " using an on-premise Bugsnag installation"
23
- echo
23
+ echo "--project-root DIR The root directory of the project. This will help to"
24
+ echo " group error reports by project"
24
25
  echo "dSYMS_PATH A directory or .zip file containing *.dSYM bundles to"
25
26
  echo " upload"
26
27
  }
@@ -49,6 +50,7 @@ unset symbol_maps
49
50
  unset dsym_dir
50
51
  unset verbose
51
52
  unset silent
53
+ unset project_root
52
54
 
53
55
  while [[ $# -gt 0 ]]; do
54
56
  case $1 in
@@ -69,6 +71,10 @@ while [[ $# -gt 0 ]]; do
69
71
  upload_server=$2
70
72
  shift
71
73
  shift;;
74
+ --project-root)
75
+ project_root=$2
76
+ shift
77
+ shift;;
72
78
  -*)
73
79
  exit_with_usage "Invalid parameter provided: $1";;
74
80
  *)
@@ -125,7 +131,11 @@ for dsym in $dsym_dir/*.dSYM; do
125
131
  uuid=$(dwarfdump -u $file 2>/dev/null)
126
132
  if [[ $uuid == UUID* ]]; then
127
133
  log Uploading $uuid
128
- output=$(curl --silent --show-error $upload_server -F dsym=@\"$file\")
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
129
139
  if [ $? -eq 0 ]; then
130
140
  success_count=$((success_count+1))
131
141
  else
@@ -34,7 +34,7 @@ module Fastlane
34
34
  UI.user_error! missing_api_key_message(params)
35
35
  end
36
36
  if payload[:appVersion].nil?
37
- UI.user_error! missing_api_key_message(params)
37
+ UI.user_error! missing_app_version_message(params)
38
38
  end
39
39
  send_notification(params[:endpoint], ::JSON.dump(payload))
40
40
  end
@@ -163,26 +163,43 @@ module Fastlane
163
163
 
164
164
  def self.load_default_values
165
165
  options = {releaseStage: "production", user: `whoami`.chomp}
166
- if file_path = default_android_manifest_path
167
- options.merge!(options_from_android_manifest(file_path))
168
- build_gradle_path = Dir.glob("app/build.gradle").first
169
- build_gradle_path ||= Dir.glob("build.gradle")
170
- options.merge!(options_from_build_gradle(build_gradle_path)) if build_gradle_path
171
- elsif file_path = default_info_plist_path
172
- options.merge!(options_from_info_plist(file_path))
166
+ case lane_context[:PLATFORM_NAME]
167
+ when nil
168
+ if file_path = default_android_manifest_path
169
+ options.merge!(load_default_android_values(file_path))
170
+ elsif file_path = default_info_plist_path
171
+ options.merge!(options_from_info_plist(file_path))
172
+ end
173
+ when :android
174
+ if file_path = default_android_manifest_path
175
+ options.merge!(load_default_android_values(file_path))
176
+ end
177
+ else
178
+ if file_path = default_info_plist_path
179
+ options.merge!(options_from_info_plist(file_path))
180
+ end
173
181
  end
182
+
174
183
  if git_opts = git_remote_options
175
184
  options.merge!(git_opts)
176
185
  end
177
186
  options
178
187
  end
179
188
 
189
+ def self.load_default_android_values file_path
190
+ options = options_from_android_manifest(file_path)
191
+ build_gradle_path = Dir.glob("{android/,}app/build.gradle").first
192
+ build_gradle_path ||= Dir.glob("build.gradle").first
193
+ options.merge!(options_from_build_gradle(build_gradle_path)) if build_gradle_path
194
+ options
195
+ end
196
+
180
197
  def self.default_android_manifest_path
181
- Dir.glob("./{app,}/src/main/AndroidManifest.xml").first
198
+ Dir.glob("./{android/,}{app,}/src/main/AndroidManifest.xml").first
182
199
  end
183
200
 
184
201
  def self.default_info_plist_path
185
- Dir.glob("./*/Info.plist").first
202
+ Dir.glob("./{ios/,}*/Info.plist").reject {|path| path.include?('build/') }.first
186
203
  end
187
204
 
188
205
  def self.options_from_info_plist file_path
@@ -8,7 +8,7 @@ module Fastlane
8
8
  def self.run(params)
9
9
  parse_dsym_paths(params[:dsym_path]).each do |dsym_path|
10
10
  if dsym_path.end_with?(".zip") or File.directory?(dsym_path)
11
- args = upload_args(dsym_path, params[:symbol_maps_path], params[:upload_url])
11
+ args = upload_args(dsym_path, params[:symbol_maps_path], params[:upload_url], params[:project_root])
12
12
  success = Kernel.system(UPLOAD_SCRIPT_PATH, *args)
13
13
  UI.success("Uploaded dSYMs in #{dsym_path}") if success
14
14
  else
@@ -73,16 +73,22 @@ module Fastlane
73
73
  description: "Path to the BCSymbolMaps directory to build complete dSYM files",
74
74
  default_value: nil,
75
75
  optional: true,
76
- verify_block: validate_symbol_maps)
76
+ verify_block: validate_symbol_maps),
77
+ FastlaneCore::ConfigItem.new(key: :project_root,
78
+ env_name: "BUGSNAG_PROJECT_ROOT",
79
+ description: "Root path of the project",
80
+ default_value: Dir::pwd,
81
+ optional: true)
77
82
  ]
78
83
  end
79
84
 
80
85
  private
81
86
 
82
- def self.upload_args dir, symbol_maps_dir, upload_url
87
+ def self.upload_args dir, symbol_maps_dir, upload_url, project_root
83
88
  args = ["--silent"]
84
89
  args += ["--upload-server", upload_url] unless upload_url.nil?
85
90
  args += ["--symbol-maps", symbol_maps_dir] unless symbol_maps_dir.nil?
91
+ args += ["--project-root", project_root] unless project_root.nil?
86
92
  args << dir
87
93
  args
88
94
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Bugsnag
3
- VERSION = "1.2.1"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
@@ -75,6 +75,15 @@ describe Action do
75
75
  Action.run({dsym_path: [dsym1, dsym2]})
76
76
  end
77
77
 
78
+ it 'accepts a project root argument' do
79
+ root_path = "/test/test/test"
80
+ expect(Kernel).to receive(:system).with(Action::UPLOAD_SCRIPT_PATH,
81
+ "--silent",
82
+ "--project-root", root_path,
83
+ FIXTURE_PATH)
84
+ Action.run({dsym_path: FIXTURE_PATH, project_root: root_path})
85
+ end
86
+
78
87
  context 'using a private server' do
79
88
  it 'uploads to the private server' do
80
89
  expect(Kernel).to receive(:system).with(Action::UPLOAD_SCRIPT_PATH,
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.2.1
4
+ version: 1.3.0
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-01-12 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple