lib/cocoapods-xcframework/xbuilder.rb in cocoapods-bb-xcframework-0.1.0 vs lib/cocoapods-xcframework/xbuilder.rb in cocoapods-bb-xcframework-0.2.0
- old
+ new
@@ -4,11 +4,11 @@
class XBuilder
include XcodeXBuilder
include XcodeProjHelper
include PodUtil
include Config::Mixin
- def initialize(installer, source_dir, sandbox_root, spec, configuration, symbols=true)
+ def initialize(installer, source_dir, sandbox_root, spec, configuration, symbols=true, support_maccatalyst=true)
# def initialize(platform, installer, source_dir, sandbox_root, spec, config)
# @platform = platform
@installer = installer
@source_dir = source_dir
@sandbox_root = sandbox_root
@@ -18,10 +18,11 @@
@spec = "muti" if @muti
@configuration = configuration
@outputs = Hash.new
@symbols = symbols
+ @support_maccatalyst = support_maccatalyst
end
def build
UI.puts("Building framework #{@spec} with configuration #{@configuration}")
UI.puts "Work dir is :#{@sandbox_root}"
@@ -133,10 +134,13 @@
"#{@sandbox_root}/#{spec_name}.xcframework"
end
def build_all_device defines
# build general first because simulator will exchange SDKROOT to simulat sdk
+ if @support_maccatalyst
+ build_MacCatalyst_device defines
+ end
build_general_device defines
build_simulator_device defines
end
def build_general_device defines
@@ -152,10 +156,25 @@
UI.puts("--- Building framework #{@spec} with simulator device")
modify_xcode_project_sdk_to_simullator "#{@sandbox_root}/Pods.xcodeproj"
xcode_xbuild(
defines,
@configuration,
- @sandbox_root
+ @sandbox_root,
+ 'export',
+ 'iOS Simulator'
+ )
+ end
+
+ def build_MacCatalyst_device defines
+ UI.puts("--- Building framework #{@spec} with MacCatalyst device")
+ xcode_xbuild(
+ defines,
+ @configuration,
+ @sandbox_root,
+ 'export', # build_dir
+ 'macOS', # platform
+ "#{@sandbox_root}/Pods.xcodeproj", # project
+ "#{@spec.name}" # scheme
)
end
def outputs target_dir
if not File.exist? target_dir