fastlane-plugin-emerge 0.3.0 → 0.4.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47c07cc0fbda1c835f0ae0f3b1719aea68de191a28d614d4d2552835a611c90c
|
4
|
+
data.tar.gz: 13b5463f6997f22e1ed988929b3a3a7c40913ee6f91725a7bef0dbafd2cc03fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37f44ee6483d12df8a2e0a7493f3955cce64852aa0aad5465a3036c9c3deb7784c2e171359ccebe2d249e0911c542cfa05ff96ef246228ea18afe965b63cc251
|
7
|
+
data.tar.gz: fd22b473450105e6e8e736f4f5d4db31fbcb3b71c64ace912f99b7b929f26d18fad1230cff744461afcdf52e8c36c501ca79388329c8dc4fd512dd8dfdf69122
|
@@ -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
|
@@ -37,41 +39,46 @@ module Fastlane
|
|
37
39
|
FileUtils.mkdir_p application_folder
|
38
40
|
FileUtils.mkdir_p dsym_folder
|
39
41
|
FileUtils.cp_r(file_path, application_folder)
|
40
|
-
|
41
|
-
|
42
|
-
FileUtils.cp_r(filename, dsym_folder)
|
43
|
-
end
|
42
|
+
copy_dsyms("#{absolute_path.dirname}/*.dsym", dsym_folder)
|
43
|
+
copy_dsyms("#{absolute_path.dirname}/*/*.dsym", dsym_folder)
|
44
44
|
Xcodeproj::Plist.write_to_path({"NAME" => "Emerge Upload"}, "#{d}/archive.xcarchive/Info.plist")
|
45
45
|
file_path = "#{absolute_path.dirname}/archive.xcarchive.zip"
|
46
46
|
ZipAction.run(
|
47
47
|
path: "#{d}/archive.xcarchive",
|
48
|
-
output_path: file_path
|
48
|
+
output_path: file_path,
|
49
|
+
exclude: [],
|
50
|
+
include: [])
|
49
51
|
UI.message("Archive generated at #{file_path}")
|
50
52
|
end
|
51
53
|
elsif File.extname(file_path) == '.xcarchive'
|
52
54
|
zip_path = file_path + ".zip"
|
53
55
|
Actions::ZipAction.run(
|
54
56
|
path: file_path,
|
55
|
-
output_path: zip_path
|
57
|
+
output_path: zip_path,
|
58
|
+
exclude: [],
|
59
|
+
include: [])
|
56
60
|
file_path = zip_path
|
57
61
|
elsif !File.extname(file_path) == '.zip'
|
58
62
|
UI.error("Invalid input file")
|
59
63
|
return
|
60
64
|
end
|
61
65
|
|
62
|
-
|
63
|
-
url = 'https://api.emergetools.com/
|
66
|
+
filename = File.basename(file_path)
|
67
|
+
url = 'https://api.emergetools.com/upload'
|
64
68
|
params = {
|
65
|
-
|
69
|
+
filename: filename,
|
66
70
|
}
|
67
71
|
if pr_number
|
68
72
|
params[:prNumber] = pr_number
|
69
73
|
end
|
70
|
-
if
|
71
|
-
params[:
|
74
|
+
if branch
|
75
|
+
params[:branch] = branch
|
72
76
|
end
|
73
|
-
if
|
74
|
-
params[:
|
77
|
+
if sha
|
78
|
+
params[:sha] = sha
|
79
|
+
end
|
80
|
+
if base_sha
|
81
|
+
params[:baseSha] = base_sha
|
75
82
|
end
|
76
83
|
if repo_name
|
77
84
|
params[:repoName] = repo_name
|
@@ -84,7 +91,7 @@ module Fastlane
|
|
84
91
|
config: params,
|
85
92
|
hide_keys: [],
|
86
93
|
title: "Summary for Emerge #{Fastlane::Emerge::VERSION}")
|
87
|
-
resp = Faraday.
|
94
|
+
resp = Faraday.post(url, params.to_json, {'Content-Type' => 'application/json', 'X-API-Token' => api_token})
|
88
95
|
case resp.status
|
89
96
|
when 200
|
90
97
|
json = JSON.parse(resp.body)
|
@@ -102,6 +109,13 @@ module Fastlane
|
|
102
109
|
end
|
103
110
|
end
|
104
111
|
|
112
|
+
def self.copy_dsyms(from, to)
|
113
|
+
Dir.glob(from) do |filename|
|
114
|
+
UI.message("Found dSYM: #{Pathname.new(filename).basename}")
|
115
|
+
FileUtils.cp_r(filename, to)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
105
119
|
def self.description
|
106
120
|
"Fastlane plugin for Emerge"
|
107
121
|
end
|
@@ -135,12 +149,26 @@ module Fastlane
|
|
135
149
|
description: "The PR number that triggered this upload",
|
136
150
|
optional: true,
|
137
151
|
type: String),
|
152
|
+
FastlaneCore::ConfigItem.new(key: :branch,
|
153
|
+
description: "The current git branch",
|
154
|
+
optional: true,
|
155
|
+
type: String),
|
156
|
+
FastlaneCore::ConfigItem.new(key: :sha,
|
157
|
+
description: "The git SHA that triggered this build",
|
158
|
+
optional: true,
|
159
|
+
type: String),
|
160
|
+
FastlaneCore::ConfigItem.new(key: :base_sha,
|
161
|
+
description: "The git SHA of the base build. This parameter does not need to be set if you’re using the Github integration",
|
162
|
+
optional: true,
|
163
|
+
type: String),
|
138
164
|
FastlaneCore::ConfigItem.new(key: :build_id,
|
139
165
|
description: "A string to identify this build",
|
166
|
+
deprecated: "Replaced by `sha`",
|
140
167
|
optional: true,
|
141
168
|
type: String),
|
142
169
|
FastlaneCore::ConfigItem.new(key: :base_build_id,
|
143
170
|
description: "Id of the build to compare with this upload",
|
171
|
+
deprecated: "Replaced by `base_sha`",
|
144
172
|
optional: true,
|
145
173
|
type: String),
|
146
174
|
FastlaneCore::ConfigItem.new(key: :repo_name,
|
@@ -152,7 +180,7 @@ module Fastlane
|
|
152
180
|
optional: true,
|
153
181
|
type: Integer),
|
154
182
|
FastlaneCore::ConfigItem.new(key: :build_type,
|
155
|
-
description: "
|
183
|
+
description: "String to identify the type of build such as release/development. Used to filter size graphs. Defaults to development",
|
156
184
|
optional: true,
|
157
185
|
type: String)
|
158
186
|
]
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emerge Tools, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-15 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
|
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
|
26
|
+
version: '1.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|