Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix the DT* settings of Info.plist for iOS 6.0

  • Loading branch information...
commit 22d82cacccaabc55af9a01cb5255bec50be603db 1 parent c889ac4
@lrz lrz authored
Showing with 40 additions and 14 deletions.
  1. +40 −14 lib/motion/project/config.rb
View
54 lib/motion/project/config.rb
@@ -154,12 +154,18 @@ def locate_binary(name)
App.fail "Can't locate binary `#{name}' on the system."
end
+ def xcode_version
+ @xcode_version ||= begin
+ txt = `#{locate_binary('xcodebuild')} -version`
+ vers = txt.scan(/Xcode\s(.+)/)[0][0]
+ build = txt.scan(/Build version\s(.+)/)[0][0]
+ [vers, build]
+ end
+ end
+
def validate
# Xcode version
- ary = `#{locate_binary('xcodebuild')} -version`.scan(/Xcode\s+([^\n]+)\n/)
- if ary and ary[0] and xcode_version = ary[0][0]
- App.fail "Xcode 4.x or greater is required" if xcode_version < '4.0'
- end
+ App.fail "Xcode 4.x or greater is required" if xcode_version[0] < '4.0'
# sdk_version
['iPhoneSimulator', 'iPhoneOS'].each do |platform|
@@ -553,8 +559,22 @@ def info_plist
@info_plist
end
+ def dt_info_plist
+{
+}
+ end
+
def info_plist_data
- info_plist.merge!({
+ ios_version_to_build = lambda do |vers|
+ # XXX we should retrieve these values programmatically.
+ case vers
+ when '4.3'; '8F191m'
+ when '5.0'; '9A334'
+ when '5.1'; '9B176'
+ else; '10A403' # 6.0 or later
+ end
+ end
+ Motion::PropertyList.to_s({
'BuildMachineOSBuild' => `sw_vers -buildVersion`.strip,
'MinimumOSVersion' => deployment_target,
'CFBundleDevelopmentRegion' => 'en',
@@ -581,16 +601,22 @@ def info_plist_data
'UISupportedInterfaceOrientations' => interface_orientations_consts,
'UIStatusBarStyle' => status_bar_style_const,
'UIBackgroundModes' => background_modes_consts,
- 'DTXcode' => '0431',
- 'DTSDKName' => 'iphoneos5.0',
- 'DTSDKBuild' => '9A334',
+ 'DTXcode' => begin
+ vers = xcode_version[0].sub(/\./, '')
+ if vers.length == 2
+ '0' + vers + '0'
+ else
+ '0' + vers
+ end
+ end,
+ 'DTXcodeBuild' => xcode_version[1],
+ 'DTSDKName' => "iphoneos#{sdk_version}",
+ 'DTSDKBuild' => ios_version_to_build.call(sdk_version),
'DTPlatformName' => 'iphoneos',
'DTCompiler' => 'com.apple.compilers.llvm.clang.1_0',
- 'DTPlatformVersion' => '5.1',
- 'DTXcodeBuild' => '4E1019',
- 'DTPlatformBuild' => '9B176'
- })
- Motion::PropertyList.to_s(info_plist)
+ 'DTPlatformVersion' => sdk_version,
+ 'DTPlatformBuild' => ios_version_to_build.call(sdk_version)
+ }.merge(dt_info_plist).merge(info_plist))
end
def pkginfo_data
@@ -689,7 +715,7 @@ def gen_bridge_metadata(headers, bs_file)
a = sdk_version.scan(/(\d+)\.(\d+)/)[0]
sdk_version_headers = ((a[0].to_i * 10000) + (a[1].to_i * 100)).to_s
extra_flags = OSX_VERSION >= 10.7 ? '--no-64-bit' : ''
- sh "RUBYOPT='' /usr/bin/gen_bridge_metadata --format complete #{extra_flags} --cflags \"-isysroot #{sdk_path} -miphoneos-version-min=#{sdk_version} -D__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__=#{sdk_version_headers} -I. #{includes.join(' ')}\" #{headers.join(' ')} -o \"#{bs_file}\""
+ sh "RUBYOPT='' /usr/bin/gen_bridge_metadata --format complete #{extra_flags} --cflags \"-isysroot #{sdk_path} -miphoneos-version-min=#{sdk_version} -D__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__=#{sdk_version_headers} -I. #{includes.join(' ')}\" #{headers.map { |x| "\"#{x}\"" }.join(' ')} -o \"#{bs_file}\""
end
end
end; end
Please sign in to comment.
Something went wrong with that request. Please try again.