Sha256: b944d4469b30141353af329aedbbe07bde661894de7043518ac2cf1e89446701
Contents?: true
Size: 1.41 KB
Versions: 5
Compression:
Stored size: 1.41 KB
Contents
require 'xcodeproj' module Pod class XBuilder module XcodeProjHelper def modify_xcode_project_sdk_to_simullator path sdks = xcode_sdks project = Xcodeproj::Project.open path project.targets.each do |target| simulator_sdk = to_native_simulator_platform target.sdk if not simulator_sdk.nil? canonicalName = sdks[simulator_sdk]["canonicalName"] target.build_configurations.each do |configuration| configuration.build_settings["SDKROOT"] = canonicalName end end end project.save end def to_native_platform name case name when 'iphoneos' then 'ios' when 'macOS' then 'osx' when 'appletvos' then 'tvos' when 'watchos' then 'watchos' else name end end private def xcode_sdks return @x_sdks if @x_sdks outputs = `xcodebuild -showsdks -json` sdks = JSON.parse outputs @x_sdks = {} sdks.each do |sdk| @x_sdks[sdk["platform"]] = sdk end @x_sdks end def to_native_simulator_platform name case name when 'iphoneos' then 'iphonesimulator' when 'macOS' then nil when 'appletvos' then 'appletvsimulator' when 'watchos' then 'watchsimulator' else name end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems