cocoapods-bb-xcframework 0.2.4.1 → 0.2.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/README.md +10 -1
- data/lib/cocoapods-xcframework/command/xcframework.rb +4 -2
- data/lib/cocoapods-xcframework/frameworker.rb +4 -2
- data/lib/cocoapods-xcframework/gem_version.rb +1 -1
- data/lib/cocoapods-xcframework/util/pod_util.rb +1 -1
- data/lib/cocoapods-xcframework/xbuilder/xcode_xbuild.rb +40 -3
- data/lib/cocoapods-xcframework/xbuilder.rb +21 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22e95ef47a755371fe5138674d018ed4a05e4ec8d54806fe57e7cbdc95c3bca3
|
4
|
+
data.tar.gz: 91127f23608399c2031ef9245d4e194fca6f63f2a87763ac5cc6f5d8349a261d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c673977a36ecff7e43e0817af91471f60aeb56b52074386aead8222b374d5d86358b1e392938d6e0704fe6b6f8237fd33c057ffd5cb380c414e326f0713b807
|
7
|
+
data.tar.gz: ba6d977bee0cfea4d35f55bba4bc184661168cb753d4729734bd6df6f5a98326ac97b9bde04edb819caefedacb9226ee7491a78ecf913325c0565a5ed80d1131
|
data/README.md
CHANGED
@@ -12,7 +12,9 @@
|
|
12
12
|
- 支持 `Xcode` 新特性: `xcframework`
|
13
13
|
- 支持 `cocoapods` 绝大多数属性
|
14
14
|
- 支持 `subspec` 打包
|
15
|
-
-
|
15
|
+
- 支持二进制库是否`生成符号表`、`生成Mac Catalyst`(默认生成)详见`pod xcframework --help`
|
16
|
+
- 支持Xcode14打包,去除armv7/i386架构
|
17
|
+
- 支持生成静态链接库/动态共享库
|
16
18
|
|
17
19
|
## Installation
|
18
20
|
|
@@ -57,6 +59,13 @@ Options:
|
|
57
59
|
bitcode
|
58
60
|
--no-symbols package not use
|
59
61
|
symbols
|
62
|
+
--no-support-maccatalyst package support
|
63
|
+
generate
|
64
|
+
MacCatalyst
|
65
|
+
--no-support-dynamic package support
|
66
|
+
Mach-O dynamically
|
67
|
+
linked shared
|
68
|
+
library
|
60
69
|
--allow-root Allows CocoaPods
|
61
70
|
to run as root
|
62
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,7 @@ 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
|
+
frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst, @support_dynamic)
|
66
68
|
frameworker.run
|
67
69
|
end
|
68
70
|
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,6 +14,7 @@ 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
|
@@ -62,7 +63,8 @@ module Pod
|
|
62
63
|
spec,
|
63
64
|
@configuration,
|
64
65
|
@symbols,
|
65
|
-
@support_maccatalyst
|
66
|
+
@support_maccatalyst,
|
67
|
+
@support_dynamic
|
66
68
|
)
|
67
69
|
builder.build
|
68
70
|
builder.outputs target_dir
|
@@ -241,7 +241,7 @@ module Pod
|
|
241
241
|
Dir.glob("#{xcframework_path}/*/").each do |file|
|
242
242
|
['ios','macos','tvos', 'watchos'].each do |prefix|
|
243
243
|
last_path = file.split("/").last
|
244
|
-
if last_path =~ /#{prefix}/ and not last_path =~ /simulator/
|
244
|
+
if last_path =~ /#{prefix}/ and not last_path =~ /simulator/ and not last_path =~ /maccatalyst/
|
245
245
|
platform = to_native_platform prefix
|
246
246
|
if spec_hash[platform]
|
247
247
|
spec_hash[platform]["public_header_files"] = "#{spec_hash[:vendored_frameworks]}/#{last_path}/*/Headers/*.h"
|
@@ -1,23 +1,60 @@
|
|
1
1
|
module Pod
|
2
2
|
class XBuilder
|
3
3
|
module XcodeXBuilder
|
4
|
+
# 调用方法来获取当前Xcode版本
|
5
|
+
def xcode_version
|
6
|
+
xcode_version_output = `xcode-select -p`
|
7
|
+
return nil if xcode_version_output.empty?
|
8
|
+
|
9
|
+
xcode_path = xcode_version_output.chomp
|
10
|
+
version_output = `xcodebuild -version`
|
11
|
+
|
12
|
+
# Extract the Xcode version number
|
13
|
+
version_match = version_output.match(/Xcode (\d+(\.\d+)+)/)
|
14
|
+
return nil if version_match.nil?
|
15
|
+
|
16
|
+
xcode_version = version_match[1]
|
17
|
+
return xcode_version
|
18
|
+
end
|
19
|
+
# xcode14以上,14以后不再支持armv7(32位设备)
|
20
|
+
def compare_xcode_14_version
|
21
|
+
current_version = xcode_version
|
22
|
+
if current_version.nil?
|
23
|
+
UI.puts("未找到安装的Xcode版本。")
|
24
|
+
else
|
25
|
+
UI.puts("当前Xcode版本:#{current_version}")
|
26
|
+
num_ver = current_version.to_i
|
27
|
+
return num_ver >= 14
|
28
|
+
end
|
29
|
+
return false
|
30
|
+
end
|
31
|
+
|
4
32
|
def xcode_xbuild(defines, configuration, work_dir, build_dir = 'export', platform = 'iOS', project = nil, scheme = nil, skip_install = false)
|
5
33
|
if defined?(Pod::DONT_CODESIGN)
|
6
34
|
defines = "#{defines} CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO"
|
7
35
|
end
|
8
36
|
pwd = Pathname.pwd
|
9
37
|
Dir.chdir work_dir
|
38
|
+
# 判断当前Xcode版本是否大于14
|
39
|
+
above_ver_14 = compare_xcode_14_version
|
10
40
|
|
11
41
|
if platform == 'macOS'
|
12
42
|
destination = 'generic/platform=macOS,variant=Mac Catalyst,name=Any Mac'
|
13
43
|
archs = 'x86_64 arm64'
|
14
44
|
elsif platform == 'iOS Simulator'
|
15
45
|
destination = 'generic/platform=iOS Simulator'
|
16
|
-
|
17
|
-
|
46
|
+
if above_ver_14 # 14以后不支持32位设备
|
47
|
+
archs = 'x86_64 arm64'
|
48
|
+
else
|
49
|
+
archs = 'x86_64 i386 arm64' # swift库针对M1芯片移除x86架构,故模拟器添加i386,解决maccatalyst能正常生成
|
50
|
+
end
|
18
51
|
else
|
19
52
|
destination = 'generic/platform=iOS'
|
20
|
-
|
53
|
+
if above_ver_14 # 14以后不支持32位设备
|
54
|
+
archs = 'arm64'
|
55
|
+
else
|
56
|
+
archs = 'arm64 armv7'
|
57
|
+
end
|
21
58
|
end
|
22
59
|
if skip_install
|
23
60
|
skip_install = 'YES'
|
@@ -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
|
-
|
33
|
+
if @support_dynamic
|
34
|
+
defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=YES ONLY_ACTIVE_ARCH=NO MACH_O_TYPE=mh_dylib OTHER_LDFLAGS="-ObjC -framework UIKit"' # OTHER_LDFLAGS 动态库工程不会自动导入系统库
|
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
|
-
|
40
|
+
if @support_dynamic
|
41
|
+
defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=YES MACH_O_TYPE=mh_dylib OTHER_LDFLAGS="-ObjC -framework UIKit"' # OTHER_LDFLAGS 动态库工程不会自动导入系统库
|
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
|
-
|
47
|
+
if @support_dynamic
|
48
|
+
defines << 'GCC_GENERATE_DEBUGGING_SYMBOLS=NO MACH_O_TYPE=mh_dylib OTHER_LDFLAGS="-ObjC -framework UIKit"' # OTHER_LDFLAGS 动态库工程不会自动导入系统库
|
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.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- humin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-12 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.
|
109
|
+
rubygems_version: 3.4.14
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: 把podspec打包成xcframework的小工具。packager pod to a xcframework
|