cocoapods-bb-bin 0.2.11.3 → 0.2.12.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2557c0e6e4b07fa15768d1876528509d5bbb917503c7d63bb41118c78471bafb
4
- data.tar.gz: cbb51d63b2e18c2725a3b1c807c5cb1c2417663c7e4e0e5780fcc15c4d78ff80
3
+ metadata.gz: 513d66c8a95960b33e0aab22e3bcb22932d3670b1e252a29599080e037229ca5
4
+ data.tar.gz: 6669c915cc922f2049714b3b2d80a1022a4889cbf1de00f08abf86ba59144bfa
5
5
  SHA512:
6
- metadata.gz: c514d24c75bdc9f09c890bdd40f9bdb7ab04c99582bcdf820cde95dd6745e7c0003b4a1aa85ab3cbf95c0f891a647bec9be194139e9573ec5e81d0d0a7297645
7
- data.tar.gz: 926e17d5de987e55b02b4a6ec7a1204af17a7ba302332c44481b1a1ae0b457ae47debfb421596f2f1711b56d522842e6e6c8c67d0471d284a61f7368ee9a5404
6
+ metadata.gz: 469be51e7790b3ea7590cd1a4f82ddd1d8af3e29e748e377088a52d7248d770c6c40bfcef1a9f2e7dd2df142245e6e6f1ab0e15483c9b68dd7db66078191b241
7
+ data.tar.gz: 245147d9cff2f982077ad8769fd24f2f604b1e6257e7e50ba06eab80f94eab43a4016f18c6f1b31eaf26c64a8a29cca61913faae1c15551ae4436258586b8b4f
@@ -204,7 +204,7 @@ module Pod
204
204
  raise Informative, "#{path} File no exist, please check" unless File.exist?(path)
205
205
  project = Xcodeproj::Project.open(path)
206
206
  project.build_configurations.each do |x|
207
- x.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = true #设置生成swift inter
207
+ x.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' #设置生成swift inter
208
208
  end
209
209
  project.save
210
210
  end
@@ -33,7 +33,17 @@ module Pod
33
33
  @simulator = argv.flag?('simulator', false )
34
34
 
35
35
  @config = Pod::Config.instance
36
-
36
+ puts "=== pod bin code initialize begin ===".green
37
+ puts "argv.class: #{argv.class}"
38
+ puts "argv.to_s: #{argv}"
39
+ puts "argv.arguments: #{argv.arguments.inspect}"
40
+ puts "argv.options: #{argv.options.inspect if argv.respond_to?(:options)}"
41
+ puts "argv.flags: #{argv.flags.inspect if argv.respond_to?(:flags)}"
42
+ puts "argv.option('source'): #{argv.option('source').inspect}"
43
+ puts "@codeSource: #{@codeSource.inspect}"
44
+ puts "@names: #{@names.inspect}"
45
+ puts "@list: #{@list}, @clean: #{@clean}, @all_clean: #{@all_clean}, @simulator: #{@simulator}"
46
+ puts "=== pod bin code initialize end ===".green
37
47
  super
38
48
  end
39
49
 
@@ -72,8 +82,13 @@ module Pod
72
82
  raise "找不到 #{lib_file}"
73
83
  end
74
84
  UI.puts "#{lib_file}"
75
-
76
- target_path = @codeSource || download_source(name)
85
+ if @codeSource
86
+ puts "add name:#{name} local path:#{@codeSource}"
87
+ target_path = @codeSource
88
+ else
89
+ puts "add name:#{name} download_source"
90
+ target_path = download_source(name)
91
+ end
77
92
  puts "====add lib_file: #{lib_file} target_path: #{target_path} name: #{name}"
78
93
  link(lib_file,target_path,name)
79
94
  end
@@ -110,7 +125,16 @@ module Pod
110
125
  # 获取external_source 下的仓库
111
126
  # @return spec
112
127
  def fetch_external_source(dependency ,podfile , lockfile, sandbox,use_lockfile_options)
113
- source = ExternalSources.from_dependency(dependency, podfile.defined_in_file, true)
128
+ # CocoaPods 内部会假定 external_source 是 Hash,这里兜底处理 nil 场景
129
+ if dependency.external_source.nil?
130
+ dependency.instance_variable_set(:@external_source, {})
131
+ end
132
+ installation_options = podfile.installation_options
133
+ source = if use_lockfile_options && lockfile && checkout_options = lockfile.checkout_options_for_pod_named(dependency.root_name)
134
+ ExternalSources.from_params(checkout_options, dependency, podfile.defined_in_file, installation_options.clean?)
135
+ else
136
+ ExternalSources.from_dependency(dependency, podfile.defined_in_file, installation_options.clean?)
137
+ end
114
138
  source.fetch(sandbox)
115
139
  end
116
140
 
@@ -124,13 +148,19 @@ module Pod
124
148
  `dwarfdump "#{lib_file}" | grep "AT_comp_dir" | head -1 | cut -d \\" -f2 `
125
149
  EOF
126
150
  dir = (`dwarfdump "#{lib_file}" | grep "AT_comp_dir" | head -1 | cut -d \\" -f2 `)
127
- UI.puts "dwarfdump dir = #{dir}"
151
+ UI.puts "lib_file = #{lib_file}"
152
+ UI.puts "dwarfdump dir = #{dir} type:#{dir.class}"
153
+ if dir.empty?
154
+ msg = "Unknown dwarfdump data for `#{basename}` 请找hm确认,当前组件是否二进制静态库?动态库不支持"
155
+ raise Informative, msg
156
+ end
128
157
  # if Pathname.new(lib_file).extname == ".a"
129
158
  # sub_path = "#{basename}/bin-archive/#{basename}"
130
159
  # else
131
160
  # sub_path = "#{basename}"
132
161
  # end
133
162
  sub_path = "#{basename}/bin-archive/#{basename}"
163
+ UI.puts "sub_path = #{sub_path}"
134
164
  dir = dir.gsub(sub_path, "").chomp
135
165
  UI.puts "Binary dir = #{dir}"
136
166
 
@@ -215,9 +245,9 @@ EOF
215
245
  # 构建xcframework架构需要根据实际二进制文件进行条件判断
216
246
  arm_name = ""
217
247
  if @simulator
218
- arm_name = "ios-arm64_i386_x86_64-simulator"
248
+ arm_name = "ios-arm64_x86_64-simulator" #"ios-arm64_i386_x86_64-simulator"
219
249
  else
220
- arm_name = "ios-arm64_armv7"
250
+ arm_name = "ios-arm64" #"ios-arm64_armv7"
221
251
  end
222
252
  temp_name = "#{arm_name}/#{name}.framework/#{name}"
223
253
  return File.join(filepath,temp_name) # TYSecKit.xcframework/ios-arm64_armv7/TYSecKit.framework/TYSecKit
@@ -116,7 +116,7 @@ module Pod
116
116
  raise Informative, "#{path} File no exist, please check" unless File.exist?(path)
117
117
  project = Xcodeproj::Project.open(path)
118
118
  project.build_configurations.each do |x|
119
- x.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = true #设置生成swift inter
119
+ x.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' #设置生成swift inter
120
120
  end
121
121
  project.save
122
122
  end
@@ -1,7 +1,7 @@
1
1
  require 'cocoapods'
2
2
 
3
3
  module CBin
4
- VERSION = '0.2.11.3'
4
+ VERSION = '0.2.12.0'
5
5
  end
6
6
 
7
7
  module Pod
@@ -9,9 +9,21 @@ module CBin
9
9
  attr_reader :code_spec
10
10
  attr_reader :spec
11
11
 
12
- def initialize(code_spec, platforms = 'ios')
12
+ def initialize(code_spec, platforms = nil) #'ios')
13
13
  @code_spec = code_spec
14
- @platforms = Array(platforms)
14
+ if platforms.nil? || Array(platforms).empty?
15
+ spec_hash = code_spec.to_hash
16
+ if spec_hash['platforms']
17
+ @platforms = spec_hash['platforms'].keys
18
+ elsif spec_hash['platform']
19
+ @platforms = [spec_hash['platform']]
20
+ else
21
+ @platforms = ['ios']
22
+ end
23
+ else
24
+ @platforms = Array(platforms).map(&:to_s)
25
+ end
26
+ puts "@platforms:#{@platforms}"
15
27
  validate!
16
28
  end
17
29
 
@@ -209,6 +221,8 @@ module CBin
209
221
  selected_platforms = platforms.select { |k, _v| @platforms.include?(k) }
210
222
  spec_hash['platforms'] = selected_platforms.empty? ? platforms : selected_platforms
211
223
 
224
+ puts "spec_hash:#{spec_hash}".yellow
225
+
212
226
  @spec = Pod::Specification.from_hash(spec_hash)
213
227
  @spec.description = <<-EOF
214
228
  converted automatically by plugin optimization
@@ -30,21 +30,60 @@ module CBin
30
30
  @support_dynamic = isGenDylib
31
31
 
32
32
  target_dir = "#{Dir.pwd}/#{@spec.name}-#{@spec.version}"
33
- UI.puts "build initialize...#{spec} target_dir:#{target_dir} 是否支持Mac Catalyst:#{support_maccatalyst} 是否生成动态库:#{isGenDylib}"
34
- UI.puts "spec_sources:#{spec_sources}"
35
- UI.puts "spec_sources:#{@spec_sources}"
33
+ UI.puts "build initialize...#{spec} spec_sources:#{spec_sources} target_dir:#{target_dir} 是否支持Mac Catalyst:#{support_maccatalyst} 是否生成动态库:#{isGenDylib}"
36
34
  end
37
35
 
38
36
  def build
39
37
  UI.section("Building xcframework #{@spec} 是否生成动态库:#{@support_dynamic}") do
40
38
  config.static_library_enable = @use_static_library # 一定要配置 true,否则调用xcframework生成命令无效
41
- frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst, @support_dynamic)
42
- frameworker.run
39
+ # 废弃,run_xcframework替代实现
40
+ # frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst, @support_dynamic)
41
+ # frameworker.run
42
+ # 生成二进制产物 by hm 26/2/4
43
+ run_xcframework
43
44
  # 拷贝
44
45
  cp_to_source_dir
45
46
  end
46
47
  end
47
48
 
49
+ def run_xcframework
50
+ spec_sources_str = if @spec_sources.is_a?(Array)
51
+ @spec_sources.join(',')
52
+ else
53
+ @spec_sources.to_s
54
+ end
55
+ argvs = [
56
+ "#{@name}", # name
57
+ "#{@source}", # spec
58
+ "--spec-sources=#{spec_sources_str}",
59
+ "--subspecs=#{@subspecs}",
60
+ "--configuration=#{@configuration}",
61
+ "--use-modular-headers=#{@use_modular_headers}",
62
+ "--archive-export", # 默认archive导出dylib
63
+ # "--no-archive-export",
64
+ ]
65
+ if @force
66
+ argvs += ['--force']
67
+ end
68
+ if @enable_bitcode
69
+ argvs += ['--enable-bitcode']
70
+ end
71
+ if @symbols
72
+ argvs += ['--symbols']
73
+ end
74
+ if @support_maccatalyst
75
+ argvs += ['--support-maccatalyst']
76
+ end
77
+ if @support_dynamic
78
+ argvs += ['--support-dynamic']
79
+ end
80
+ puts "make xcframework argvs: #{argvs}".yellow
81
+ archive = Pod::Command::Bin::XCFramework.new(CLAide::ARGV.new(argvs))
82
+ archive.validate!
83
+ sources_sepc = archive.run
84
+ return sources_sepc
85
+ end
86
+
48
87
  private
49
88
 
50
89
  def framework_folder_path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11.3
4
+ version: 0.2.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
@@ -83,7 +83,7 @@ dependencies:
83
83
  requirements:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: 0.2.6.4
86
+ version: 0.2.7.2
87
87
  - - "<"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.0'
@@ -93,7 +93,7 @@ dependencies:
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.2.6.4
96
+ version: 0.2.7.2
97
97
  - - "<"
98
98
  - !ruby/object:Gem::Version
99
99
  version: '1.0'
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubygems_version: 3.7.2
221
+ rubygems_version: 4.0.13
222
222
  specification_version: 4
223
223
  summary: cocoapods-bb-bin is a plugin which helps develpers switching pods between
224
224
  source code and binary.