fastlane-plugin-emerge 0.3.3 → 0.5.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: 86bc85e26613527f77ae725575824b2d4c2dd5dde9ab0814f716ab8efd4875c0
|
4
|
+
data.tar.gz: 3fcd9202ed9ca7d5ff16b221ad9c9d0e0e7af1cc2febbadb6e8f96cf8c498ca6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 330252fc7c00bdba4a91bd9a206dad404886c8d99631a3cc3da5efe6ee1b55e46cc0e298441fa54f5807f881cb395baf3fe3400da63c983b13182f9c25d52e2b
|
7
|
+
data.tar.gz: abce90f5e848cad8c840f0d94130518ed318b776af6543d75bc73105dac295667fabf4aaff68aa06e72ae00a89956eec7f725ed54d06d460005fe396dfa3723f
|
@@ -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
|
-
|
20
|
-
|
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)
|
@@ -50,30 +59,42 @@ module Fastlane
|
|
50
59
|
end
|
51
60
|
elsif File.extname(file_path) == '.xcarchive'
|
52
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
|
53
69
|
Actions::ZipAction.run(
|
54
70
|
path: file_path,
|
55
71
|
output_path: zip_path,
|
56
72
|
exclude: [],
|
57
73
|
include: [])
|
58
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.")
|
59
77
|
elsif !File.extname(file_path) == '.zip'
|
60
78
|
UI.error("Invalid input file")
|
61
79
|
return
|
62
80
|
end
|
63
81
|
|
64
|
-
|
65
|
-
url = 'https://api.emergetools.com/
|
82
|
+
filename = File.basename(file_path)
|
83
|
+
url = 'https://api.emergetools.com/upload'
|
66
84
|
params = {
|
67
|
-
|
85
|
+
filename: filename,
|
68
86
|
}
|
69
87
|
if pr_number
|
70
88
|
params[:prNumber] = pr_number
|
71
89
|
end
|
72
|
-
if
|
73
|
-
params[:
|
90
|
+
if branch
|
91
|
+
params[:branch] = branch
|
92
|
+
end
|
93
|
+
if sha
|
94
|
+
params[:sha] = sha
|
74
95
|
end
|
75
|
-
if
|
76
|
-
params[:
|
96
|
+
if base_sha
|
97
|
+
params[:baseSha] = base_sha
|
77
98
|
end
|
78
99
|
if repo_name
|
79
100
|
params[:repoName] = repo_name
|
@@ -86,7 +107,7 @@ module Fastlane
|
|
86
107
|
config: params,
|
87
108
|
hide_keys: [],
|
88
109
|
title: "Summary for Emerge #{Fastlane::Emerge::VERSION}")
|
89
|
-
resp = Faraday.
|
110
|
+
resp = Faraday.post(url, params.to_json, {'Content-Type' => 'application/json', 'X-API-Token' => api_token})
|
90
111
|
case resp.status
|
91
112
|
when 200
|
92
113
|
json = JSON.parse(resp.body)
|
@@ -140,16 +161,34 @@ module Fastlane
|
|
140
161
|
description: "Path to the zipped xcarchive or app to upload",
|
141
162
|
optional: true,
|
142
163
|
type: String),
|
164
|
+
FastlaneCore::ConfigItem.new(key: :linkmaps,
|
165
|
+
description: "List of paths to linkmaps",
|
166
|
+
optional: true,
|
167
|
+
type: Array),
|
143
168
|
FastlaneCore::ConfigItem.new(key: :pr_number,
|
144
169
|
description: "The PR number that triggered this upload",
|
145
170
|
optional: true,
|
146
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),
|
147
184
|
FastlaneCore::ConfigItem.new(key: :build_id,
|
148
185
|
description: "A string to identify this build",
|
186
|
+
deprecated: "Replaced by `sha`",
|
149
187
|
optional: true,
|
150
188
|
type: String),
|
151
189
|
FastlaneCore::ConfigItem.new(key: :base_build_id,
|
152
190
|
description: "Id of the build to compare with this upload",
|
191
|
+
deprecated: "Replaced by `base_sha`",
|
153
192
|
optional: true,
|
154
193
|
type: String),
|
155
194
|
FastlaneCore::ConfigItem.new(key: :repo_name,
|
@@ -161,7 +200,7 @@ module Fastlane
|
|
161
200
|
optional: true,
|
162
201
|
type: Integer),
|
163
202
|
FastlaneCore::ConfigItem.new(key: :build_type,
|
164
|
-
description: "
|
203
|
+
description: "String to identify the type of build such as release/development. Used to filter size graphs. Defaults to development",
|
165
204
|
optional: true,
|
166
205
|
type: String)
|
167
206
|
]
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require 'tmpdir'
|
3
|
+
require 'tempfile'
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
module Fastlane
|
7
|
+
module Actions
|
8
|
+
class EmergeOrderFileAction < Action
|
9
|
+
def self.run(params)
|
10
|
+
resp = Faraday.get("https://order-files-prod.emergetools.com/#{params[:app_id]}", nil, {'X-API-Token' => params[:api_token]})
|
11
|
+
case resp.status
|
12
|
+
when 200
|
13
|
+
Tempfile.create do |f|
|
14
|
+
f.write(resp.body)
|
15
|
+
decompressed = IO.popen(['gunzip', '-c', f.path]).read
|
16
|
+
IO.write(params[:output_path], decompressed)
|
17
|
+
end
|
18
|
+
when 401
|
19
|
+
UI.error("Unauthorized")
|
20
|
+
else
|
21
|
+
UI.error("Failed to download order file code: #{resp.status}")
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
def self.description
|
26
|
+
"Fastlane plugin to download order files"
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.authors
|
30
|
+
["Emerge Tools"]
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.return_value
|
34
|
+
# If your method provides a return value, you can describe here what it does
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.details
|
38
|
+
# Optional:
|
39
|
+
""
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.available_options
|
43
|
+
[
|
44
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
45
|
+
env_name: "EMERGE_API_TOKEN",
|
46
|
+
description: "An API token for Emerge",
|
47
|
+
optional: false,
|
48
|
+
type: String),
|
49
|
+
FastlaneCore::ConfigItem.new(key: :app_id,
|
50
|
+
description: "Id of the app being built with the order file",
|
51
|
+
optional: false,
|
52
|
+
type: String),
|
53
|
+
FastlaneCore::ConfigItem.new(key: :output_path,
|
54
|
+
description: "Path to the order file",
|
55
|
+
optional: false,
|
56
|
+
type: String)
|
57
|
+
]
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.is_supported?(platform)
|
61
|
+
platform == :ios
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
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.
|
4
|
+
version: 0.5.0
|
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:
|
11
|
+
date: 2022-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -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: []
|
@@ -161,13 +161,14 @@ files:
|
|
161
161
|
- lib/fastlane/plugin/emerge.rb
|
162
162
|
- lib/fastlane/plugin/emerge/actions/emerge_action.rb
|
163
163
|
- lib/fastlane/plugin/emerge/actions/emerge_comment_action.rb
|
164
|
+
- lib/fastlane/plugin/emerge/actions/emerge_order_file_action.rb
|
164
165
|
- lib/fastlane/plugin/emerge/helper/emerge_helper.rb
|
165
166
|
- lib/fastlane/plugin/emerge/version.rb
|
166
167
|
homepage: https://github.com/EmergeTools/fastlane-plugin-emerge
|
167
168
|
licenses:
|
168
169
|
- MIT
|
169
170
|
metadata: {}
|
170
|
-
post_install_message:
|
171
|
+
post_install_message:
|
171
172
|
rdoc_options: []
|
172
173
|
require_paths:
|
173
174
|
- lib
|
@@ -182,8 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
183
|
- !ruby/object:Gem::Version
|
183
184
|
version: '0'
|
184
185
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
186
|
-
signing_key:
|
186
|
+
rubygems_version: 3.2.3
|
187
|
+
signing_key:
|
187
188
|
specification_version: 4
|
188
189
|
summary: Fastlane plugin for Emerge
|
189
190
|
test_files: []
|