cocoapods-bb-xcframework 0.2.7.2 → 0.2.7.3

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: ff188e2f9fea6dd316ea3b6457e5cdca2229cefaac0274370cc6076ba4eb9dab
4
- data.tar.gz: 1dc04ad72267df21e5da59ffaeae13a6b5695abc033b90c5d6dd819ead560108
3
+ metadata.gz: 597321612f6169b2c9f34b33ebbf775b50c23174c2059465953b94db815e7bc2
4
+ data.tar.gz: 9bda96e9b80a82a706c83b64b0d4b35d94cc27ab88742b63835b2dce0bb3a869
5
5
  SHA512:
6
- metadata.gz: 60d70707d601d17160af83cf7ced3fdcf0466d97d1dfe29af81b3e02c4676170518a692e49ec8f44714a1154b7fb3d1369cd8545b449e35ba20e3e1baa34048a
7
- data.tar.gz: 3385c50216a54cb109bec510654aa2718c256a1fb8edf71a505928046f4e88b49c9228298980333e9b563eab04a167d1d3c4a84455cdc3aa49851ce7e0cfc915
6
+ metadata.gz: 641d7d1659254d9c84e47df9e2edec74dd75a4592dab26aefd40d104fad2db87fcee9ee563c613c10f60385a84ba339c3ddb635e0bf014d0b35fc18645516209
7
+ data.tar.gz: 0b85260117e10d861e9e95d39e972a78820c6097cb509f8e5726d4298fd80837094a53c4fe6c02e31f9c6610150fd0d8faba063f541e76b1296a47aaaeb3c359
@@ -37,7 +37,8 @@ module Pod
37
37
  ['--no-symbols', 'package not use symbols'], # 符号表
38
38
  ['--no-support-maccatalyst', 'package support generate MacCatalyst'], # 是否支持MacCatalyst方式支持iOS应用在mac平台运行库生成
39
39
  ['--no-support-dynamic', 'package support Mach-O dynamically linked shared library'], # 是否支持动态库生成
40
- ['--no-archive-export', 'xcodebuild archive export'] # 是否支持本地导出,导出dylib动态库
40
+ ['--no-archive-export', 'xcodebuild archive export'], # 是否支持本地导出,导出dylib动态库
41
+ ['--workspace', 'xcodebuild archive workspace'], # 工程目录
41
42
  ].concat super
42
43
  end
43
44
 
@@ -56,6 +57,7 @@ module Pod
56
57
  @support_maccatalyst = argv.flag?('support-maccatalyst',true)
57
58
  @support_dynamic = argv.flag?('support-dynamic',false)
58
59
  @archive_export = argv.flag?('archive-export',true)
60
+ @workspace = argv.option('workspace')
59
61
  config.static_library_enable = @use_static_library
60
62
  super
61
63
  end
@@ -66,14 +68,14 @@ module Pod
66
68
  end
67
69
 
68
70
  def run
69
- UI.puts "argvs @name:#{@name} @source:#{@source} @spec_sources:#{@spec_sources} @subspecs:#{@subspecs} @archive_export:#{@archive_export}"
71
+ UI.puts "argvs @name:#{@name} @source:#{@source} @spec_sources:#{@spec_sources} @subspecs:#{@subspecs} @archive_export:#{@archive_export} @workspace:#{@workspace}"
70
72
  if @archive_export
71
73
  puts "local builder xcframework"
72
- frameworker = LocalBuilder.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst, @support_dynamic, Dir.pwd)
74
+ frameworker = LocalBuilder.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst, @support_dynamic, Dir.pwd, @workspace)
73
75
  frameworker.build
74
76
  else
75
77
  puts "remote builder xcframework"
76
- frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst, @support_dynamic)
78
+ frameworker = Frameworker.new(@name, @source, @spec_sources, @subspecs, @configuration, @force, @use_modular_headers, @enable_bitcode, @symbols, @support_maccatalyst, @support_dynamic, @workspace)
77
79
  frameworker.run
78
80
  end
79
81
  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, support_dynamic=false)
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, workspace=nil)
7
7
  @name = name
8
8
  @source = source
9
9
  @spec_sources = spec_sources
@@ -15,6 +15,26 @@ module Pod
15
15
  @symbols = symbols
16
16
  @support_maccatalyst = support_maccatalyst
17
17
  @support_dynamic = support_dynamic
18
+ @workspace = workspace
19
+ end
20
+
21
+ # 是否支持macos架构
22
+ def support_macos
23
+ spec = spec_with_path @name
24
+ platforms = []
25
+ begin
26
+ spec_hash = spec.to_hash
27
+ if spec_hash['platforms']
28
+ platforms = spec_hash['platforms'].keys.map(&:to_s)
29
+ elsif spec.platform
30
+ platforms = [spec.platform.name.to_s]
31
+ end
32
+ rescue => e
33
+ UI.puts "read platforms failed: #{e}".red
34
+ end
35
+ support_macos = platforms.include?('osx') || platforms.include?('macos')
36
+ UI.puts "#{spec.name}(#{spec.version}) platforms=#{platforms} support_macos=#{support_macos}".yellow
37
+ return support_macos
18
38
  end
19
39
 
20
40
  def run
@@ -65,7 +85,8 @@ module Pod
65
85
  spec,
66
86
  @configuration,
67
87
  @symbols,
68
- @support_maccatalyst
88
+ @support_maccatalyst,
89
+ support_macos
69
90
  )
70
91
  builder.build
71
92
  builder.outputs target_dir
@@ -1,3 +1,3 @@
1
1
  module CocoapodsXCFramework
2
- VERSION = "0.2.7.2"
2
+ VERSION = "0.2.7.3"
3
3
  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, support_dynamic=false, source_dir=Dir.pwd)
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, source_dir=Dir.pwd, workspace=nil)
7
7
  @name = name
8
8
  @source = source
9
9
  @spec_sources = spec_sources
@@ -18,6 +18,7 @@ module Pod
18
18
  @spec = spec_with_path @name
19
19
  @source_dir = source_dir
20
20
  @outputs = Hash.new
21
+ @workspace = workspace
21
22
  end
22
23
 
23
24
  def run
@@ -49,31 +50,71 @@ module Pod
49
50
  outputs(target_dir)
50
51
  end
51
52
 
53
+ # 是否支持macos架构
54
+ def support_macos
55
+ spec = spec_with_path @name
56
+ platforms = []
57
+ begin
58
+ spec_hash = spec.to_hash
59
+ if spec_hash['platforms']
60
+ platforms = spec_hash['platforms'].keys.map(&:to_s)
61
+ elsif spec.platform
62
+ platforms = [spec.platform.name.to_s]
63
+ end
64
+ rescue => e
65
+ UI.puts "read platforms failed: #{e}".red
66
+ end
67
+ support_macos = platforms.include?('osx') || platforms.include?('macos')
68
+ UI.puts "#{spec.name}(#{spec.version}) platforms=#{platforms} support_macos=#{support_macos}".yellow
69
+ return support_macos
70
+ end
71
+
52
72
  def xcode_xbuild(destination, archs, platform, defines, build_dir, archive_path)
53
73
  # xcodebuild archive requires -scheme when -archivePath is specified
54
74
  spec = spec_with_path @name
55
75
  spec ||= spec_with_name @name
56
76
 
77
+ workspace_path = @workspace
57
78
  scheme_name = @spec&.name
58
79
  configuration = @configuration
59
80
  skip_install = 'NO'
60
81
  plat_name = platform.to_s.gsub(/\s+/, '_')
61
- archivePath = "#{archive_path}/#{scheme_name}-#{plat_name}.xcarchive"
62
- UI.puts "archivePath:#{archivePath}"
82
+ target_name = "#{scheme_name}-#{plat_name}"
83
+ archivePath = "#{archive_path}/#{target_name}.xcarchive"
84
+ UI.puts "plat_name=#{plat_name} destination=#{destination} archs=#{archs} workspace_path=#{workspace_path}"
63
85
  if scheme_name.nil?
64
86
  UI.puts("❌ archive 构建缺少 scheme,请在调用 xcode_xbuild 时显式传入 scheme").red
65
87
  Process.exit 1
66
88
  end
89
+
90
+ workspace_arg = if workspace_path && !workspace_path.to_s.strip.empty?
91
+ "-workspace '#{workspace_path}' "
92
+ else
93
+ ""
94
+ end
95
+
96
+ scheme_arg = if workspace_path && !workspace_path.to_s.strip.empty?
97
+ if platform == "iOS" or platform == "Simulator" or platform == "MacCatalyst"
98
+ "#{scheme_name}-iOS"
99
+ else
100
+ "#{scheme_name}-macOS"
101
+ end
102
+ else
103
+ scheme_name
104
+ end
105
+
67
106
  command = "xcodebuild archive " \
68
- "-scheme '#{scheme_name}' " \
107
+ "#{workspace_arg}" \
108
+ "-scheme '#{scheme_arg}' " \
69
109
  "-archivePath '#{archivePath}' " \
70
110
  "-destination '#{destination}' " \
111
+ "-alltargets " \
71
112
  "-configuration #{configuration} " \
72
113
  "ARCHS='#{archs}' " \
73
114
  "SKIP_INSTALL=#{skip_install} " \
74
115
  "#{defines} " \
75
116
  "SWIFT_OPTIMIZATION_LEVEL=-Onone DEBUG_INFORMATION_FORMAT=dwarf-with-dsym " \
76
- "BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build" \
117
+ "BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build"
77
118
 
78
119
  # --- enhanced logging & reliable failure surfacing ---
79
120
  log_dir = File.join(archivePath, 'logs')
@@ -105,7 +146,15 @@ module Pod
105
146
  # build general first because simulator will exchange SDKROOT to simulat sdk
106
147
  build_general_device defines, build_dir, archive_path
107
148
  build_simulator_device defines, build_dir, archive_path
108
- build_MacCatalyst_device defines, build_dir, archive_path if @support_maccatalyst
149
+ # build_MacCatalyst_device defines, build_dir, archive_path if @support_maccatalyst
150
+ build_mac_device defines, build_dir, archive_path if support_macos
151
+ end
152
+
153
+ def build_mac_device defines, build_dir, archive_path
154
+ UI.puts("--- Building framework #{@spec} with general device")
155
+ destination = 'generic/platform=macOS'
156
+ archs = 'arm64'
157
+ xcode_xbuild(destination, archs, "macOS", defines, build_dir, archive_path)
109
158
  end
110
159
 
111
160
  def build_general_device defines, build_dir, archive_path
@@ -174,7 +223,7 @@ module Pod
174
223
  "-output '#{xcframework_path}'"
175
224
  ].join(' ')
176
225
 
177
- UI.puts "� Creating XCFramework:"
226
+ UI.puts "� Creating XCFramework:#{command}"
178
227
  UI.puts command.cyan
179
228
 
180
229
  success = system(command)
@@ -30,6 +30,7 @@ module Pod
30
30
  end
31
31
 
32
32
  def xcode_xbuild(defines, configuration, work_dir, build_dir = 'export', platform = 'iOS', project = nil, scheme = nil, skip_install = false)
33
+ puts "xcode_xbuild defines:#{defines} configuration:#{configuration} work_dir:#{work_dir} build_dir:#{build_dir} project:#{project} scheme:#{scheme}"
33
34
  if defined?(Pod::DONT_CODESIGN)
34
35
  defines = "#{defines} CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO"
35
36
  end
@@ -38,9 +39,12 @@ module Pod
38
39
  # 判断当前Xcode版本是否大于14
39
40
  above_ver_14 = compare_xcode_14_version
40
41
 
41
- if platform == 'macOS'
42
+ if platform == 'MacCatalyst'
42
43
  destination = 'generic/platform=macOS,variant=Mac Catalyst,name=Any Mac'
43
44
  archs = 'x86_64 arm64'
45
+ elsif platform == 'macOS'
46
+ destination = 'generic/platform=macOS'
47
+ archs = 'arm64'
44
48
  elsif platform == 'iOS Simulator'
45
49
  destination = 'generic/platform=iOS Simulator'
46
50
  if above_ver_14 # 14以后不支持32位设备
@@ -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_macos=false)
10
10
  # def initialize(platform, installer, source_dir, sandbox_root, spec, config)
11
11
  # @platform = platform
12
12
  @installer = installer
@@ -21,6 +21,7 @@ module Pod
21
21
  @outputs = Hash.new
22
22
  @symbols = symbols
23
23
  @support_maccatalyst = support_maccatalyst
24
+ @support_macos = support_macos
24
25
  end
25
26
 
26
27
  def build
@@ -139,6 +140,7 @@ module Pod
139
140
  build_general_device defines
140
141
  build_simulator_device defines
141
142
  build_MacCatalyst_device defines if @support_maccatalyst
143
+ build_MacOS_device defines if @support_macos
142
144
  end
143
145
 
144
146
  def build_general_device defines
@@ -164,6 +166,19 @@ module Pod
164
166
 
165
167
  def build_MacCatalyst_device defines
166
168
  UI.puts("--- Building framework #{@spec} with MacCatalyst device")
169
+ xcode_xbuild(
170
+ defines,
171
+ @configuration,
172
+ @sandbox_root,
173
+ 'export', # build_dir
174
+ 'MacCatalyst', # platform
175
+ "#{@sandbox_root}/Pods.xcodeproj", # project
176
+ "#{@spec.name}" # scheme
177
+ )
178
+ end
179
+
180
+ def build_MacOS_device defines
181
+ UI.puts("--- Building framework #{@spec} with macOS device")
167
182
  xcode_xbuild(
168
183
  defines,
169
184
  @configuration,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-xcframework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7.2
4
+ version: 0.2.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin