luna-binary-uploader 0.1.7 → 0.1.12
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 +6 -1
- data/bin/lbu +3 -2
- data/lib/luna/binary/build.rb +20 -8
- data/lib/luna/binary/common/common.rb +2 -14
- data/lib/luna/binary/refresh.rb +6 -6
- data/lib/luna/binary/update.rb +12 -1
- data/lib/luna/binary/uploader/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: 055124f814326d00613b601e0b88cbe16a73ed1bb6ca590cf8ac8ff9cffcbf26
|
4
|
+
data.tar.gz: bc95cf8dedbed5fb05340f46b59fbea40c4452f61d3e39a8a8d8a16d828c8b88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a174a6779e8a4d5716dd891c0763f73d1998bb4023d654bef42e471d0d03ee8c27b8854dea88a7e20bf305820a5d0f3cecb6d8950c7961185c0a48b1fa3e50fa
|
7
|
+
data.tar.gz: da37682445afd5deca1c1384325ec517b87b95e2573b6d41118307762f01b4dac677e766b12a84300f88e6a206b9eed9d98f53b389ab249988a68fe9e3310157
|
data/.gitignore
CHANGED
data/bin/lbu
CHANGED
@@ -6,6 +6,7 @@ require "luna/binary/delete"
|
|
6
6
|
require "luna/binary/analysis"
|
7
7
|
require "luna/binary/refresh"
|
8
8
|
require "luna/binary/build"
|
9
|
+
require "luna/binary/update"
|
9
10
|
require 'gli'
|
10
11
|
|
11
12
|
# You can add fixtures and/or initialization code here to make experimenting
|
@@ -110,7 +111,7 @@ class App
|
|
110
111
|
else
|
111
112
|
obj.binary_path = Luna::Binary::Common.instance.binary_path_merged
|
112
113
|
end
|
113
|
-
obj.
|
114
|
+
obj.need_upload = args[1]
|
114
115
|
obj.run
|
115
116
|
end
|
116
117
|
end
|
@@ -133,7 +134,7 @@ class App
|
|
133
134
|
arg_name '参数:1.二进制路径(可以不传默认为当前目录下的/temp-luna-uploader/merged)'
|
134
135
|
command :update do |c|
|
135
136
|
c.action do |global_options,options,args|
|
136
|
-
obj = Luna::Binary::
|
137
|
+
obj = Luna::Binary::Update.new()
|
137
138
|
if args[0] != nil
|
138
139
|
obj.binary_path = args[0]
|
139
140
|
else
|
data/lib/luna/binary/build.rb
CHANGED
@@ -29,26 +29,38 @@ module Luna
|
|
29
29
|
command("rm -rf #{Dir.pwd}/Pods")
|
30
30
|
isNext = command("pod install")
|
31
31
|
Luna::Binary::Common.instance.deleteDirectory(binary_path_arm)
|
32
|
-
|
32
|
+
tempLunaUploaderPath = Luna::Binary::Common.instance.tempLunaUploaderPath
|
33
|
+
isNext = command("xcodebuild -workspace #{workspace} -scheme #{scheme} -configuration Debug -derivedDataPath '#{tempLunaUploaderPath}/build/arm/temp'") if isNext == true
|
34
|
+
isNext = command("cp -r #{tempLunaUploaderPath}/build/arm/temp/Build/Products #{binary_path_arm}") if isNext == true #本可以用CONFIGURATION_BUILD_DIR直接指定结果文件夹,结果经常性的编译报错
|
33
35
|
Luna::Binary::Common.instance.deleteDirectory(binary_path_x86)
|
34
|
-
isNext = command("xcodebuild -workspace #{workspace} -scheme #{scheme} -configuration Debug -derivedDataPath '#{
|
36
|
+
isNext = command("xcodebuild -workspace #{workspace} -scheme #{scheme} -configuration Debug -derivedDataPath '#{tempLunaUploaderPath}/build/x86/temp' -destination 'platform=iOS Simulator,name=iPhone 11'") if isNext == true
|
37
|
+
isNext = command("cp -r #{tempLunaUploaderPath}/build/x86/temp/Build/Products #{binary_path_x86}") if isNext == true
|
35
38
|
mergeFrameWorks(binary_path_arm, binary_path_x86) if isNext == true
|
36
39
|
end
|
37
40
|
|
38
41
|
def mergeFrameWorks(binary_path_arm, binary_path_x86)
|
39
42
|
Luna::Binary::Common.instance.deleteDirectory(binary_path_merged)
|
40
43
|
dedupingMapper = {}
|
44
|
+
failList = []
|
41
45
|
lockfile.pod_names.each { |item|
|
42
46
|
if item["/"] == nil && dedupingMapper[item] == nil
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
47
|
+
begin
|
48
|
+
Pod::UserInterface.puts item.yellow
|
49
|
+
armPath = findFramework(item,binary_path_arm)
|
50
|
+
x86Path = findFramework(item,binary_path_x86)
|
51
|
+
mergeFrameWork(item, armPath, x86Path) if armPath != nil && x86Path != nil
|
52
|
+
dedupingMapper[item] = item
|
53
|
+
rescue => exception
|
54
|
+
failList << "#{item} exception : #{exception}"
|
55
|
+
ensure
|
56
|
+
|
57
|
+
end
|
58
|
+
|
48
59
|
end
|
49
60
|
}
|
50
61
|
|
51
62
|
Pod::UserInterface.puts "合并后的framework的路径为:#{binary_path_merged}".yellow
|
63
|
+
Pod::UserInterface.puts "失败的名单为:#{failList}".yellow
|
52
64
|
end
|
53
65
|
|
54
66
|
def lockfile
|
@@ -66,7 +78,7 @@ module Luna
|
|
66
78
|
end
|
67
79
|
|
68
80
|
def findFramework(moduleName, binary_path)
|
69
|
-
pathArr = Dir.glob("#{binary_path}/**/#{moduleName}.framework")
|
81
|
+
pathArr = Dir.glob("#{binary_path}/**/#{moduleName.sub('-', '_')}.framework")
|
70
82
|
if pathArr != nil
|
71
83
|
return pathArr.first
|
72
84
|
else
|
@@ -27,6 +27,7 @@ module Luna
|
|
27
27
|
end
|
28
28
|
}
|
29
29
|
if repoPath == nil
|
30
|
+
p '没找到repo路径'
|
30
31
|
raise '没找到repo路径'
|
31
32
|
end
|
32
33
|
return repoPath
|
@@ -90,8 +91,7 @@ module Luna
|
|
90
91
|
end
|
91
92
|
|
92
93
|
def lockfile
|
93
|
-
@lockfile ||=
|
94
|
-
Pod::Lockfile.from_file(podFilePath) if podFilePath.exist?
|
94
|
+
@lockfile ||= Pod::Lockfile.from_file(podFilePath) if podFilePath.exist?
|
95
95
|
end
|
96
96
|
|
97
97
|
def use_framework_list
|
@@ -108,18 +108,6 @@ module Luna
|
|
108
108
|
end
|
109
109
|
return list
|
110
110
|
end
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
end
|
117
|
-
|
118
|
-
# def pushInRepo(name, version)
|
119
|
-
|
120
|
-
|
121
|
-
# end
|
122
|
-
|
123
111
|
end
|
124
112
|
end
|
125
113
|
end
|
data/lib/luna/binary/refresh.rb
CHANGED
@@ -21,15 +21,15 @@ module Luna
|
|
21
21
|
if pathArr != nil
|
22
22
|
Pod::UserInterface.puts "#{pathArr.first} #{k}".yellow
|
23
23
|
srcPath = File.dirname(pathArr.first)
|
24
|
-
|
25
|
-
|
24
|
+
system "cp -r #{srcPath} #{rootPath};"
|
25
|
+
File.rename("#{rootPath}/#{File.basename(srcPath)}", "#{rootPath}/#{k}")
|
26
26
|
zipCommand = "cd #{rootPath};zip -r #{k}.zip #{k}"
|
27
27
|
p zipCommand
|
28
28
|
system zipCommand
|
29
|
-
Luna::Binary::Delete.new(k,v).deleteBinaryFramework
|
30
|
-
command = "cd #{rootPath};curl #{CBin.config.binary_upload_url} -F \"name=#{k}\" -F \"version=#{v}\" -F \"annotate=#{k}_#{v}_log\" -F \"file=@#{k}.zip\""
|
31
|
-
p command
|
32
|
-
system command
|
29
|
+
# Luna::Binary::Delete.new(k,v).deleteBinaryFramework
|
30
|
+
# command = "cd #{rootPath};curl #{CBin.config.binary_upload_url} -F \"name=#{k}\" -F \"version=#{v}\" -F \"annotate=#{k}_#{v}_log\" -F \"file=@#{k}.zip\""
|
31
|
+
# p command
|
32
|
+
# system command
|
33
33
|
end
|
34
34
|
rescue => exception
|
35
35
|
p exception
|
data/lib/luna/binary/update.rb
CHANGED
@@ -14,6 +14,7 @@ module Luna
|
|
14
14
|
Luna::Binary::Common.instance.deleteDirectory("#{rootPath}")
|
15
15
|
system "mkdir -p #{rootPath};"
|
16
16
|
failList = []
|
17
|
+
successList = []
|
17
18
|
dependenciesMapper = lockfile.dependencies.map { |item| [item.name, item]}.to_h
|
18
19
|
spec_repo_binary.each { |k,v|
|
19
20
|
if request_result_hash[k] == nil || request_result_hash[k].include?(v) == false
|
@@ -34,7 +35,16 @@ module Luna
|
|
34
35
|
tag = lockItem.external_source['tag'.parameterize.underscore.to_sym]
|
35
36
|
path = lockItem.external_source['path'.parameterize.underscore.to_sym]
|
36
37
|
p "#{moduleName} git: #{gitURL} tag: #{tag} path: #{path}"
|
37
|
-
if
|
38
|
+
if path
|
39
|
+
pathArr = Dir.glob("#{Dir.pwd}/#{path}/**/#{moduleName}.podspec")
|
40
|
+
if pathArr
|
41
|
+
uploader = Luna::Binary::Uploader::SingleUploader.new(moduleName, "", "", binary_path)
|
42
|
+
uploader.specification=Pod::Specification.from_file(pathArr.first)
|
43
|
+
uploader.specificationWork
|
44
|
+
successList<<uploader
|
45
|
+
end
|
46
|
+
|
47
|
+
elsif gitURL && tag && !moduleName["/"]
|
38
48
|
uploader = Luna::Binary::Uploader::SingleUploader.new(moduleName, gitURL, tag, binary_path)
|
39
49
|
uploader.specificationWork
|
40
50
|
successList << uploader
|
@@ -65,6 +75,7 @@ module Luna
|
|
65
75
|
}
|
66
76
|
|
67
77
|
successList.each { |item|
|
78
|
+
Pod::UserInterface.puts "#{item} 制作中".yellow
|
68
79
|
item.upload
|
69
80
|
}
|
70
81
|
p "exception:#{failList}"
|