cocoapods-imy-hycan-bin 0.1.0 → 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/command/bin/update.rb +1 -1
- data/lib/cocoapods-imy-bin/config/config_builder.rb +4 -2
- data/lib/cocoapods-imy-bin/helpers/framework_builder.rb +36 -24
- data/lib/cocoapods-imy-bin/helpers/spec_source_creator.rb +2 -1
- data/lib/cocoapods-imy-bin/native/podfile.rb +1 -1
- data/lib/cocoapods-imy-bin/native/podfile_env.rb +1 -1
- data/lib/cocoapods-imy-bin/source_provider_hook.rb +3 -3
- metadata +6 -6
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
|
@@ -122,7 +122,7 @@ module Pod
|
|
122
122
|
# 把本地和原始到dependencies 合并,设置dependencies
|
123
123
|
local_dependencies.each do |d|
|
124
124
|
UI.message "Development Pod #{d.to_yaml}"
|
125
|
-
if podfile.plugins.keys.include?('cocoapods-imy-bin')
|
125
|
+
if podfile.plugins.keys.include?('cocoapods-imy-hycan-bin')
|
126
126
|
podfile.set_use_source_pods(d.keys.first) if (d.is_a?(Hash) && d.keys.first)
|
127
127
|
end
|
128
128
|
end
|
@@ -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\'"
|
153
|
+
"ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\' ENABLE_BITCODE=\'NO\'"
|
146
154
|
end
|
147
155
|
|
148
156
|
def ios_architectures
|
@@ -158,7 +166,7 @@ module CBin
|
|
158
166
|
# iphone5,iphone5s以下的模拟器
|
159
167
|
# >x86_64
|
160
168
|
# iphone6以上的模拟器
|
161
|
-
archs = %w[arm64
|
169
|
+
archs = %w[arm64]
|
162
170
|
# archs = %w[x86_64 arm64 armv7s i386]
|
163
171
|
# @vendored_libraries.each do |library|
|
164
172
|
# archs = `lipo -info #{library}`.split & archs
|
@@ -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, "ARCHS=\'#{arch}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'","build-#{arch}",@build_model)
|
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 = []
|
@@ -72,7 +72,7 @@ module Pod
|
|
72
72
|
private
|
73
73
|
|
74
74
|
def valid_bin_plugin
|
75
|
-
unless plugins.keys.include?('cocoapods-imy-bin')
|
75
|
+
unless plugins.keys.include?('cocoapods-imy-hycan-bin')
|
76
76
|
raise Pod::Informative, 'You should add `plugin \'cocoapods-imy-bin\'` before using its DSL'
|
77
77
|
end
|
78
78
|
end
|
@@ -11,7 +11,7 @@ module Pod
|
|
11
11
|
|
12
12
|
module ENVExecutor
|
13
13
|
def execute_with_bin_plugin(&block)
|
14
|
-
execute_with_key(USE_PLUGINS, -> { 'cocoapods-imy-bin' }, &block)
|
14
|
+
execute_with_key(USE_PLUGINS, -> { 'cocoapods-imy-hycan-bin' }, &block)
|
15
15
|
end
|
16
16
|
|
17
17
|
def execute_with_allow_prerelease(allow_prerelease, &block)
|
@@ -2,7 +2,7 @@ require 'cocoapods-imy-bin/native/sources_manager'
|
|
2
2
|
require 'cocoapods-imy-bin/command/bin/repo/update'
|
3
3
|
require 'cocoapods/user_interface'
|
4
4
|
|
5
|
-
Pod::HooksManager.register('cocoapods-imy-bin', :pre_install) do |_context, _|
|
5
|
+
Pod::HooksManager.register('cocoapods-imy-hycan-bin', :pre_install) do |_context, _|
|
6
6
|
require 'cocoapods-imy-bin/native'
|
7
7
|
|
8
8
|
#pod bin update || install 不走这里
|
@@ -13,7 +13,7 @@ Pod::HooksManager.register('cocoapods-imy-bin', :pre_install) do |_context, _|
|
|
13
13
|
Pod::Command::Bin::Repo::Update.new(CLAide::ARGV.new([])).run
|
14
14
|
|
15
15
|
# 有插件/本地库 且是dev环境下,默认进入源码白名单 过滤 archive命令
|
16
|
-
if _context.podfile.plugins.keys.include?('cocoapods-imy-bin') && _context.podfile.configuration_env == 'dev'
|
16
|
+
if _context.podfile.plugins.keys.include?('cocoapods-imy-hycan-bin') && _context.podfile.configuration_env == 'dev'
|
17
17
|
dependencies = _context.podfile.dependencies
|
18
18
|
dependencies.each do |d|
|
19
19
|
next unless d.respond_to?(:external_source) &&
|
@@ -44,7 +44,7 @@ Pod::HooksManager.register('cocoapods-imy-bin', :pre_install) do |_context, _|
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
Pod::HooksManager.register('cocoapods-imy-bin', :source_provider) do |context, _|
|
47
|
+
Pod::HooksManager.register('cocoapods-imy-hycan-bin', :source_provider) do |context, _|
|
48
48
|
#pod bin update || install 不走这里
|
49
49
|
if $ARGV[1] == 'update' || $ARGV[1] != 'install'
|
50
50
|
|
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
|
-
autorequire:
|
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
|
@@ -158,7 +158,7 @@ metadata:
|
|
158
158
|
allowed_push_host: https://rubygems.org
|
159
159
|
homepage_uri: https://github.com/Cellphoness/cocoapods-imy-hycan-bin
|
160
160
|
source_code_uri: https://github.com/Cellphoness/cocoapods-imy-hycan-bin.git
|
161
|
-
post_install_message:
|
161
|
+
post_install_message:
|
162
162
|
rdoc_options: []
|
163
163
|
require_paths:
|
164
164
|
- lib
|
@@ -173,8 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.1.
|
177
|
-
signing_key:
|
176
|
+
rubygems_version: 3.1.4
|
177
|
+
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: copy of cocoapods-imy--bin
|
180
180
|
test_files: []
|