[UIAutomation] Add rake task to generate BS file from private headers.

This commit is contained in:
Eloy Durán
2013-10-03 12:11:17 +02:00
parent bc9e4ea9ac
commit c5b9d3ea5c

View File

@@ -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