cocoapods-bb-bin 0.1.2 → 0.1.6
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 +2 -2
- data/lib/cocoapods-bb-bin/command/bin/auto.rb +28 -5
- data/lib/cocoapods-bb-bin/config/config.rb +1 -3
- data/lib/cocoapods-bb-bin/config/config_builder.rb +3 -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 +24 -0
- data/lib/cocoapods-bb-bin/helpers/framework.rb +7 -1
- data/lib/cocoapods-bb-bin/helpers/framework_builder.rb +16 -10
- data/lib/cocoapods-bb-bin/helpers/spec_source_creator.rb +2 -0
- data/lib/cocoapods-bb-bin/native/podfile_generator.rb +12 -8
- data/lib/cocoapods-bb-bin/source_provider_hook.rb +1 -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: 35aca7dea61c61142b1eacf128996c1f165ef093cf13bb78b258c8db0405789c
|
4
|
+
data.tar.gz: 190ae0e9bb158819c764b8da68fe71af4b3c18f369a2889f47ebf45470d08f19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d238db6291137bf5c11e007cbd8fe34878bc5825c287c0b90367e22e1813a9cd290cd8f743a141fc2d5df1fa99a0a7d28b8bf8fc598093c3a0f11bb0d2e9fb18
|
7
|
+
data.tar.gz: 9dd33e6134e4eb707d7e0468cb8655881b9b89affa0027c1dc33b9b53fcc59d776e349cdede9fc02086ff7bb5dca8068c83afbdcd8cf08ed3c818b56fa4538f2
|
@@ -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
|
|
@@ -30,11 +30,10 @@ module Pod
|
|
30
30
|
if @help
|
31
31
|
else
|
32
32
|
puts "开始执行自动推送操作,"
|
33
|
-
podfile_path = link_podfile # 创建软链接
|
34
|
-
|
35
33
|
@env = argv.option('env') || 'dev'
|
36
34
|
CBin.config.set_configuration_env(@env)
|
37
35
|
|
36
|
+
podfile_path = link_podfile # 创建软链接
|
38
37
|
@podspec = argv.shift_argument || find_podspec
|
39
38
|
@specification = Specification.from_file(@podspec)
|
40
39
|
|
@@ -200,9 +199,12 @@ module Pod
|
|
200
199
|
end
|
201
200
|
end
|
202
201
|
end
|
202
|
+
raise Informative, "podspec File no exist, please check" unless name
|
203
203
|
return name
|
204
204
|
end
|
205
205
|
|
206
|
+
private
|
207
|
+
|
206
208
|
# podfile创建软链接
|
207
209
|
def link_podfile
|
208
210
|
current_path = Pathname.pwd
|
@@ -210,16 +212,37 @@ module Pod
|
|
210
212
|
if filename == 'Podfile'
|
211
213
|
filepath = File.join(current_path,"#{filename}")
|
212
214
|
return filepath
|
215
|
+
else
|
216
|
+
if filename != "." and filename != ".."
|
217
|
+
filepath = File.join(current_path,"#{filename}")
|
218
|
+
if File.directory?(filepath)
|
219
|
+
# 二级目录遍历Podfile
|
220
|
+
Dir.foreach(filepath) do |filename|
|
221
|
+
if filename == 'Podfile'
|
222
|
+
podfile_path = File.join(filepath,"#{filename}")
|
223
|
+
create_link(podfile_path, current_path)
|
224
|
+
pods_path = File.join(filepath,"Pods")
|
225
|
+
create_link(pods_path, current_path)
|
226
|
+
return podfile_path
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
213
231
|
end
|
214
232
|
end
|
215
233
|
# 没有找到podfile(小组件)
|
216
234
|
podfile_path = File.join(current_path,"Example/Podfile")
|
217
235
|
if File.file?(podfile_path)
|
218
|
-
|
219
|
-
|
236
|
+
create_link(podfile_path, current_path)
|
237
|
+
pods_path = File.join(current_path,"Example/Pods")
|
238
|
+
create_link(pods_path, current_path)
|
220
239
|
end
|
221
240
|
end
|
222
|
-
|
241
|
+
|
242
|
+
def create_link(source_file, dest_file)
|
243
|
+
system("ln -s #{source_file} #{dest_file}")
|
244
|
+
UI.puts "create link source:#{source_file} dest:#{dest_file}"
|
245
|
+
end
|
223
246
|
end
|
224
247
|
end
|
225
248
|
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
|
-
|
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
|
@@ -10,6 +10,9 @@ module CBin
|
|
10
10
|
if Utils.uses_frameworks?
|
11
11
|
return true
|
12
12
|
end
|
13
|
+
if Utils.is_generate_frameworks(spec)
|
14
|
+
return true
|
15
|
+
end
|
13
16
|
|
14
17
|
return Utils.is_swift_module(spec)
|
15
18
|
end
|
@@ -45,6 +48,10 @@ module CBin
|
|
45
48
|
|
46
49
|
def Utils.uses_frameworks?
|
47
50
|
uses_frameworks = false
|
51
|
+
podfile_path = Pod::Config.instance.podfile_path
|
52
|
+
unless podfile_path
|
53
|
+
return true
|
54
|
+
end
|
48
55
|
Pod::Config.instance.podfile.target_definitions.each do |key,value|
|
49
56
|
if key != "Pods"
|
50
57
|
uses_frameworks = value.uses_frameworks?
|
@@ -57,6 +64,23 @@ module CBin
|
|
57
64
|
return uses_frameworks
|
58
65
|
end
|
59
66
|
|
67
|
+
def Utils.is_generate_frameworks(spec)
|
68
|
+
# framework
|
69
|
+
zip_file = CBin::Config::Builder.instance.framework_zip_file(spec) + ".zip"
|
70
|
+
res = File.exist?(zip_file)
|
71
|
+
Pod::UI::puts "zip_file = #{zip_file}"
|
72
|
+
unless res
|
73
|
+
# xcframework
|
74
|
+
zip_file = CBin::Config::Builder.instance.xcframework_zip_file(spec) + ".zip"
|
75
|
+
res = File.exist?(zip_file)
|
76
|
+
Pod::UI::puts "zip_file = #{zip_file}"
|
77
|
+
end
|
78
|
+
if res
|
79
|
+
is_framework = true
|
80
|
+
end
|
81
|
+
return is_framework
|
82
|
+
end
|
83
|
+
|
60
84
|
end
|
61
85
|
|
62
86
|
end
|
@@ -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}"
|
@@ -332,6 +334,8 @@ module CBin
|
|
332
334
|
if bundles.count > 0
|
333
335
|
UI.message "Copying bundle files #{bundles}"
|
334
336
|
bundle_files = bundles.join(' ')
|
337
|
+
raise Informative, "source resource bundle no exist #{bundle_files}" unless File.exist?(bundle_files)
|
338
|
+
UI.message "[build dir]Copying resources current_path:#{Dir.pwd} bundle_files:#{bundle_files} res_path:#{framework.resources_path}"
|
335
339
|
`cp -rp #{bundle_files} #{framework.resources_path} 2>&1`
|
336
340
|
end
|
337
341
|
|
@@ -343,7 +347,7 @@ module CBin
|
|
343
347
|
end
|
344
348
|
raise "copy_resources #{spec_source_dir} no exist " unless File.exist?(spec_source_dir)
|
345
349
|
|
346
|
-
spec_source_dir = File.join(Dir.pwd,"#{@spec.name}")
|
350
|
+
# spec_source_dir = File.join(Dir.pwd,"#{@spec.name}") # 去除重复赋值,有些资源放在pods/组件目录下
|
347
351
|
real_source_dir = spec_source_dir
|
348
352
|
end
|
349
353
|
|
@@ -362,8 +366,10 @@ module CBin
|
|
362
366
|
resources.each do |source|
|
363
367
|
escape_resource << Shellwords.join(source)
|
364
368
|
end
|
365
|
-
|
366
|
-
|
369
|
+
bundle_files = escape_resource.join(' ')
|
370
|
+
raise Informative, "source resource bundle no exist #{bundle_files}" unless File.exist?(bundle_files)
|
371
|
+
UI.message "[search dir]Copying resources current_path:#{Dir.pwd} bundle_files:#{bundle_files} res_path:#{framework.resources_path}"
|
372
|
+
`cp -rp #{bundle_files} #{framework.resources_path} 2>&1`
|
367
373
|
end
|
368
374
|
end
|
369
375
|
|
@@ -22,8 +22,10 @@ module CBin
|
|
22
22
|
def create
|
23
23
|
# spec = nil
|
24
24
|
if CBin::Build::Utils.is_framework(@code_spec)
|
25
|
+
Pod::UI::puts "make framework spec"
|
25
26
|
spec = create_framework_from_code_spec
|
26
27
|
else
|
28
|
+
Pod::UI::puts "make source code spec"
|
27
29
|
spec = create_from_code_spec
|
28
30
|
end
|
29
31
|
|
@@ -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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- humin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|