cocoapods-bb-xcframework 0.2.5 → 0.2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f98fbc6d1facd7259f106f15bc4baae1d7d42e4fbdde07f87e2418ad5d631631
4
- data.tar.gz: ac5b4b39621ccb83012f6dbb22e136495e00bf0b75177a8f49eabb16d631019f
3
+ metadata.gz: '08c6a4feaf42fcaf08cf0850541fd0d64f28e2f35fce462bee195625b3aa02b1'
4
+ data.tar.gz: 2d10b0fdf6c83246d5858f21edade1cfa6c731099c3eae9931303144eecafd5b
5
5
  SHA512:
6
- metadata.gz: f949933c7e4c8d292583e1d6b228bb1ee312dc05d34c2d7dc7fce4d25dab8af19b1ad855f1388ca482e9d0c7fef53f3206f231127437131f381e1e6a0952dc15
7
- data.tar.gz: 3ca5be14ad4b76e620849d0bc85be6e9a4c8cef510942be395ce9e8b4151e834f44f38892f3492c9e5755444bc6380ba9f88d71e2ef021b2d02371ae0dcf827d
6
+ metadata.gz: 21f47c1d01df0b98de368bb131f6f2f384f180c429f10bb20d7ff96d18cc19ed74d41747c517f0c1b94e743d6a6d75762e0656aeb9d82a220eecc69af61a8401
7
+ data.tar.gz: 19ab879bc014ef08bd422ba70fdd9e6caed3e8f5b0b8b802b7af8f4f5b493fea78fbe3674ca6fd028de95b0de03bdefebfe5e8b1fef0997090b60b32ae7405c3
data/README.md CHANGED
@@ -14,6 +14,7 @@
14
14
  - 支持 `subspec` 打包
15
15
  - 支持二进制库是否`生成符号表`、`生成Mac Catalyst`(默认生成)详见`pod xcframework --help`
16
16
  - 支持Xcode14打包,去除armv7/i386架构
17
+ - 支持生成静态链接库/动态共享库
17
18
 
18
19
  ## Installation
19
20
 
@@ -61,6 +62,10 @@ Options:
61
62
  --no-support-maccatalyst package support
62
63
  generate
63
64
  MacCatalyst
65
+ --no-support-dynamic package support
66
+ Mach-O dynamically
67
+ linked shared
68
+ library
64
69
  --allow-root Allows CocoaPods
65
70
  to run as root
66
71
  --silent Show nothing
@@ -35,7 +35,8 @@ module Pod
35
35
  ['--no-static-library', 'package not use static library'],
36
36
  ['--enable-bitcode', 'package enable bitcode'],
37
37
  ['--no-symbols', 'package not use symbols'], # 符号表
38
- ['--no-support-maccatalyst', 'package support generate MacCatalyst'] # 是否支持MacCatalyst方式支持iOS应用在mac平台运行库生成
38
+ ['--no-support-maccatalyst', 'package support generate MacCatalyst'], # 是否支持MacCatalyst方式支持iOS应用在mac平台运行库生成
39
+ ['--no-support-dynamic', 'package support Mach-O dynamically linked shared library'] # 是否支持动态库生成
39
40
  ].concat super
40
41
  end
41
42
 
@@ -52,6 +53,7 @@ module Pod
52
53
  @enable_bitcode = argv.flag?('enable-bitcode',false)
53
54
  @symbols = argv.flag?('symbols',true)
54
55
  @support_maccatalyst = argv.flag?('support-maccatalyst',true)
56
+ @support_dynamic = argv.flag?('support-dynamic',false)
55
57
  config.static_library_enable = @use_static_library
56
58
  super
57
59
  end
@@ -62,7 +64,8 @@ module Pod
62
64
  end
63
65
 
64
66
  def run
65
- frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst)
67
+ UI.puts "argvs @name:#{@name} @source:#{@source} @spec_sources:#{@spec_sources}"
68
+ frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst, @support_dynamic)
66
69
  frameworker.run
67
70
  end
68
71
  end
@@ -3,7 +3,7 @@ module Pod
3
3
  include PodUtil
4
4
  include DirUtil
5
5
  include Config::Mixin
6
- def initialize(name, source, spec_sources, subspecs, configuration, force, use_modular_headers=true, enable_bitcode=false, symbols=true, support_maccatalyst=true)
6
+ def initialize(name, source, spec_sources, subspecs, configuration, force, use_modular_headers=true, enable_bitcode=false, symbols=true, support_maccatalyst=true, support_dynamic=false)
7
7
  @name = name
8
8
  @source = source
9
9
  @spec_sources = spec_sources
@@ -14,10 +14,12 @@ module Pod
14
14
  @enable_bitcode = enable_bitcode
15
15
  @symbols = symbols
16
16
  @support_maccatalyst = support_maccatalyst
17
+ @support_dynamic = support_dynamic
17
18
  end
18
19
 
19
20
  def run
20
21
  spec = spec_with_path @name
22
+ UI.warn "正在生成XCFramework #{spec.name}(#{spec.version})"
21
23
  @is_spec_from_path = true if spec
22
24
  spec ||= spec_with_name @name
23
25
 
@@ -41,7 +43,8 @@ module Pod
41
43
  @spec_sources,
42
44
  true,
43
45
  @use_modular_headers,
44
- @enable_bitcode
46
+ @enable_bitcode,
47
+ @support_dynamic
45
48
  )
46
49
 
47
50
  perform_build(
@@ -62,7 +65,8 @@ module Pod
62
65
  spec,
63
66
  @configuration,
64
67
  @symbols,
65
- @support_maccatalyst
68
+ @support_maccatalyst,
69
+ @support_dynamic
66
70
  )
67
71
  builder.build
68
72
  builder.outputs target_dir
@@ -1,3 +1,3 @@
1
1
  module CocoapodsXCFramework
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6.1"
3
3
  end
@@ -63,7 +63,7 @@ module Pod
63
63
  Sandbox.new(config.sandbox_root)
64
64
  end
65
65
 
66
- def installation_root sandbox, spec, subspecs, sources,use_frameworks = true,use_modular_headers = true, enable_bitcode = false
66
+ def installation_root sandbox, spec, subspecs, sources,use_frameworks = true,use_modular_headers = true, enable_bitcode = false, support_dynamic=false
67
67
  podfile = podfile_from_spec(
68
68
  @path,
69
69
  spec,
@@ -72,6 +72,23 @@ module Pod
72
72
  use_frameworks,
73
73
  use_modular_headers
74
74
  )
75
+ other_flags=""
76
+ if support_dynamic
77
+ # 解析podspec获取依赖关系
78
+ spec.dependencies.uniq.each do |dependency|
79
+ other_flags << "-framework #{dependency.name} "
80
+ end
81
+ # spec.frameworks系统库没有提供公共方法,故手动解析引用系统库
82
+ spec_hash = spec.to_hash
83
+ spec_hash.uniq.each do |configuration|
84
+ key = configuration[0]
85
+ if key == 'frameworks'
86
+ val = configuration[1]
87
+ other_flags << "-framework #{val} "
88
+ end
89
+ end
90
+ end
91
+ UI.puts "support_dynamic:#{support_dynamic} other_flags: #{other_flags}"
75
92
 
76
93
  installer = Installer.new(sandbox, podfile)
77
94
  installer.repo_update = true
@@ -91,6 +108,11 @@ module Pod
91
108
  if target.name == spec.name
92
109
  target.build_configurations.each do |configuration|
93
110
  configuration.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
111
+ # 动态链接库需要配置project工程库依赖,否则导致无法编译通过 by hm 23/7/13
112
+ if !other_flags.empty?
113
+ UI.puts "configuration other_flags: #{other_flags}"
114
+ configuration.build_settings['OTHER_LDFLAGS'] = "#{other_flags}"
115
+ end
94
116
  end
95
117
  end
96
118
  end
@@ -6,7 +6,7 @@ module Pod
6
6
  include XcodeProjHelper
7
7
  include PodUtil
8
8
  include Config::Mixin
9
- def initialize(installer, source_dir, sandbox_root, spec, configuration, symbols=true, support_maccatalyst=true)
9
+ def initialize(installer, source_dir, sandbox_root, spec, configuration, symbols=true, support_maccatalyst=true, support_dynamic=false)
10
10
  # def initialize(platform, installer, source_dir, sandbox_root, spec, config)
11
11
  # @platform = platform
12
12
  @installer = installer
@@ -21,23 +21,38 @@ module Pod
21
21
  @outputs = Hash.new
22
22
  @symbols = symbols
23
23
  @support_maccatalyst = support_maccatalyst
24
+ @support_dynamic = support_dynamic
24
25
  end
25
26
 
26
27
  def build
27
28
  UI.puts("Building framework #{@spec} with configuration #{@configuration}")
28
- UI.puts "Work dir is :#{@sandbox_root}"
29
+ UI.puts "Work dir is :#{@sandbox_root} isSymbols:#{@symbols} isDynamic:#{@support_dynamic}"
29
30
  # defines = "GCC_PREPROCESSOR_DEFINITIONS='$(inherited) PodsDummy_Pods_#{@spec.name}=PodsDummy_PodPackage_#{@spec.name}'"
30
31
  defines = ""
31
32
  if @configuration == 'Debug'
32
- defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=YES ONLY_ACTIVE_ARCH=NO'
33
+ if @support_dynamic
34
+ defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=YES ONLY_ACTIVE_ARCH=NO MACH_O_TYPE=mh_dylib'
35
+ else
36
+ defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=YES ONLY_ACTIVE_ARCH=NO MACH_O_TYPE=staticlib'
37
+ end
33
38
  else
34
39
  if @symbols
35
- defines << "GCC_GENERATE_DEBUGGING_SYMBOLS=YES" # Release模式需要符号表应于问题排查(二进制切源码操作) by hm 21/10/13
40
+ if @support_dynamic
41
+ defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=YES MACH_O_TYPE=mh_dylib'
42
+ else
43
+ defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=YES MACH_O_TYPE=staticlib'
44
+ end
45
+ # defines << "GCC_GENERATE_DEBUGGING_SYMBOLS=YES" # Release模式需要符号表应于问题排查(二进制切源码操作) by hm 21/10/13
36
46
  else
37
- defines << "GCC_GENERATE_DEBUGGING_SYMBOLS=NO" # 去除符号表
47
+ if @support_dynamic
48
+ defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=NO MACH_O_TYPE=mh_dylib'
49
+ else
50
+ defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=NO MACH_O_TYPE=staticlib'
51
+ end
52
+ # defines << "GCC_GENERATE_DEBUGGING_SYMBOLS=NO" # 去除符号表
38
53
  end
39
54
  end
40
-
55
+
41
56
  build_all_device defines
42
57
 
43
58
  collect_xc_frameworks
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-xcframework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-31 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
- rubygems_version: 3.4.12
109
+ rubygems_version: 3.4.16
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: 把podspec打包成xcframework的小工具。packager pod to a xcframework