mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-28 20:55:36 +08:00
[UIAutomation] Add rake task to generate BS file from private headers.
This commit is contained in:
@@ -348,6 +348,21 @@ namespace :UIAutomation do
|
||||
sh "class-dump -H -o UIAutomation/#{sdk_version} '#{framework_path}'"
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Generate BridgeSupport from dumped headers'
|
||||
task :generate_bridgesupport_files do
|
||||
IOS_SDK_VERSIONS.each do |sdk_version|
|
||||
platform_dev_path = "#{PLATFORMS_DIR}/iPhoneSimulator.platform/Developer"
|
||||
sdk_path = "#{platform_dev_path}/SDKs/iPhoneSimulator#{sdk_version}.sdk"
|
||||
a = sdk_version.scan(/(\d+)\.(\d+)/)[0]
|
||||
sdk_version_headers = ((a[0].to_i * 10000) + (a[1].to_i * 100)).to_s
|
||||
extra_flags = (sdk_version >= '7.0') ? '--64-bit' : '--no-64-bit'
|
||||
mkdir_p "UIAutomation/#{sdk_version}"
|
||||
Dir.chdir "UIAutomation/#{sdk_version}" do
|
||||
sh "/usr/bin/gen_bridge_metadata --format complete #{extra_flags} --cflags \"-isysroot #{sdk_path} -miphoneos-version-min=#{sdk_version} -DTARGET_OS_IPHONE -D__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__=#{sdk_version_headers} -I.\" *.h > ../UIAutomation.#{sdk_version}.bridgesupport"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
task :clean do
|
||||
|
||||
Reference in New Issue
Block a user