fastlane-plugin-emerge 0.3.1 → 0.4.1

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: c2f8a9346a1287446245c5388083f6f4faf27082ae763b3387b80003b1210f34
4
- data.tar.gz: 33f349c77e7c9b5a4eebec0501704db85d37c776f43d8bc6a94ed2d27a162248
3
+ metadata.gz: 06cb7ccc63c9a9b947b50d3e892d8f7a9d80ae52227b1eb2ec3686859e349d87
4
+ data.tar.gz: 1d78c2cfff077640ed1c7024596cbf115361392bb620edf9edc9fdd15c1da05f
5
5
  SHA512:
6
- metadata.gz: b692e0d3a5816a835aa904faa496b5114492850942f43ede61fa4f79b769e8446d119da5810b5c3e72aca9ae940353943f563cfc301a5528d6d3df5cbc887d61
7
- data.tar.gz: f0132eb0d9c8f98186fc2fbcbb3b54a89bc8f16e69beb2365831b1e107bb167f555ab38cda70e4368262a7ce4ab77a9147a6a8596351f45d4363fe9e5763c5df
6
+ metadata.gz: b219dda48c6c219179eec0691a6b21615eb68faf76e972e634ce15fb5c50c9d54c9a242224590409206a03177afbde4f50bbfaa2761c693832b03d108536e050
7
+ data.tar.gz: 655f1a31d098222c4e2248545c702a68680d58f2deffa9eaaeb7b0353c4e3c11a9ed1e530f41a56baec9c1494261a7d0a69f54aeb9e6f9c98394af5506a93c8a
@@ -3,6 +3,7 @@ require 'fastlane_core/print_table'
3
3
  require_relative '../helper/emerge_helper'
4
4
  require 'pathname'
5
5
  require 'tmpdir'
6
+ require 'json'
6
7
  require 'fileutils'
7
8
 
8
9
  module Fastlane
@@ -16,13 +17,14 @@ module Fastlane
16
17
  file_path = Dir.glob("#{lane_context[SharedValues::SCAN_DERIVED_DATA_PATH]}/Build/Products/Debug-iphonesimulator/*.app").first
17
18
  end
18
19
  pr_number = params[:pr_number]
19
- build_id = params[:build_id]
20
- base_build_id = params[:base_build_id]
20
+ branch = params[:branch]
21
+ sha = params[:sha] || params[:build_id]
22
+ base_sha = params[:base_sha] || params[:base_build_id]
21
23
  repo_name = params[:repo_name]
22
24
  gitlab_project_id = params[:gitlab_project_id]
23
25
  build_type = params[:build_type]
24
26
 
25
- if !File.exist?(file_path)
27
+ if file_path == nil || !File.exist?(file_path)
26
28
  UI.error("Invalid input file")
27
29
  return
28
30
  end
@@ -36,6 +38,13 @@ module Fastlane
36
38
  dsym_folder = "#{d}/archive.xcarchive/dSYMs/"
37
39
  FileUtils.mkdir_p application_folder
38
40
  FileUtils.mkdir_p dsym_folder
41
+ if params[:linkmaps] && params[:linkmaps].length > 0
42
+ linkmap_folder = "#{d}/archive.xcarchive/Linkmaps/"
43
+ FileUtils.mkdir_p(linkmap_folder)
44
+ params[:linkmaps].each do |l|
45
+ FileUtils.cp(l, linkmap_folder)
46
+ end
47
+ end
39
48
  FileUtils.cp_r(file_path, application_folder)
40
49
  copy_dsyms("#{absolute_path.dirname}/*.dsym", dsym_folder)
41
50
  copy_dsyms("#{absolute_path.dirname}/*/*.dsym", dsym_folder)
@@ -43,33 +52,49 @@ module Fastlane
43
52
  file_path = "#{absolute_path.dirname}/archive.xcarchive.zip"
44
53
  ZipAction.run(
45
54
  path: "#{d}/archive.xcarchive",
46
- output_path: file_path)
55
+ output_path: file_path,
56
+ exclude: [],
57
+ include: [])
47
58
  UI.message("Archive generated at #{file_path}")
48
59
  end
49
60
  elsif File.extname(file_path) == '.xcarchive'
50
61
  zip_path = file_path + ".zip"
62
+ if params[:linkmaps] && params[:linkmaps].length > 0
63
+ linkmap_folder = "#{file_path}/Linkmaps/"
64
+ FileUtils.mkdir_p(linkmap_folder)
65
+ params[:linkmaps].each do |l|
66
+ FileUtils.cp(l, linkmap_folder)
67
+ end
68
+ end
51
69
  Actions::ZipAction.run(
52
70
  path: file_path,
53
- output_path: zip_path)
71
+ output_path: zip_path,
72
+ exclude: [],
73
+ include: [])
54
74
  file_path = zip_path
75
+ elsif File.extname(file_path) == '.zip' && params[:linkmaps] && params[:linkmaps].length > 0
76
+ UI.error("Provided zipped archive and linkmaps, linkmaps will not be added to zip.")
55
77
  elsif !File.extname(file_path) == '.zip'
56
78
  UI.error("Invalid input file")
57
79
  return
58
80
  end
59
81
 
60
- fileName = File.basename(file_path)
61
- url = 'https://api.emergetools.com/getUpload'
82
+ filename = File.basename(file_path)
83
+ url = 'https://api.emergetools.com/upload'
62
84
  params = {
63
- fileName: fileName,
85
+ filename: filename,
64
86
  }
65
87
  if pr_number
66
88
  params[:prNumber] = pr_number
67
89
  end
68
- if build_id
69
- params[:buildId] = build_id
90
+ if branch
91
+ params[:branch] = branch
92
+ end
93
+ if sha
94
+ params[:sha] = sha
70
95
  end
71
- if base_build_id
72
- params[:baseBuildId] = base_build_id
96
+ if base_sha
97
+ params[:baseSha] = base_sha
73
98
  end
74
99
  if repo_name
75
100
  params[:repoName] = repo_name
@@ -82,7 +107,7 @@ module Fastlane
82
107
  config: params,
83
108
  hide_keys: [],
84
109
  title: "Summary for Emerge #{Fastlane::Emerge::VERSION}")
85
- resp = Faraday.get(url, params, {'X-API-Token' => api_token})
110
+ resp = Faraday.post(url, params.to_json, {'Content-Type' => 'application/json', 'X-API-Token' => api_token})
86
111
  case resp.status
87
112
  when 200
88
113
  json = JSON.parse(resp.body)
@@ -136,16 +161,34 @@ module Fastlane
136
161
  description: "Path to the zipped xcarchive or app to upload",
137
162
  optional: true,
138
163
  type: String),
164
+ FastlaneCore::ConfigItem.new(key: :linkmaps,
165
+ description: "List of paths to linkmaps",
166
+ optional: true,
167
+ type: Array),
139
168
  FastlaneCore::ConfigItem.new(key: :pr_number,
140
169
  description: "The PR number that triggered this upload",
141
170
  optional: true,
142
171
  type: String),
172
+ FastlaneCore::ConfigItem.new(key: :branch,
173
+ description: "The current git branch",
174
+ optional: true,
175
+ type: String),
176
+ FastlaneCore::ConfigItem.new(key: :sha,
177
+ description: "The git SHA that triggered this build",
178
+ optional: true,
179
+ type: String),
180
+ FastlaneCore::ConfigItem.new(key: :base_sha,
181
+ description: "The git SHA of the base build. This parameter does not need to be set if you’re using the Github integration",
182
+ optional: true,
183
+ type: String),
143
184
  FastlaneCore::ConfigItem.new(key: :build_id,
144
185
  description: "A string to identify this build",
186
+ deprecated: "Replaced by `sha`",
145
187
  optional: true,
146
188
  type: String),
147
189
  FastlaneCore::ConfigItem.new(key: :base_build_id,
148
190
  description: "Id of the build to compare with this upload",
191
+ deprecated: "Replaced by `base_sha`",
149
192
  optional: true,
150
193
  type: String),
151
194
  FastlaneCore::ConfigItem.new(key: :repo_name,
@@ -157,7 +200,7 @@ module Fastlane
157
200
  optional: true,
158
201
  type: Integer),
159
202
  FastlaneCore::ConfigItem.new(key: :build_type,
160
- description: "Type of build, either release or development. Defaults to development",
203
+ description: "String to identify the type of build such as release/development. Used to filter size graphs. Defaults to development",
161
204
  optional: true,
162
205
  type: String)
163
206
  ]
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Emerge
3
- VERSION = "0.3.1"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-emerge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emerge Tools, Inc
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-16 00:00:00.000000000 Z
11
+ date: 2022-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: '1.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -150,8 +150,8 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: 2.170.0
153
- description:
154
- email:
153
+ description:
154
+ email:
155
155
  executables: []
156
156
  extensions: []
157
157
  extra_rdoc_files: []
@@ -167,7 +167,7 @@ homepage: https://github.com/EmergeTools/fastlane-plugin-emerge
167
167
  licenses:
168
168
  - MIT
169
169
  metadata: {}
170
- post_install_message:
170
+ post_install_message:
171
171
  rdoc_options: []
172
172
  require_paths:
173
173
  - lib
@@ -182,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
- rubygems_version: 3.0.3
186
- signing_key:
185
+ rubygems_version: 3.2.3
186
+ signing_key:
187
187
  specification_version: 4
188
188
  summary: Fastlane plugin for Emerge
189
189
  test_files: []