luna-binary-uploader 0.1.16 → 0.1.20
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/.gitignore +0 -1
- data/Gemfile.lock +174 -0
- data/bin/lbu +44 -10
- data/lib/luna/binary/analysis.rb +46 -84
- data/lib/luna/binary/build.rb +31 -24
- data/lib/luna/binary/common/common.rb +141 -16
- data/lib/luna/binary/delete.rb +4 -4
- data/lib/luna/binary/init.rb +25 -0
- data/lib/luna/binary/install.rb +38 -0
- data/lib/luna/binary/refresh.rb +39 -30
- data/lib/luna/binary/update.rb +21 -81
- data/lib/luna/binary/uploader/version.rb +1 -1
- data/lib/luna/binary/uploader.rb +52 -21
- data/lib/luna-binary-uploader.rb +9 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ef5b62bf685747e70e13f3ea5480f37cb303dfe1b37cb66690baa8beee4ec3e
|
4
|
+
data.tar.gz: 9366ecb00ae20f321afce1b2ccc319793be0f4291c7e4ba4d900f0ad983f5f80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 253788b801070db954121214fb1c9f1cbf4363350dfd2861716d8aeb68ff29f1fcffe1910b86b5ecd29f5b53d6966ab7b6db7481f837379a15d5d06f1b5af9ca
|
7
|
+
data.tar.gz: 2d6038f930cb1ded0bc343f7d747a913fd7a7d3d1e6c21b4b11808c118a5311bb7b41163f1c8f91fdd9a3be47f1afd6af13be78bbdd0ea43212bd175a2170039
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
luna-binary-uploader (0.1.17)
|
5
|
+
cocoapods
|
6
|
+
cocoapods-generate (~> 2.0.1)
|
7
|
+
cocoapods-imy-bin (= 0.3.1.3)
|
8
|
+
gli (= 2.19.0)
|
9
|
+
parallel
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
CFPropertyList (3.0.4)
|
15
|
+
rexml
|
16
|
+
activesupport (6.1.4.1)
|
17
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
+
i18n (>= 1.6, < 2)
|
19
|
+
minitest (>= 5.1)
|
20
|
+
tzinfo (~> 2.0)
|
21
|
+
zeitwerk (~> 2.3)
|
22
|
+
addressable (2.8.0)
|
23
|
+
public_suffix (>= 2.0.2, < 5.0)
|
24
|
+
algoliasearch (1.27.5)
|
25
|
+
httpclient (~> 2.8, >= 2.8.3)
|
26
|
+
json (>= 1.5.1)
|
27
|
+
aruba (2.0.0)
|
28
|
+
bundler (>= 1.17, < 3.0)
|
29
|
+
childprocess (>= 2.0, < 5.0)
|
30
|
+
contracts (>= 0.16.0, < 0.18.0)
|
31
|
+
cucumber (>= 4.0, < 8.0)
|
32
|
+
rspec-expectations (~> 3.4)
|
33
|
+
thor (~> 1.0)
|
34
|
+
atomos (0.1.3)
|
35
|
+
builder (3.2.4)
|
36
|
+
childprocess (4.1.0)
|
37
|
+
claide (1.0.3)
|
38
|
+
cocoapods (1.11.2)
|
39
|
+
addressable (~> 2.8)
|
40
|
+
claide (>= 1.0.2, < 2.0)
|
41
|
+
cocoapods-core (= 1.11.2)
|
42
|
+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
43
|
+
cocoapods-downloader (>= 1.4.0, < 2.0)
|
44
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
45
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
46
|
+
cocoapods-trunk (>= 1.4.0, < 2.0)
|
47
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
48
|
+
colored2 (~> 3.1)
|
49
|
+
escape (~> 0.0.4)
|
50
|
+
fourflusher (>= 2.3.0, < 3.0)
|
51
|
+
gh_inspector (~> 1.0)
|
52
|
+
molinillo (~> 0.8.0)
|
53
|
+
nap (~> 1.0)
|
54
|
+
ruby-macho (>= 1.0, < 3.0)
|
55
|
+
xcodeproj (>= 1.21.0, < 2.0)
|
56
|
+
cocoapods-core (1.11.2)
|
57
|
+
activesupport (>= 5.0, < 7)
|
58
|
+
addressable (~> 2.8)
|
59
|
+
algoliasearch (~> 1.0)
|
60
|
+
concurrent-ruby (~> 1.1)
|
61
|
+
fuzzy_match (~> 2.0.4)
|
62
|
+
nap (~> 1.0)
|
63
|
+
netrc (~> 0.11)
|
64
|
+
public_suffix (~> 4.0)
|
65
|
+
typhoeus (~> 1.0)
|
66
|
+
cocoapods-deintegrate (1.0.5)
|
67
|
+
cocoapods-disable-podfile-validations (0.1.1)
|
68
|
+
cocoapods-downloader (1.5.1)
|
69
|
+
cocoapods-generate (2.0.1)
|
70
|
+
cocoapods-disable-podfile-validations (~> 0.1.1)
|
71
|
+
cocoapods-imy-bin (0.3.1.3)
|
72
|
+
cocoapods
|
73
|
+
cocoapods-generate (~> 2.0.0)
|
74
|
+
parallel
|
75
|
+
cocoapods-plugins (1.0.0)
|
76
|
+
nap
|
77
|
+
cocoapods-search (1.0.1)
|
78
|
+
cocoapods-trunk (1.6.0)
|
79
|
+
nap (>= 0.8, < 2.0)
|
80
|
+
netrc (~> 0.11)
|
81
|
+
cocoapods-try (1.2.0)
|
82
|
+
colored2 (3.1.2)
|
83
|
+
concurrent-ruby (1.1.9)
|
84
|
+
contracts (0.16.1)
|
85
|
+
cucumber (7.1.0)
|
86
|
+
builder (~> 3.2, >= 3.2.4)
|
87
|
+
cucumber-core (~> 10.1, >= 10.1.0)
|
88
|
+
cucumber-create-meta (~> 6.0, >= 6.0.1)
|
89
|
+
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
|
90
|
+
cucumber-gherkin (~> 22.0, >= 22.0.0)
|
91
|
+
cucumber-html-formatter (~> 17.0, >= 17.0.0)
|
92
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
93
|
+
cucumber-wire (~> 6.2, >= 6.2.0)
|
94
|
+
diff-lcs (~> 1.4, >= 1.4.4)
|
95
|
+
mime-types (~> 3.3, >= 3.3.1)
|
96
|
+
multi_test (~> 0.1, >= 0.1.2)
|
97
|
+
sys-uname (~> 1.2, >= 1.2.2)
|
98
|
+
cucumber-core (10.1.0)
|
99
|
+
cucumber-gherkin (~> 22.0, >= 22.0.0)
|
100
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
101
|
+
cucumber-tag-expressions (~> 4.0, >= 4.0.2)
|
102
|
+
cucumber-create-meta (6.0.2)
|
103
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
104
|
+
sys-uname (~> 1.2, >= 1.2.2)
|
105
|
+
cucumber-cucumber-expressions (14.0.0)
|
106
|
+
cucumber-gherkin (22.0.0)
|
107
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
108
|
+
cucumber-html-formatter (17.0.0)
|
109
|
+
cucumber-messages (~> 17.1, >= 17.1.0)
|
110
|
+
cucumber-messages (17.1.1)
|
111
|
+
cucumber-tag-expressions (4.1.0)
|
112
|
+
cucumber-wire (6.2.0)
|
113
|
+
cucumber-core (~> 10.1, >= 10.1.0)
|
114
|
+
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
|
115
|
+
cucumber-messages (~> 17.1, >= 17.1.1)
|
116
|
+
diff-lcs (1.4.4)
|
117
|
+
escape (0.0.4)
|
118
|
+
ethon (0.15.0)
|
119
|
+
ffi (>= 1.15.0)
|
120
|
+
ffi (1.15.4)
|
121
|
+
fourflusher (2.3.1)
|
122
|
+
fuzzy_match (2.0.4)
|
123
|
+
gh_inspector (1.1.3)
|
124
|
+
gli (2.19.0)
|
125
|
+
httpclient (2.8.3)
|
126
|
+
i18n (1.8.10)
|
127
|
+
concurrent-ruby (~> 1.0)
|
128
|
+
json (2.6.0)
|
129
|
+
mime-types (3.3.1)
|
130
|
+
mime-types-data (~> 3.2015)
|
131
|
+
mime-types-data (3.2021.0901)
|
132
|
+
minitest (5.14.4)
|
133
|
+
molinillo (0.8.0)
|
134
|
+
multi_test (0.1.2)
|
135
|
+
nanaimo (0.3.0)
|
136
|
+
nap (1.1.0)
|
137
|
+
netrc (0.11.0)
|
138
|
+
parallel (1.21.0)
|
139
|
+
public_suffix (4.0.6)
|
140
|
+
rake (12.3.3)
|
141
|
+
rdoc (6.3.2)
|
142
|
+
rexml (3.2.5)
|
143
|
+
rspec-expectations (3.10.1)
|
144
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
145
|
+
rspec-support (~> 3.10.0)
|
146
|
+
rspec-support (3.10.2)
|
147
|
+
ruby-macho (2.5.1)
|
148
|
+
sys-uname (1.2.2)
|
149
|
+
ffi (~> 1.1)
|
150
|
+
thor (1.1.0)
|
151
|
+
typhoeus (1.4.0)
|
152
|
+
ethon (>= 0.9.0)
|
153
|
+
tzinfo (2.0.4)
|
154
|
+
concurrent-ruby (~> 1.0)
|
155
|
+
xcodeproj (1.21.0)
|
156
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
157
|
+
atomos (~> 0.1.3)
|
158
|
+
claide (>= 1.0.2, < 2.0)
|
159
|
+
colored2 (~> 3.1)
|
160
|
+
nanaimo (~> 0.3.0)
|
161
|
+
rexml (~> 3.2.4)
|
162
|
+
zeitwerk (2.5.0)
|
163
|
+
|
164
|
+
PLATFORMS
|
165
|
+
ruby
|
166
|
+
|
167
|
+
DEPENDENCIES
|
168
|
+
aruba
|
169
|
+
luna-binary-uploader!
|
170
|
+
rake (~> 12.0)
|
171
|
+
rdoc
|
172
|
+
|
173
|
+
BUNDLED WITH
|
174
|
+
2.1.4
|
data/bin/lbu
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
|
-
require "luna
|
5
|
-
require "luna/binary/delete"
|
6
|
-
require "luna/binary/analysis"
|
7
|
-
require "luna/binary/refresh"
|
8
|
-
require "luna/binary/build"
|
9
|
-
require "luna/binary/update"
|
4
|
+
require "luna-binary-uploader"
|
10
5
|
require 'gli'
|
11
6
|
|
12
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
@@ -19,7 +14,7 @@ require 'gli'
|
|
19
14
|
class App
|
20
15
|
extend GLI::App
|
21
16
|
|
22
|
-
program_desc 'luna
|
17
|
+
program_desc 'luna-binary-uploader 自定义二进制上传'
|
23
18
|
|
24
19
|
version Luna::Binary::Uploader::VERSION
|
25
20
|
|
@@ -54,8 +49,35 @@ class App
|
|
54
49
|
end
|
55
50
|
end
|
56
51
|
|
52
|
+
desc '初始化二进制配置repo代码'
|
53
|
+
arg_name 'url地址'
|
54
|
+
command :init do |c|
|
55
|
+
c.action do |global_options,options,args|
|
56
|
+
if args[0]
|
57
|
+
Luna::Binary::Init.new(args[0])
|
58
|
+
else
|
59
|
+
raise "添加url地址"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
desc '对pod install封装,一键开关二进制'
|
66
|
+
arg_name '只接参数n, 表示不用二进制 '
|
67
|
+
command :install do |c|
|
68
|
+
c.action do |global_options,options,args|
|
69
|
+
is_open = "false"
|
70
|
+
if args[0] && args[0] != "n"
|
71
|
+
raise "只接参数n, 表示不用二进制"
|
72
|
+
else
|
73
|
+
is_open = "true"
|
74
|
+
end
|
75
|
+
Luna::Binary::Install.new(is_open)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
57
79
|
desc '单个上传二进制文件'
|
58
|
-
arg_name '
|
80
|
+
arg_name 'a.模块名 git地址 git节点 xcode编译的缓存地址 \n b.模块名 版本号 xcode编译的缓存地址 \n c.模块名 本地podspec地址 xcode编译的缓存地址'
|
59
81
|
command :single do |c|
|
60
82
|
c.action do |global_options,options,args|
|
61
83
|
if args[3] #模式1
|
@@ -94,10 +116,14 @@ class App
|
|
94
116
|
end
|
95
117
|
|
96
118
|
desc '单个删除repo 里的podspec & 服务二进制文件'
|
97
|
-
arg_name '
|
119
|
+
arg_name '1.模块名 2.版本号'
|
98
120
|
command :del do |c|
|
99
121
|
c.action do |global_options,options,args|
|
100
|
-
|
122
|
+
if args[0] && args[1]
|
123
|
+
Luna::Binary::Delete.new(args[0],args[1]).delete
|
124
|
+
else
|
125
|
+
raise "缺少参数:1.模块名 2.版本号"
|
126
|
+
end
|
101
127
|
end
|
102
128
|
end
|
103
129
|
|
@@ -148,10 +174,14 @@ class App
|
|
148
174
|
arg_name '1.xcworkspace 名称 eg:MyWorkSpace.xcworkspace 2.scheme eg: MyProject'
|
149
175
|
command :build do |c|
|
150
176
|
c.action do |global_options,options,args|
|
177
|
+
if args[0] && args[1]
|
151
178
|
obj = Luna::Binary::Build.new()
|
152
179
|
obj.workspace=args[0]
|
153
180
|
obj.scheme=args[1]
|
154
181
|
obj.run
|
182
|
+
else
|
183
|
+
raise "缺少参数:1.xcworkspace 名称 eg:MyWorkSpace.xcworkspace 2.scheme eg: MyProject"
|
184
|
+
end
|
155
185
|
end
|
156
186
|
end
|
157
187
|
|
@@ -159,8 +189,12 @@ class App
|
|
159
189
|
arg_name '1.armPath 2.x86path'
|
160
190
|
command :merge do |c|
|
161
191
|
c.action do |global_options,options,args|
|
192
|
+
if args[0] && args[1]
|
162
193
|
obj = Luna::Binary::Build.new()
|
163
194
|
obj.mergeFrameWorks(args[0], args[1])
|
195
|
+
else
|
196
|
+
raise "缺少参数:1.armPath 2.x86path"
|
197
|
+
end
|
164
198
|
end
|
165
199
|
end
|
166
200
|
|
data/lib/luna/binary/analysis.rb
CHANGED
@@ -20,88 +20,58 @@ module Luna
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def validate!
|
23
|
-
arr = Dir.glob(
|
23
|
+
arr = Dir.glob(Common.instance.podFilePath)
|
24
24
|
if arr == nil
|
25
25
|
raise '当前路径下没有Podfile'
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
def lockfile
|
30
|
-
return
|
30
|
+
return Common.instance.lockfile
|
31
31
|
end
|
32
32
|
|
33
33
|
def run
|
34
|
-
|
35
34
|
failList = []
|
36
35
|
successList = []
|
37
|
-
localPathMapper = {}
|
38
36
|
|
39
|
-
dependenciesMapper =
|
37
|
+
dependenciesMapper = Common.instance.dependenciesMapper
|
40
38
|
dedupingMapper = {}
|
41
39
|
lockfile.pod_names.each { |item|
|
42
40
|
moduleName = item.split('/').first
|
43
41
|
if !moduleName["/"] && dedupingMapper[moduleName] == nil
|
44
42
|
dedupingMapper[moduleName] = moduleName
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
if
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
uploader = uploadLintPodSpec(moduleName, lockItem.specific_version, binary_path)
|
53
|
-
if uploader != nil
|
54
|
-
successList << uploader
|
55
|
-
end
|
56
|
-
else
|
57
|
-
p lockItem.external_source
|
58
|
-
gitURL = lockItem.external_source['git'.parameterize.underscore.to_sym]
|
59
|
-
tag = lockItem.external_source['tag'.parameterize.underscore.to_sym]
|
60
|
-
path = lockItem.external_source['path'.parameterize.underscore.to_sym]
|
61
|
-
p "#{moduleName} git: #{gitURL} tag: #{tag} path: #{path}"
|
62
|
-
if path
|
63
|
-
pathArr = Dir.glob("#{Dir.pwd}/#{path}/**/#{moduleName}.podspec")
|
64
|
-
if pathArr
|
65
|
-
uploader = Luna::Binary::Uploader::SingleUploader.new(moduleName, "", "", binary_path)
|
66
|
-
uploader.specification=Pod::Specification.from_file(pathArr.first)
|
67
|
-
uploader.specificationWork
|
68
|
-
localPathMapper[moduleName] = pathArr.first
|
69
|
-
end
|
70
|
-
|
71
|
-
elsif gitURL && tag && !moduleName["/"]
|
72
|
-
uploader = Luna::Binary::Uploader::SingleUploader.new(moduleName, gitURL, tag, binary_path)
|
73
|
-
uploader.specificationWork
|
74
|
-
successList << uploader
|
75
|
-
end
|
76
|
-
end
|
77
|
-
rescue => exception
|
78
|
-
failList << exception
|
79
|
-
ensure
|
80
|
-
|
81
|
-
end
|
82
|
-
}
|
83
|
-
end
|
84
|
-
else
|
85
|
-
begin
|
86
|
-
uploader = uploadLintPodSpec(moduleName, lockfile.version(moduleName), binary_path)
|
87
|
-
if uploader != nil
|
88
|
-
successList << uploader
|
89
|
-
end
|
90
|
-
rescue => exception
|
91
|
-
failList << exception
|
92
|
-
ensure
|
93
|
-
|
43
|
+
puts moduleName.yellow
|
44
|
+
begin
|
45
|
+
uploader = Common.instance.upload_lockitem(dependenciesMapper, moduleName, binary_path)
|
46
|
+
if uploader != nil
|
47
|
+
successList << uploader
|
48
|
+
else
|
49
|
+
failList << "#{moduleName} 为空"
|
94
50
|
end
|
51
|
+
|
52
|
+
rescue => exception
|
53
|
+
failList << "#{moduleName} exception: #{exception}"
|
54
|
+
ensure
|
55
|
+
|
95
56
|
end
|
96
57
|
end
|
97
58
|
}
|
98
|
-
|
59
|
+
puts "-=-=-=-=-=-=-=-=-=-=-=-打印错误信息=-=-=-=-=-=-=-=-=-=-=-=-=-=".yellow if failList.length > 0
|
60
|
+
puts "请查看下时候存在影响,如怀疑程序错误请联系作者".yellow if failList.length > 0
|
61
|
+
failList.each{ |item|
|
62
|
+
puts item.red
|
63
|
+
}
|
64
|
+
|
65
|
+
puts "-=-=-=-=-=-=-=-=-=-=-=-命令生成=-=-=-=-=-=-=-=-=-=-=-=-=-=".yellow
|
99
66
|
hasInCocopodsSpec = []
|
100
67
|
externalSpec = []
|
68
|
+
local_spec = []
|
101
69
|
failPrint = []
|
102
70
|
|
103
71
|
successList.each { |item|
|
104
|
-
if item.
|
72
|
+
if item.local_path
|
73
|
+
local_spec << item
|
74
|
+
elsif item.gitUrl.length > 0
|
105
75
|
externalSpec << item
|
106
76
|
else
|
107
77
|
hasInCocopodsSpec << item
|
@@ -111,8 +81,7 @@ module Luna
|
|
111
81
|
begin
|
112
82
|
item.printPreUploadCommand
|
113
83
|
rescue => exception
|
114
|
-
#
|
115
|
-
failPrint << "#{exception}"
|
84
|
+
failPrint << "#{item.podspecName} exception: #{exception}"
|
116
85
|
ensure
|
117
86
|
|
118
87
|
end
|
@@ -121,57 +90,50 @@ module Luna
|
|
121
90
|
begin
|
122
91
|
item.printPreUploadCommand
|
123
92
|
rescue => exception
|
124
|
-
#
|
125
|
-
failPrint << "#{exception}"
|
93
|
+
failPrint << "#{item.podspecName} exception: #{exception}"
|
126
94
|
ensure
|
127
95
|
|
128
96
|
end
|
129
97
|
}
|
130
98
|
|
131
|
-
|
132
|
-
|
99
|
+
local_spec.each { |item|
|
100
|
+
begin
|
101
|
+
item.printPreUploadCommand
|
102
|
+
rescue => exception
|
103
|
+
failPrint << "#{item.podspecName} exception: #{exception}"
|
104
|
+
ensure
|
105
|
+
|
106
|
+
end
|
133
107
|
}
|
134
108
|
|
135
|
-
|
136
|
-
p "错误信息:#{failPrint}"
|
137
|
-
execUpload(hasInCocopodsSpec)
|
138
|
-
execUpload(externalSpec)
|
139
|
-
end
|
109
|
+
puts "-=-=-=-=-=-=-=-=-=-=-=-命令生成end=-=-=-=-=-=-=-=-=-=-=-=-=-=".yellow
|
140
110
|
|
141
|
-
|
142
|
-
|
143
|
-
|
111
|
+
failPrint.each{ |item|
|
112
|
+
puts item.red
|
113
|
+
}
|
144
114
|
|
145
|
-
|
146
|
-
set = findLintPodspec(moduleName)
|
147
|
-
if set
|
148
|
-
pathArr = set.specification_paths_for_version(specificVersion)
|
149
|
-
if pathArr.length > 0
|
150
|
-
uploader = Luna::Binary::Uploader::SingleUploader.new(moduleName, "", "", binaryPath)
|
151
|
-
uploader.specification=Pod::Specification.from_file(pathArr.first)
|
152
|
-
uploader.specificationWork
|
153
|
-
end
|
154
|
-
end
|
155
|
-
return uploader
|
115
|
+
execUpload(successList)
|
156
116
|
end
|
157
|
-
|
117
|
+
|
158
118
|
def execUpload(items)
|
159
119
|
if need_upload != nil && need_upload == "upload"
|
120
|
+
puts "-=-=-=-=-=-=-=-=-=-=-=-开始上传=-=-=-=-=-=-=-=-=-=-=-=-=-=".yellow
|
160
121
|
items.each { |item|
|
161
122
|
begin
|
162
123
|
item.upload
|
163
124
|
rescue => exception
|
164
|
-
|
125
|
+
puts "异常上传过程中出现了:#{exception}".red
|
165
126
|
else
|
166
127
|
|
167
128
|
end
|
168
129
|
|
169
130
|
}
|
131
|
+
puts "-=-=-=-=-=-=-=-=-=-=-=-上传结束=-=-=-=-=-=-=-=-=-=-=-=-=-=".yellow
|
170
132
|
end
|
171
133
|
end
|
172
134
|
|
173
135
|
def command(c)
|
174
|
-
return
|
136
|
+
return Common.instance.command(c)
|
175
137
|
end
|
176
138
|
|
177
139
|
end
|
data/lib/luna/binary/build.rb
CHANGED
@@ -20,36 +20,40 @@ module Luna
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def command(c)
|
23
|
-
return
|
23
|
+
return Common.instance.command(c)
|
24
24
|
end
|
25
25
|
|
26
26
|
def createFrameworks
|
27
27
|
isNext = true
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
Luna::Binary::Common.instance.deleteDirectory(binary_path_arm)
|
33
|
-
tempLunaUploaderPath = Luna::Binary::Common.instance.tempLunaUploaderPath
|
28
|
+
puts "请将二进制开关关闭,确保每个模块都是源码运行,因为二进制的因素有可能source缓存还是会引入二进制".yellow
|
29
|
+
Install.new(false)
|
30
|
+
Common.instance.deleteDirectory(binary_path_arm)
|
31
|
+
tempLunaUploaderPath = Common.instance.tempLunaUploaderPath
|
34
32
|
isNext = command("xcodebuild -workspace #{workspace} -scheme #{scheme} -configuration Debug -derivedDataPath '#{tempLunaUploaderPath}/build/arm/temp'") if isNext == true
|
35
|
-
isNext = command("cp -r #{tempLunaUploaderPath}/build/arm/temp/Build/Products #{binary_path_arm}") if isNext == true #本可以用CONFIGURATION_BUILD_DIR直接指定结果文件夹,结果经常性的编译报错
|
36
|
-
|
33
|
+
isNext = command("cp -r #{tempLunaUploaderPath}/build/arm/temp/Build/Products/Debug-iphoneos #{binary_path_arm}") if isNext == true #本可以用CONFIGURATION_BUILD_DIR直接指定结果文件夹,结果经常性的编译报错
|
34
|
+
Common.instance.deleteDirectory(binary_path_x86)
|
37
35
|
isNext = command("xcodebuild -workspace #{workspace} -scheme #{scheme} -configuration Debug -derivedDataPath '#{tempLunaUploaderPath}/build/x86/temp' -destination 'platform=iOS Simulator,name=iPhone 11'") if isNext == true
|
38
|
-
isNext = command("cp -r #{tempLunaUploaderPath}/build/x86/temp/Build/Products #{binary_path_x86}") if isNext == true
|
36
|
+
isNext = command("cp -r #{tempLunaUploaderPath}/build/x86/temp/Build/Products/Debug-iphonesimulator #{binary_path_x86}") if isNext == true
|
39
37
|
mergeFrameWorks(binary_path_arm, binary_path_x86) if isNext == true
|
40
38
|
end
|
41
39
|
|
42
40
|
def mergeFrameWorks(binary_path_arm, binary_path_x86)
|
43
|
-
|
41
|
+
Common.instance.deleteDirectory(binary_path_merged)
|
44
42
|
dedupingMapper = {}
|
45
43
|
failList = []
|
46
|
-
lockfile.pod_names
|
47
|
-
|
44
|
+
p lockfile.pod_names
|
45
|
+
lockfile.pod_names.each { |i|
|
46
|
+
item = i.split("/").first
|
47
|
+
if dedupingMapper[item] == nil
|
48
48
|
begin
|
49
|
-
|
49
|
+
puts item.yellow
|
50
50
|
armPath = findFramework(item,binary_path_arm)
|
51
51
|
x86Path = findFramework(item,binary_path_x86)
|
52
|
-
|
52
|
+
|
53
|
+
is_merge = mergeFrameWork(item, armPath, x86Path) if armPath != nil && x86Path != nil
|
54
|
+
trasher_path = "#{Common.instance.tempLunaUploaderPath}/trasher"
|
55
|
+
failList << "#{item} 存在问题,已搬到#{trasher_path}" if is_merge == false
|
56
|
+
command("mkdir #{trasher_path}; mv #{binary_path_merged}/#{item} #{trasher_path}") if is_merge == false
|
53
57
|
dedupingMapper[item] = item
|
54
58
|
rescue => exception
|
55
59
|
failList << "#{item} exception : #{exception}"
|
@@ -60,12 +64,15 @@ module Luna
|
|
60
64
|
end
|
61
65
|
}
|
62
66
|
|
63
|
-
|
64
|
-
|
67
|
+
puts "合并后的framework的路径为:#{binary_path_merged}".green
|
68
|
+
puts "-=-=-=-=-=-=-=-=merge 失败名单-=-=-=-=-=-=-=-=-=-=" if failList.length > 0
|
69
|
+
failList.each { |item|
|
70
|
+
puts item.red
|
71
|
+
}
|
65
72
|
end
|
66
73
|
|
67
74
|
def lockfile
|
68
|
-
return
|
75
|
+
return Common.instance.lockfile
|
69
76
|
end
|
70
77
|
|
71
78
|
def xcodeSimulators
|
@@ -74,9 +81,9 @@ module Luna
|
|
74
81
|
end
|
75
82
|
|
76
83
|
def mergeFrameWork(moduleName, path1, path2)
|
77
|
-
command("mkdir -p #{binary_path_merged}; cp -r #{File.dirname(path1)} #{binary_path_merged}; mv #{binary_path_merged}/#{File.basename(File.dirname(path1))} #{binary_path_merged}/#{moduleName};")
|
78
|
-
|
79
|
-
command("
|
84
|
+
command("mkdir -p #{binary_path_merged}; cp -r #{File.dirname(path1)} #{binary_path_merged}; cp -r #{File.dirname(path2)} #{binary_path_merged}; mv #{binary_path_merged}/#{File.basename(File.dirname(path1))} #{binary_path_merged}/#{moduleName};")
|
85
|
+
framework_name = moduleName.gsub("-", "_")
|
86
|
+
return command("lipo -create #{path2}/#{framework_name} #{path1}/#{framework_name} -output #{binary_path_merged}/#{moduleName}/#{framework_name}.framework/#{framework_name}")
|
80
87
|
end
|
81
88
|
|
82
89
|
def findFramework(moduleName, binary_path)
|
@@ -90,15 +97,15 @@ module Luna
|
|
90
97
|
|
91
98
|
|
92
99
|
def binary_path_merged
|
93
|
-
return
|
100
|
+
return Common.instance.binary_path_merged
|
94
101
|
end
|
95
102
|
|
96
103
|
def binary_path_arm
|
97
|
-
return
|
104
|
+
return Common.instance.binary_path_arm
|
98
105
|
end
|
99
106
|
|
100
107
|
def binary_path_x86
|
101
|
-
return
|
108
|
+
return Common.instance.binary_path_x86
|
102
109
|
end
|
103
110
|
end
|
104
111
|
end
|