ocean_package 0.16.0 → 0.17.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ocean_package/command.rb +43 -1
- data/lib/ocean_package/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 637039069377b11f47969195b4475e5a43cc6b1be2ffacc14ecf6560df2f1605
|
4
|
+
data.tar.gz: d67605f811908a1e9a618a6a24b41eef85e6b9e9f00ae00b6b47a7dd5d2e317e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 862d453052e203c6e0ed8d059b14cc43c56ad61fac6be162baac34d53f587e0aff04b08d4e206ed1bca30d7f000751abe0b1f9eeb8e35ec707d29ded1a9c7f5c
|
7
|
+
data.tar.gz: b0786cf6887ed1b7750c0d7af7958e820d976f36df93a37da66284eff52e3118fb80e9a5753b8d11462995addf5cc48fecb74442fb510dbe9b0c4d1135d05dbd
|
data/Gemfile.lock
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
module OceanPackage
|
3
3
|
class Command
|
4
4
|
include OceanPackage::TimeFlow::Mixin
|
5
|
+
require 'net/http'
|
5
6
|
|
6
7
|
# xcodebuild 打包相关
|
7
8
|
attr_accessor :package
|
@@ -26,6 +27,11 @@ module OceanPackage
|
|
26
27
|
# 自定义的ipa文件路径
|
27
28
|
attr_accessor :custom_ipa_file_path
|
28
29
|
|
30
|
+
# 整个流程时间记录上报url
|
31
|
+
attr_accessor :time_flow_url
|
32
|
+
|
33
|
+
# 整个流程时间记录上报url,额外的参数
|
34
|
+
attr_accessor :time_flow_extra_req
|
29
35
|
|
30
36
|
def initialize(params = [])
|
31
37
|
argv = CLAide::ARGV.new(params)
|
@@ -63,6 +69,14 @@ module OceanPackage
|
|
63
69
|
open_finder = argv.flag?("open-finder", false )
|
64
70
|
Log.info("open-finder: #{open_finder}")
|
65
71
|
|
72
|
+
time_flow_url = argv.option("time-flow-url", "")
|
73
|
+
Log.info("time_flow_url: #{time_flow_url}")
|
74
|
+
@time_flow_url = time_flow_url
|
75
|
+
|
76
|
+
time_flow_extra_req = argv.option("time-flow-extra-req", "")
|
77
|
+
Log.info("time_flow_extra_req: #{time_flow_extra_req}")
|
78
|
+
@time_flow_extra_req = time_flow_extra_req
|
79
|
+
|
66
80
|
# 自定义ipa文件,使用该文件作为 archive path
|
67
81
|
tmp_archive_path = has_custom_ipa_file ? File.dirname("#{ipa_file_path}") : archive_path
|
68
82
|
Log.info("tmp_archive_path: #{tmp_archive_path}")
|
@@ -253,7 +267,6 @@ module OceanPackage
|
|
253
267
|
time_flow_dir = @package.final_archive_path
|
254
268
|
time_flow_file_path = "#{time_flow_dir}timeflow.json"
|
255
269
|
params = time_flow.make_all_points
|
256
|
-
params['timeFlowPath'] = time_flow_file_path
|
257
270
|
json = JSON.dump(params)
|
258
271
|
|
259
272
|
unless File.exist?(time_flow_file_path)
|
@@ -266,6 +279,35 @@ module OceanPackage
|
|
266
279
|
else
|
267
280
|
Log.error("write time flow to path(fail): #{time_flow_file_path}")
|
268
281
|
end
|
282
|
+
|
283
|
+
upload_time_flow_data(params)
|
284
|
+
end
|
285
|
+
|
286
|
+
def upload_time_flow_data(data)
|
287
|
+
time_flow_url_value = "#{@time_flow_url}"
|
288
|
+
unless time_flow_url_value.empty?
|
289
|
+
Log.info("upload time flow data")
|
290
|
+
|
291
|
+
uri = URI.parse(time_flow_url_value)
|
292
|
+
params = data
|
293
|
+
|
294
|
+
# 分割
|
295
|
+
extra_params = "#{@time_flow_extra_req}".split(",")
|
296
|
+
# 再拼接
|
297
|
+
extra_params.each do |p|
|
298
|
+
extra_key_values = "#{p}".split("=")
|
299
|
+
if extra_key_values.length == 2
|
300
|
+
extra_key = "#{extra_key_values[0]}"
|
301
|
+
extra_value = "#{extra_key_values[1]}"
|
302
|
+
if extra_key.length > 0 && extra_value.length > 0
|
303
|
+
params[extra_key] = extra_value
|
304
|
+
end
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
res = Net::HTTP.post_form(uri, params)
|
309
|
+
Log.info("upload time flow data result: #{res.body}")
|
310
|
+
end
|
269
311
|
end
|
270
312
|
|
271
313
|
end
|