cocoapods-bb-bin 0.1.3 → 0.1.7
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-bb-bin/command/bin/archive.rb +3 -3
- data/lib/cocoapods-bb-bin/command/bin/auto.rb +10 -9
- data/lib/cocoapods-bb-bin/config/config.rb +4 -6
- data/lib/cocoapods-bb-bin/config/config_builder.rb +7 -2
- data/lib/cocoapods-bb-bin/gem_version.rb +1 -1
- data/lib/cocoapods-bb-bin/helpers/build_helper.rb +1 -0
- data/lib/cocoapods-bb-bin/helpers/build_utils.rb +4 -0
- data/lib/cocoapods-bb-bin/helpers/framework.rb +7 -1
- data/lib/cocoapods-bb-bin/helpers/framework_builder.rb +43 -18
- data/lib/cocoapods-bb-bin/native/podfile_generator.rb +12 -8
- data/lib/cocoapods-bb-bin/source_provider_hook.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a0b3904ae69693b6a4e16d57411ad5593eb0a1631a59481fc438dd608173c91
|
4
|
+
data.tar.gz: a6e88bbb26fe868817172d8bcfc695180833a2c56a456187e32f8b4fadb23b40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9850aca45f033aba865d7f5aaca8b266c9ab158b27073a08fc11f035227f6b1b83e50903c1672c8141f2f2ec53beaa8b47c61c759852f78ceca8a29e06d56e59
|
7
|
+
data.tar.gz: 27d5e05acad74ff8173460a507ddcba00c7d61f8eb00fac82e3ab8db10233a631485bee04f2186c72550c2dc2644c1a6ff44b263a899bf029a4515b5bc8005f0
|
@@ -165,8 +165,8 @@ module Pod
|
|
165
165
|
"--verbose",
|
166
166
|
*@additional_args
|
167
167
|
]
|
168
|
-
|
169
|
-
if File.exist?(
|
168
|
+
podfile_path = Pod::Config.instance.podfile_path
|
169
|
+
if podfile_path && File.exist?(podfile_path)
|
170
170
|
argvs += ['--use-podfile']
|
171
171
|
end
|
172
172
|
|
@@ -175,7 +175,7 @@ module Pod
|
|
175
175
|
end
|
176
176
|
|
177
177
|
argvs << spec_file if spec_file
|
178
|
-
UI.puts "argvs:#{argvs}"
|
178
|
+
# UI.puts "argvs:#{argvs}"
|
179
179
|
gen = Pod::Command::Gen.new(CLAide::ARGV.new(argvs))
|
180
180
|
gen.validate!
|
181
181
|
gen.run
|
@@ -29,12 +29,10 @@ module Pod
|
|
29
29
|
@help = argv.flag?('help', false )
|
30
30
|
if @help
|
31
31
|
else
|
32
|
-
puts "开始执行自动推送操作,"
|
33
|
-
podfile_path = link_podfile # 创建软链接
|
34
|
-
|
35
32
|
@env = argv.option('env') || 'dev'
|
36
33
|
CBin.config.set_configuration_env(@env)
|
37
34
|
|
35
|
+
podfile_path = link_podfile # 创建软链接
|
38
36
|
@podspec = argv.shift_argument || find_podspec
|
39
37
|
@specification = Specification.from_file(@podspec)
|
40
38
|
|
@@ -133,7 +131,7 @@ module Pod
|
|
133
131
|
argvs += ["--env=#{@env}"]
|
134
132
|
end
|
135
133
|
argvs += ["--configuration=#{@config}"]
|
136
|
-
puts "===auto argvs: #{argvs}"
|
134
|
+
# puts "===auto argvs: #{argvs}"
|
137
135
|
archive = Pod::Command::Bin::Archive.new(CLAide::ARGV.new(argvs))
|
138
136
|
archive.validate!
|
139
137
|
sources_sepc = archive.run
|
@@ -190,7 +188,7 @@ module Pod
|
|
190
188
|
def find_podspec
|
191
189
|
name = nil
|
192
190
|
Pathname.pwd.children.each do |child|
|
193
|
-
puts child
|
191
|
+
# puts child
|
194
192
|
if File.file?(child)
|
195
193
|
if child.extname == '.podspec'
|
196
194
|
name = File.basename(child)
|
@@ -200,6 +198,7 @@ module Pod
|
|
200
198
|
end
|
201
199
|
end
|
202
200
|
end
|
201
|
+
raise Informative, "podspec File no exist, please check" unless name
|
203
202
|
return name
|
204
203
|
end
|
205
204
|
|
@@ -221,6 +220,8 @@ module Pod
|
|
221
220
|
if filename == 'Podfile'
|
222
221
|
podfile_path = File.join(filepath,"#{filename}")
|
223
222
|
create_link(podfile_path, current_path)
|
223
|
+
# pods_path = File.join(filepath,"Pods")
|
224
|
+
# create_link(pods_path, current_path)
|
224
225
|
return podfile_path
|
225
226
|
end
|
226
227
|
end
|
@@ -232,14 +233,14 @@ module Pod
|
|
232
233
|
podfile_path = File.join(current_path,"Example/Podfile")
|
233
234
|
if File.file?(podfile_path)
|
234
235
|
create_link(podfile_path, current_path)
|
236
|
+
# pods_path = File.join(current_path,"Example/Pods")
|
237
|
+
# create_link(pods_path, current_path)
|
235
238
|
end
|
236
239
|
end
|
237
240
|
|
238
241
|
def create_link(source_file, dest_file)
|
239
|
-
|
240
|
-
|
241
|
-
UI.puts "创建软链接 source:#{source_file} link:#{dest_file}"
|
242
|
-
end
|
242
|
+
system("ln -s #{source_file} #{dest_file}")
|
243
|
+
UI.puts "create link source:#{source_file} dest:#{dest_file}"
|
243
244
|
end
|
244
245
|
end
|
245
246
|
end
|
@@ -24,12 +24,12 @@ module CBin
|
|
24
24
|
file = config_dev_file
|
25
25
|
if configuration_env == "release_iphoneos"
|
26
26
|
file = config_release_iphoneos_file
|
27
|
-
puts "\n====== #{configuration_env} 环境 ========"
|
27
|
+
# puts "\n====== #{configuration_env} 环境 ========"
|
28
28
|
elsif configuration_env == "debug_iphoneos"
|
29
29
|
file = config_debug_iphoneos_file
|
30
|
-
puts "\n====== #{configuration_env} 环境 ========"
|
30
|
+
# puts "\n====== #{configuration_env} 环境 ========"
|
31
31
|
elsif configuration_env == "dev"
|
32
|
-
puts "\n====== #{configuration_env} 环境 ========"
|
32
|
+
# puts "\n====== #{configuration_env} 环境 ========"
|
33
33
|
else
|
34
34
|
raise "\n===== #{configuration_env} 参数有误,请检查%w[dev debug_iphoneos release_iphoneos]===="
|
35
35
|
end
|
@@ -94,7 +94,7 @@ module CBin
|
|
94
94
|
|
95
95
|
def config
|
96
96
|
@config ||= begin
|
97
|
-
|
97
|
+
@config = OpenStruct.new load_config
|
98
98
|
validate!
|
99
99
|
@config
|
100
100
|
end
|
@@ -131,6 +131,4 @@ module CBin
|
|
131
131
|
def self.config
|
132
132
|
@config ||= Config.new
|
133
133
|
end
|
134
|
-
|
135
|
-
|
136
134
|
end
|
@@ -20,17 +20,18 @@ module CBin
|
|
20
20
|
def load_build_config
|
21
21
|
@white_pod_list = []
|
22
22
|
@ignore_git_list = []
|
23
|
+
@ignore_http_list = []
|
23
24
|
project_root = Pod::Config.instance.project_root
|
24
25
|
path = File.join(project_root.to_s, 'BinArchive.json')
|
25
26
|
|
26
27
|
if File.exist?(path)
|
27
28
|
config = JSON.parse(File.read(path))
|
28
29
|
@white_pod_list = config['archive-white-pod-list']
|
29
|
-
UI.warn "======
|
30
|
+
UI.warn "====== white_pod_list = #{@white_pod_list}" if @white_pod_list
|
30
31
|
@ignore_git_list = config['ignore-git-list']
|
31
32
|
UI.warn "====== ignore_git_list = #{@ignore_git_list}" if @ignore_git_list
|
32
33
|
@ignore_http_list = config['ignore-http-list']
|
33
|
-
UI.warn "======
|
34
|
+
UI.warn "====== ignore_http_list = #{@ignore_http_list}" if @ignore_http_list
|
34
35
|
@xcode_build_name = config['xcode_build_path']
|
35
36
|
@root_dir = config['root_dir'] unless config['root_dir'].nil?
|
36
37
|
end
|
@@ -142,6 +143,10 @@ module CBin
|
|
142
143
|
|
143
144
|
#编译target名,如 seeyou
|
144
145
|
def target_name
|
146
|
+
podfile_path = Pod::Config.instance.podfile_path
|
147
|
+
unless podfile_path
|
148
|
+
return ""
|
149
|
+
end
|
145
150
|
@target_name ||= begin
|
146
151
|
target_name_str = Pod::Config.instance.podfile.root_target_definitions.first.children.first.to_s
|
147
152
|
target_name_str[5,target_name_str.length]
|
@@ -48,6 +48,10 @@ module CBin
|
|
48
48
|
|
49
49
|
def Utils.uses_frameworks?
|
50
50
|
uses_frameworks = false
|
51
|
+
podfile_path = Pod::Config.instance.podfile_path
|
52
|
+
unless podfile_path
|
53
|
+
return true
|
54
|
+
end
|
51
55
|
Pod::Config.instance.podfile.target_definitions.each do |key,value|
|
52
56
|
if key != "Pods"
|
53
57
|
uses_frameworks = value.uses_frameworks?
|
@@ -10,9 +10,10 @@ module CBin
|
|
10
10
|
attr_reader :swift_module_path
|
11
11
|
attr_reader :fwk_path
|
12
12
|
|
13
|
-
def initialize(name, platform)
|
13
|
+
def initialize(name, platform, embedded=false)
|
14
14
|
@name = name
|
15
15
|
@platform = platform
|
16
|
+
@embedded = embedded
|
16
17
|
end
|
17
18
|
|
18
19
|
def make
|
@@ -79,6 +80,11 @@ module CBin
|
|
79
80
|
|
80
81
|
def make_root
|
81
82
|
@root_path = Pathname.new(@platform)
|
83
|
+
|
84
|
+
if @embedded
|
85
|
+
@root_path += Pathname.new(@name + '.embeddedframework')
|
86
|
+
end
|
87
|
+
|
82
88
|
@root_path.mkpath unless @root_path.exist?
|
83
89
|
end
|
84
90
|
end
|
@@ -42,10 +42,11 @@ module CBin
|
|
42
42
|
|
43
43
|
UI.puts "framework lipo build"
|
44
44
|
|
45
|
-
if CBin::Build::Utils.is_swift_module(@spec) || !CBin::Build::Utils.uses_frameworks?
|
45
|
+
# if CBin::Build::Utils.is_swift_module(@spec) || !CBin::Build::Utils.uses_frameworks?
|
46
|
+
if CBin::Build::Utils.is_framework(@spec) # 默认生成framework为静态库.a
|
46
47
|
UI.section("Building static Library #{@spec}") do
|
47
48
|
# defines = compile
|
48
|
-
UI.puts "
|
49
|
+
UI.puts "static framework lipo build"
|
49
50
|
# build_sim_libraries(defines)
|
50
51
|
output = framework.versions_path + Pathname.new(@spec.name)
|
51
52
|
|
@@ -185,7 +186,8 @@ module CBin
|
|
185
186
|
archs = ios_architectures
|
186
187
|
# archs = %w[arm64 armv7 armv7s]
|
187
188
|
archs.map do |arch|
|
188
|
-
xcodebuild(defines, "ARCHS=\'#{arch}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'","build-#{arch}",@build_model)
|
189
|
+
xcodebuild(defines, "-sdk iphoneos ARCHS=\'#{arch}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'","build-#{arch}",@build_model)
|
190
|
+
# xcodebuild(defines, "-sdk iphoneos ARCHS=\'#{arch}\' ","build-#{arch}",@build_model)
|
189
191
|
end
|
190
192
|
# else
|
191
193
|
# xcodebuild(defines,options)
|
@@ -208,12 +210,12 @@ module CBin
|
|
208
210
|
end
|
209
211
|
end
|
210
212
|
|
211
|
-
def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
|
212
|
-
|
213
|
+
def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug', configuration = 'Release')
|
214
|
+
|
213
215
|
unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
|
214
|
-
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{File.join(File.expand_path("..", build_dir), File.basename(build_dir))} clean build -configuration #{
|
216
|
+
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{File.join(File.expand_path("..", build_dir), File.basename(build_dir))} clean build -configuration #{configuration} -target #{target_name} -project ./Pods/Pods.xcodeproj 2>&1"
|
215
217
|
else
|
216
|
-
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{
|
218
|
+
command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{configuration} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
|
217
219
|
end
|
218
220
|
|
219
221
|
UI.message "command = #{command}"
|
@@ -264,14 +266,33 @@ module CBin
|
|
264
266
|
module_map = File.read(module_map_file)
|
265
267
|
end
|
266
268
|
elsif public_headers.map(&:basename).map(&:to_s).include?("#{@spec.name}-umbrella.h")
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
269
|
+
archs = ios_architectures + ios_architectures_sim
|
270
|
+
swift_Compatibility_Header = "build-#{archs.first}/Swift\ Compatibility\ Header/#{@spec.name}-Swift.h"
|
271
|
+
# 策略:针对混编组件,modulemap写入-Swift.h by hm 21.11.15
|
272
|
+
if File.exist?(swift_Compatibility_Header) # swift或swift与oc混编工程
|
273
|
+
module_map = <<-MAP
|
274
|
+
framework module #{@spec.name} {
|
275
|
+
umbrella header "#{@spec.name}-umbrella.h"
|
276
|
+
|
277
|
+
export *
|
278
|
+
module * { export * }
|
279
|
+
}
|
280
|
+
|
281
|
+
module #{@spec.name}.Swift {
|
282
|
+
header "#{@spec.name}-Swift.h"
|
283
|
+
requires objc
|
284
|
+
}
|
285
|
+
MAP
|
286
|
+
else
|
287
|
+
module_map = <<-MAP
|
288
|
+
framework module #{@spec.name} {
|
289
|
+
umbrella header "#{@spec.name}-umbrella.h"
|
290
|
+
|
291
|
+
export *
|
292
|
+
module * { export * }
|
293
|
+
}
|
294
|
+
MAP
|
295
|
+
end
|
275
296
|
end
|
276
297
|
|
277
298
|
unless module_map.nil?
|
@@ -332,6 +353,8 @@ module CBin
|
|
332
353
|
if bundles.count > 0
|
333
354
|
UI.message "Copying bundle files #{bundles}"
|
334
355
|
bundle_files = bundles.join(' ')
|
356
|
+
raise Informative, "source resource bundle no exist #{bundle_files}" unless File.exist?(bundle_files)
|
357
|
+
UI.message "[build dir]Copying resources current_path:#{Dir.pwd} bundle_files:#{bundle_files} res_path:#{framework.resources_path}"
|
335
358
|
`cp -rp #{bundle_files} #{framework.resources_path} 2>&1`
|
336
359
|
end
|
337
360
|
|
@@ -343,7 +366,7 @@ module CBin
|
|
343
366
|
end
|
344
367
|
raise "copy_resources #{spec_source_dir} no exist " unless File.exist?(spec_source_dir)
|
345
368
|
|
346
|
-
spec_source_dir = File.join(Dir.pwd,"#{@spec.name}")
|
369
|
+
# spec_source_dir = File.join(Dir.pwd,"#{@spec.name}") # 去除重复赋值,有些资源放在pods/组件目录下
|
347
370
|
real_source_dir = spec_source_dir
|
348
371
|
end
|
349
372
|
|
@@ -362,8 +385,10 @@ module CBin
|
|
362
385
|
resources.each do |source|
|
363
386
|
escape_resource << Shellwords.join(source)
|
364
387
|
end
|
365
|
-
|
366
|
-
|
388
|
+
bundle_files = escape_resource.join(' ')
|
389
|
+
raise Informative, "source resource bundle no exist #{bundle_files}" unless File.exist?(bundle_files)
|
390
|
+
UI.message "[search dir]Copying resources current_path:#{Dir.pwd} bundle_files:#{bundle_files} res_path:#{framework.resources_path}"
|
391
|
+
`cp -rp #{bundle_files} #{framework.resources_path} 2>&1`
|
367
392
|
end
|
368
393
|
end
|
369
394
|
|
@@ -22,9 +22,10 @@ module Pod
|
|
22
22
|
def podfile_for_spec(spec)
|
23
23
|
generator = self
|
24
24
|
dir = configuration.gen_dir_for_pod(spec.name)
|
25
|
+
project_name = configuration.project_name_for_spec(spec)
|
25
26
|
|
26
27
|
Pod::Podfile.new do
|
27
|
-
project "#{
|
28
|
+
project "#{project_name}.xcodeproj"
|
28
29
|
workspace "#{spec.name}.xcworkspace"
|
29
30
|
|
30
31
|
plugin 'cocoapods-generate'
|
@@ -34,7 +35,7 @@ module Pod
|
|
34
35
|
generator.podfile_plugins.each do |name, options|
|
35
36
|
plugin(*[name, options].compact)
|
36
37
|
end
|
37
|
-
|
38
|
+
# Pod::UI::puts "====use_frameworks:#{generator.configuration.use_frameworks?}"
|
38
39
|
use_frameworks!(generator.configuration.use_frameworks?)
|
39
40
|
|
40
41
|
if (supported_swift_versions = generator.supported_swift_versions)
|
@@ -101,16 +102,20 @@ module Pod
|
|
101
102
|
|
102
103
|
|
103
104
|
inhibit_all_warnings! if generator.inhibit_all_warnings?
|
104
|
-
use_modular_headers! if generator.use_modular_headers?
|
105
|
+
# use_modular_headers! if generator.use_modular_headers?
|
106
|
+
# podfile 配置 use_frameworks! :linkage => :static 支持modulemap by hm 21/10/19
|
107
|
+
# Pod::UI::puts "====use_frameworks_value:#{generator.use_frameworks_value}"
|
108
|
+
unless generator.use_frameworks_value
|
109
|
+
use_modular_headers! # 默认组件没有配置或者没有podfile,支持modulemap by hm 21/10/20
|
110
|
+
end
|
111
|
+
if generator.use_modular_headers? || generator.use_frameworks_value.to_s == '{:linkage=>:static}'
|
112
|
+
use_modular_headers!
|
113
|
+
end
|
105
114
|
|
106
115
|
# This is the pod declaration for the local pod,
|
107
116
|
# it will be inherited by the concrete target definitions below
|
108
|
-
|
109
117
|
pod_options = generator.dependency_compilation_kwargs(spec.name)
|
110
118
|
pod_options[:path] = spec.defined_in_file.relative_path_from(dir).to_s
|
111
|
-
# generator.configuration.podfile.dependencies[0].external_source
|
112
|
-
|
113
|
-
|
114
119
|
{ testspecs: test_specs, appspecs: app_specs }.each do |key, specs|
|
115
120
|
pod_options[key] = specs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless specs.empty?
|
116
121
|
end
|
@@ -196,4 +201,3 @@ module Pod
|
|
196
201
|
end
|
197
202
|
end
|
198
203
|
end
|
199
|
-
|
@@ -6,7 +6,7 @@ Pod::HooksManager.register('cocoapods-bb-bin', :pre_install) do |_context, _|
|
|
6
6
|
require 'cocoapods-bb-bin/native'
|
7
7
|
|
8
8
|
#pod bin update || install 不走这里
|
9
|
-
if $ARGV[1]
|
9
|
+
if $ARGV[1] == 'update' || $ARGV[1] != 'install'
|
10
10
|
|
11
11
|
else
|
12
12
|
# pod bin repo update 更新二进制私有源
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-bb-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- humin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -62,6 +62,9 @@ dependencies:
|
|
62
62
|
name: cocoapods-bb-xcframework
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 0.2.2
|
65
68
|
- - "<"
|
66
69
|
- !ruby/object:Gem::Version
|
67
70
|
version: '1.0'
|
@@ -69,6 +72,9 @@ dependencies:
|
|
69
72
|
prerelease: false
|
70
73
|
version_requirements: !ruby/object:Gem::Requirement
|
71
74
|
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.2.2
|
72
78
|
- - "<"
|
73
79
|
- !ruby/object:Gem::Version
|
74
80
|
version: '1.0'
|
@@ -190,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
196
|
- !ruby/object:Gem::Version
|
191
197
|
version: '0'
|
192
198
|
requirements: []
|
193
|
-
rubygems_version: 3.
|
199
|
+
rubygems_version: 3.2.30
|
194
200
|
signing_key:
|
195
201
|
specification_version: 4
|
196
202
|
summary: cocoapods-bb-bin is a plugin which helps develpers switching pods between
|