cocoapods-imy-hycan-bin 0.1.3 → 0.1.5
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/lib/cocoapods/imy/hycan/bin/version.rb +1 -1
- data/lib/cocoapods-imy-bin/command/bin/archive.rb +5 -0
- data/lib/cocoapods-imy-bin/config/config_builder.rb +4 -2
- data/lib/cocoapods-imy-bin/helpers/framework_builder.rb +35 -23
- data/lib/cocoapods-imy-bin/helpers/spec_source_creator.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 292c931bafd48404821f0282650c04eb667ac80d99a7b2158049bc2e42537832
|
4
|
+
data.tar.gz: f76357602f42d254084803f3fca2411bd3229d5bff1cc62e7498499a6d046c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9ef6963bb9b734767bd0575d4416942a73b4a55c40fd03f3e000473f3081ff8b4443a0b2478c2f9df2ce9d2efff2be4b6968d4122e829c0bb7ed1853c8c8755
|
7
|
+
data.tar.gz: ec2d25d510c901bb05c22aac1e816df1057ac80451b4f15c2a7460382f96c37fd8bf3180a56da97f9f765e1f19839d1308d69230295ec12acdb251dc6697ac2c
|
@@ -63,6 +63,8 @@ module Pod
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def run
|
66
|
+
UI.warn "run in auto"
|
67
|
+
|
66
68
|
# 清除之前的缓存
|
67
69
|
CBin::Config::Builder.instance.clean
|
68
70
|
|
@@ -180,12 +182,15 @@ module Pod
|
|
180
182
|
|
181
183
|
def swift_pods_buildsetting
|
182
184
|
# swift_project_link_header
|
185
|
+
UI.warn "def swift_project_link_header"
|
183
186
|
worksppace_path = File.expand_path("#{CBin::Config::Builder.instance.gen_dir}/#{@spec.name}")
|
184
187
|
path = File.join(worksppace_path, "Pods.xcodeproj")
|
185
188
|
path = File.join(worksppace_path, "Pods/Pods.xcodeproj") unless File.exist?(path)
|
186
189
|
raise Informative, "#{path} File no exist, please check" unless File.exist?(path)
|
187
190
|
project = Xcodeproj::Project.open(path)
|
191
|
+
UI.warn project.build_configurations
|
188
192
|
project.build_configurations.each do |x|
|
193
|
+
UI.warn x
|
189
194
|
x.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = true #设置生成swift inter
|
190
195
|
end
|
191
196
|
project.save
|
@@ -59,11 +59,13 @@ module CBin
|
|
59
59
|
|
60
60
|
|
61
61
|
def framework_name(spec)
|
62
|
-
|
62
|
+
custom_name = spec.module_name.nil? ? spec.name : spec.module_name
|
63
|
+
"#{custom_name}.framework"
|
63
64
|
end
|
64
65
|
|
65
66
|
def framework_name_version(spec)
|
66
|
-
|
67
|
+
custom_name = spec.module_name.nil? ? spec.name : spec.module_name
|
68
|
+
"#{custom_name}.framework_#{spec.version}"
|
67
69
|
end
|
68
70
|
|
69
71
|
def framework_zip_file(spec)
|
@@ -43,9 +43,12 @@ module CBin
|
|
43
43
|
if CBin::Build::Utils.is_swift_module(@spec) || !CBin::Build::Utils.uses_frameworks?
|
44
44
|
UI.section("Building static Library #{@spec}") do
|
45
45
|
# defines = compile
|
46
|
-
|
46
|
+
puts 'mark:'
|
47
|
+
puts @spec.module_name
|
48
|
+
puts @spec.name
|
47
49
|
# build_sim_libraries(defines)
|
48
|
-
|
50
|
+
custom_name = @spec.module_name.nil? ? @spec.name : @spec.module_name
|
51
|
+
output = framework.versions_path + Pathname.new(custom_name)
|
49
52
|
|
50
53
|
build_static_library_for_ios(output)
|
51
54
|
|
@@ -60,8 +63,12 @@ module CBin
|
|
60
63
|
UI.section("Building framework #{@spec}") do
|
61
64
|
# defines = compile
|
62
65
|
|
66
|
+
puts 'mark:'
|
67
|
+
puts @spec.module_name
|
68
|
+
puts @spec.name
|
63
69
|
# build_sim_libraries(defines)
|
64
|
-
|
70
|
+
custom_name = @spec.module_name.nil? ? @spec.name : @spec.module_name
|
71
|
+
output = framework.fwk_path + Pathname.new(custom_name)
|
65
72
|
|
66
73
|
copy_static_framework_dir_for_ios
|
67
74
|
|
@@ -86,8 +93,9 @@ module CBin
|
|
86
93
|
def cp_to_source_dir
|
87
94
|
# 删除Versions 软链接
|
88
95
|
framework.remove_current_version if CBin::Build::Utils.is_swift_module(@spec)
|
96
|
+
custom_name = @spec.module_name.nil? ? @spec.name : @spec.module_name
|
89
97
|
|
90
|
-
framework_name = "#{
|
98
|
+
framework_name = "#{custom_name}.framework"
|
91
99
|
target_dir = File.join(CBin::Config::Builder.instance.zip_dir,framework_name)
|
92
100
|
FileUtils.rm_rf(target_dir) if File.exist?(target_dir)
|
93
101
|
|
@@ -104,7 +112,7 @@ module CBin
|
|
104
112
|
# archs = %w[i386 x86_64]
|
105
113
|
archs = ios_architectures_sim
|
106
114
|
archs.map do |arch|
|
107
|
-
xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\'
|
115
|
+
xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\'", "build-#{arch}",@build_model)
|
108
116
|
end
|
109
117
|
|
110
118
|
end
|
@@ -142,7 +150,7 @@ module CBin
|
|
142
150
|
end
|
143
151
|
|
144
152
|
def ios_build_options
|
145
|
-
"ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\' ENABLE_BITCODE=\'NO\'
|
153
|
+
"ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\' ENABLE_BITCODE=\'NO\'"
|
146
154
|
end
|
147
155
|
|
148
156
|
def ios_architectures
|
@@ -183,7 +191,7 @@ module CBin
|
|
183
191
|
archs = ios_architectures
|
184
192
|
# archs = %w[arm64 armv7 armv7s]
|
185
193
|
archs.map do |arch|
|
186
|
-
xcodebuild(defines, "
|
194
|
+
xcodebuild(defines, "ENABLE_BITCODE=\'NO\' ARCHS=\'#{arch}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'","build-#{arch}",@build_model)
|
187
195
|
end
|
188
196
|
# else
|
189
197
|
# xcodebuild(defines,options)
|
@@ -209,9 +217,9 @@ module CBin
|
|
209
217
|
def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
|
210
218
|
|
211
219
|
unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
|
212
|
-
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{File.join(File.expand_path("..", build_dir), File.basename(build_dir))} clean build -configuration #{build_model} -target #{target_name} -project ./Pods/Pods.xcodeproj 2>&1"
|
220
|
+
command = "xcodebuild #{defines} #{args} BUILD_LIBRARY_FOR_DISTRIBUTION=YES CONFIGURATION_BUILD_DIR=#{File.join(File.expand_path("..", build_dir), File.basename(build_dir))} clean build -configuration #{build_model} -target #{target_name} -project ./Pods/Pods.xcodeproj 2>&1"
|
213
221
|
else
|
214
|
-
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
|
222
|
+
command = "xcodebuild #{defines} #{args} BUILD_LIBRARY_FOR_DISTRIBUTION=YES CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
|
215
223
|
end
|
216
224
|
|
217
225
|
UI.message "command = #{command}"
|
@@ -231,12 +239,13 @@ module CBin
|
|
231
239
|
def copy_headers
|
232
240
|
#走 podsepc中的public_headers
|
233
241
|
public_headers = Array.new
|
242
|
+
custom_name = @spec.module_name.nil? ? @spec.name : @spec.module_name
|
234
243
|
|
235
244
|
#by slj 如果没有头文件,去 "Headers/Public"拿
|
236
245
|
# if public_headers.empty?
|
237
|
-
spec_header_dir = "./Headers/Public/#{
|
246
|
+
spec_header_dir = "./Headers/Public/#{custom_name}"
|
238
247
|
unless File.exist?(spec_header_dir)
|
239
|
-
spec_header_dir = "./Pods/Headers/Public/#{
|
248
|
+
spec_header_dir = "./Pods/Headers/Public/#{custom_name}"
|
240
249
|
end
|
241
250
|
raise "copy_headers #{spec_header_dir} no exist " unless File.exist?(spec_header_dir)
|
242
251
|
Dir.chdir(spec_header_dir) do
|
@@ -261,10 +270,10 @@ module CBin
|
|
261
270
|
if Pathname(module_map_file).exist?
|
262
271
|
module_map = File.read(module_map_file)
|
263
272
|
end
|
264
|
-
elsif public_headers.map(&:basename).map(&:to_s).include?("#{
|
273
|
+
elsif public_headers.map(&:basename).map(&:to_s).include?("#{custom_name}-umbrella.h")
|
265
274
|
module_map = <<-MAP
|
266
|
-
framework module #{
|
267
|
-
umbrella header "#{
|
275
|
+
framework module #{custom_name} {
|
276
|
+
umbrella header "#{custom_name}-umbrella.h"
|
268
277
|
|
269
278
|
export *
|
270
279
|
module * { export * }
|
@@ -285,12 +294,12 @@ module CBin
|
|
285
294
|
# todo 所有架构的swiftModule拷贝到 framework.swift_module_path
|
286
295
|
archs = ios_architectures + ios_architectures_sim
|
287
296
|
archs.map do |arch|
|
288
|
-
swift_module = "build-#{arch}/#{
|
297
|
+
swift_module = "build-#{arch}/#{custom_name}.swiftmodule"
|
289
298
|
if File.directory?(swift_module)
|
290
299
|
FileUtils.cp_r("#{swift_module}/.", framework.swift_module_path)
|
291
300
|
end
|
292
301
|
end
|
293
|
-
swift_Compatibility_Header = "build-#{archs.first}/Swift\ Compatibility\ Header/#{
|
302
|
+
swift_Compatibility_Header = "build-#{archs.first}/Swift\ Compatibility\ Header/#{custom_name}-Swift.h"
|
294
303
|
FileUtils.cp(swift_Compatibility_Header,framework.headers_path) if File.exist?(swift_Compatibility_Header)
|
295
304
|
info_plist_file = File.join(File.dirname(__FILE__),"info.plist")
|
296
305
|
FileUtils.cp(info_plist_file,framework.fwk_path)
|
@@ -374,6 +383,8 @@ module CBin
|
|
374
383
|
#---------------------------------swift--------------------------------------#
|
375
384
|
# lipo -create .a
|
376
385
|
def build_static_framework_machO_for_ios(output)
|
386
|
+
custom_name = @spec.module_name.nil? ? @spec.name : @spec.module_name
|
387
|
+
|
377
388
|
UI.message "Building ios framework with archs #{ios_architectures}"
|
378
389
|
|
379
390
|
static_libs = static_libs_in_sandbox('build') + @vendored_libraries
|
@@ -389,7 +400,7 @@ module CBin
|
|
389
400
|
build_path.mkpath unless build_path.exist?
|
390
401
|
|
391
402
|
libs = (ios_architectures + ios_architectures_sim) .map do |arch|
|
392
|
-
library = "build-#{arch}/#{
|
403
|
+
library = "build-#{arch}/#{custom_name}.framework/#{custom_name}"
|
393
404
|
library
|
394
405
|
end
|
395
406
|
|
@@ -398,19 +409,19 @@ module CBin
|
|
398
409
|
end
|
399
410
|
|
400
411
|
def copy_static_framework_dir_for_ios
|
401
|
-
|
412
|
+
custom_name = @spec.module_name.nil? ? @spec.name : @spec.module_name
|
402
413
|
archs = ios_architectures + ios_architectures_sim
|
403
|
-
framework_dir = "build-#{ios_architectures_sim.first}/#{
|
404
|
-
framework_dir = "build-#{ios_architectures.first}/#{
|
414
|
+
framework_dir = "build-#{ios_architectures_sim.first}/#{custom_name}.framework"
|
415
|
+
framework_dir = "build-#{ios_architectures.first}/#{custom_name}.framework" unless File.exist?(framework_dir)
|
405
416
|
unless File.exist?(framework_dir)
|
406
417
|
raise "#{framework_dir} path no exist"
|
407
418
|
end
|
408
|
-
File.join(Dir.pwd, "build-#{ios_architectures_sim.first}/#{
|
419
|
+
File.join(Dir.pwd, "build-#{ios_architectures_sim.first}/#{custom_name}.framework")
|
409
420
|
FileUtils.cp_r(framework_dir, framework.root_path)
|
410
421
|
|
411
422
|
# todo 所有架构的swiftModule拷贝到 framework.swift_module_path
|
412
423
|
archs.map do |arch|
|
413
|
-
swift_module = "build-#{arch}/#{
|
424
|
+
swift_module = "build-#{arch}/#{custom_name}.framework/Modules/#{custom_name}.swiftmodule"
|
414
425
|
if File.directory?(swift_module)
|
415
426
|
FileUtils.cp_r("#{swift_module}/.", framework.swift_module_path)
|
416
427
|
end
|
@@ -432,7 +443,8 @@ module CBin
|
|
432
443
|
|
433
444
|
def framework
|
434
445
|
@framework ||= begin
|
435
|
-
|
446
|
+
custom_name = @spec.module_name.nil? ? @spec.name : @spec.module_name
|
447
|
+
framework = Framework.new(custom_name, @platform.name.to_s)
|
436
448
|
framework.make
|
437
449
|
framework
|
438
450
|
end
|
@@ -131,9 +131,10 @@ module CBin
|
|
131
131
|
@spec = code_spec.dup
|
132
132
|
# vendored_frameworks | resources | source | source_files | public_header_files
|
133
133
|
# license | resource_bundles | vendored_libraries
|
134
|
+
custom_name = code_spec.root.module_name.nil? ? code_spec.root.name : code_spec.root.module_name
|
134
135
|
|
135
136
|
# Project Linkin
|
136
|
-
@spec.vendored_frameworks = "#{
|
137
|
+
@spec.vendored_frameworks = "#{custom_name}.framework"
|
137
138
|
|
138
139
|
# Resources
|
139
140
|
extnames = []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-imy-hycan-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fengjx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|