luna-binary-uploader 0.1.20 → 0.1.24
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/bin/lbu +18 -1
- data/lib/luna/binary/benchmark.rb +106 -0
- data/lib/luna/binary/update.rb +7 -2
- data/lib/luna/binary/uploader/version.rb +1 -1
- data/lib/luna-binary-uploader.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 116426b3ff192fe626ed285d524284bf5fad7a33c82ce59b3d43c4ce7204c62a
|
4
|
+
data.tar.gz: c07ff3d27936481b281771b1a4aa82dacef88a87384b78f04eb11cb6c8eeeb58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 541c3bcbe9802971456300bff08f6818c0055234f3302132d3d61c2dfb50f40ec227e5b0e74a38b7f4a2b284189239985a995616f402aeb4d3dffb5787306369
|
7
|
+
data.tar.gz: 4de07acdddd8808404e866c54a7517de3c3761155f7dbbe9392fba2ec2698372c650bd5d29bcf51f1d56502d1e1ed22400f72e0d4e24a2c838ff2c9d6df3c65c
|
data/Gemfile.lock
CHANGED
data/bin/lbu
CHANGED
@@ -66,9 +66,10 @@ class App
|
|
66
66
|
arg_name '只接参数n, 表示不用二进制 '
|
67
67
|
command :install do |c|
|
68
68
|
c.action do |global_options,options,args|
|
69
|
-
is_open = "false"
|
70
69
|
if args[0] && args[0] != "n"
|
71
70
|
raise "只接参数n, 表示不用二进制"
|
71
|
+
elsif args[0] && args[0] == "n"
|
72
|
+
is_open = "false"
|
72
73
|
else
|
73
74
|
is_open = "true"
|
74
75
|
end
|
@@ -198,6 +199,22 @@ class App
|
|
198
199
|
end
|
199
200
|
end
|
200
201
|
|
202
|
+
desc 'benchmark 二进制和非二进制'
|
203
|
+
arg_name '1.跑工程几次 2.workspace 3.scheme 4.normal正常模式下 binary二进制模式下,不传的话都跑'
|
204
|
+
command :benchmark do |c|
|
205
|
+
c.action do |global_options,options,args|
|
206
|
+
obj = Luna::Binary::BenchMark.new(Integer(args[0]), args[1], args[2])
|
207
|
+
if args[3] == "normal"
|
208
|
+
obj.run_no_binary
|
209
|
+
elsif args[3] == "binary"
|
210
|
+
obj.run_binary
|
211
|
+
else
|
212
|
+
obj.run
|
213
|
+
end
|
214
|
+
obj.print
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
201
218
|
pre do |global,command,options,args|
|
202
219
|
# Pre logic here
|
203
220
|
# Return true to proceed; false to abort and not call the
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'date'
|
2
|
+
require "luna/binary/uploader/version"
|
3
|
+
require "cocoapods"
|
4
|
+
require 'cocoapods-imy-bin/native/sources_manager'
|
5
|
+
require 'cocoapods-imy-bin/config/config'
|
6
|
+
require 'cocoapods-imy-bin'
|
7
|
+
require 'json'
|
8
|
+
require 'luna/binary/common/common'
|
9
|
+
|
10
|
+
|
11
|
+
module Luna
|
12
|
+
module Binary
|
13
|
+
|
14
|
+
class DogTimer
|
15
|
+
|
16
|
+
attr_accessor :start_time
|
17
|
+
attr_accessor :end_time
|
18
|
+
attr_accessor :delta_time
|
19
|
+
def initialize()
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def start
|
24
|
+
@start_time = Time.now()
|
25
|
+
puts start_time
|
26
|
+
end
|
27
|
+
|
28
|
+
def end
|
29
|
+
@end_time = Time.now()
|
30
|
+
puts end_time
|
31
|
+
end
|
32
|
+
|
33
|
+
def delta
|
34
|
+
@delta_time = @end_time - @start_time
|
35
|
+
end
|
36
|
+
|
37
|
+
def print
|
38
|
+
puts "start time: #{start_time.inspect} end time: #{end_time.inspect} delta time: #{delta}s ".yellow
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class BenchMark
|
43
|
+
attr_reader :times
|
44
|
+
attr_reader :workspace
|
45
|
+
attr_reader :scheme
|
46
|
+
attr_reader :binary_time_arr
|
47
|
+
attr_reader :normal_time_arr
|
48
|
+
|
49
|
+
def initialize(times, workspace, scheme)
|
50
|
+
@times = times
|
51
|
+
@workspace = workspace
|
52
|
+
@scheme = scheme
|
53
|
+
@binary_time_arr = []
|
54
|
+
@normal_time_arr = []
|
55
|
+
end
|
56
|
+
|
57
|
+
def run
|
58
|
+
run_binary
|
59
|
+
run_no_binary
|
60
|
+
end
|
61
|
+
|
62
|
+
def run_binary
|
63
|
+
Common.instance.command("lbu install")
|
64
|
+
run_project(binary_time_arr)
|
65
|
+
end
|
66
|
+
|
67
|
+
def run_no_binary
|
68
|
+
Common.instance.command("lbu install n")
|
69
|
+
run_project(normal_time_arr)
|
70
|
+
end
|
71
|
+
|
72
|
+
def run_project(arr)
|
73
|
+
i = 0
|
74
|
+
while i < times
|
75
|
+
Common.instance.command("xcodebuild clean -quiet -workspace #{workspace} -scheme #{scheme} -configuration Debug")
|
76
|
+
t = DogTimer.new()
|
77
|
+
t.start
|
78
|
+
Common.instance.command("xcodebuild -workspace #{workspace} -scheme #{scheme} -configuration Debug")
|
79
|
+
t.end
|
80
|
+
arr << t
|
81
|
+
i = i + 1
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
|
86
|
+
def print
|
87
|
+
print_time_arr(normal_time_arr, "normal average time:")
|
88
|
+
print_time_arr(binary_time_arr, "binary average time:")
|
89
|
+
end
|
90
|
+
|
91
|
+
def print_time_arr(time_arr, attention)
|
92
|
+
i = 0
|
93
|
+
sum_time = 0
|
94
|
+
time_arr.each { |item|
|
95
|
+
item.print
|
96
|
+
sum_time += item.delta
|
97
|
+
i += 1
|
98
|
+
}
|
99
|
+
puts "#{attention} #{sum_time/i}" if sum_time > 0
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
data/lib/luna/binary/update.rb
CHANGED
@@ -29,15 +29,20 @@ module Luna
|
|
29
29
|
|
30
30
|
end
|
31
31
|
else
|
32
|
-
failList << "已存在name: #{k}"
|
32
|
+
failList << "已存在name: #{k} version #{v} 的framework"
|
33
33
|
end
|
34
34
|
}
|
35
35
|
puts "-=-=-=-=-=-=-=-=framework制作中-=-=-=-=-=-=-=-=-=-=".yellow
|
36
36
|
successList.each { |item|
|
37
|
-
puts "#{item} 制作中".yellow
|
37
|
+
puts "#{item.podspecName} 制作中".yellow
|
38
38
|
item.upload
|
39
39
|
}
|
40
40
|
|
41
|
+
puts "-=-=-=-=-=-=-=-=更新成功名单-=-=-=-=-=-=-=-=-=-=".yellow
|
42
|
+
successList.each { |item|
|
43
|
+
puts "#{item.podspecName}".yellow
|
44
|
+
}
|
45
|
+
|
41
46
|
puts "-=-=-=-=-=-=-=-=update 失败名单-=-=-=-=-=-=-=-=-=-=".yellow if failList.length > 0
|
42
47
|
failList.each {|item|
|
43
48
|
puts item.red
|
data/lib/luna-binary-uploader.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luna-binary-uploader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 车德超
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- bin/setup
|
142
142
|
- lib/luna-binary-uploader.rb
|
143
143
|
- lib/luna/binary/analysis.rb
|
144
|
+
- lib/luna/binary/benchmark.rb
|
144
145
|
- lib/luna/binary/build.rb
|
145
146
|
- lib/luna/binary/common/common.rb
|
146
147
|
- lib/luna/binary/delete.rb
|