add more options

This commit is contained in:
Laurent Sansonetti
2012-06-26 19:09:55 +02:00
parent 7544f906bf
commit 3af110901a

View File

@@ -50,8 +50,9 @@ module Motion; module Project
variable :files, :xcode_dir, :sdk_version, :deployment_target, :frameworks,
:libs, :delegate_class, :name, :build_dir, :resources_dir, :specs_dir,
:identifier, :codesign_certificate, :provisioning_profile,
:device_family, :interface_orientations, :version, :icons,
:prerendered_icon, :seed_id, :entitlements, :fonts
:device_family, :interface_orientations, :version, :short_version, :icons,
:prerendered_icon, :background_modes, :seed_id, :entitlements, :fonts,
:status_bar_style
attr_accessor :spec_mode
@@ -70,6 +71,9 @@ module Motion; module Project
@bundle_signature = '????'
@interface_orientations = [:portrait, :landscape_left, :landscape_right]
@version = '1.0'
@short_version = '1'
@status_bar_style = :default
@background_modes = []
@icons = []
@prerendered_icon = false
@vendor_projects = []
@@ -457,6 +461,31 @@ EOS
end
end
def background_modes_consts
@background_modes.map do |mode|
case mode
when :audio then 'audio'
when :location then 'location'
when :voip then 'voip'
when :newsstand_content then 'newsstand-content'
when :external_accessory then 'external-accessory'
when :bluetooth_central then 'bluetooth-central'
else
App.fail "Unknown background_modes value: `#{mode}'"
end
end
end
def status_bar_style_const
case @status_bar_style
when :default then 'UIStatusBarStyleDefault'
when :black_translucent then 'UIStatusBarStyleBlackTranslucent'
when :black_opaque then 'UIStatusBarStyleBlackOpaque'
else
App.fail "Unknown status_bar_style value: `#{@status_bar_style}'"
end
end
def info_plist
@info_plist ||= {
'BuildMachineOSBuild' => `sw_vers -buildVersion`.strip,
@@ -469,7 +498,7 @@ EOS
'CFBundleInfoDictionaryVersion' => '6.0',
'CFBundlePackageType' => 'APPL',
'CFBundleResourceSpecification' => 'ResourceRules.plist',
'CFBundleShortVersionString' => @version,
'CFBundleShortVersionString' => @short_version,
'CFBundleSignature' => @bundle_signature,
'CFBundleSupportedPlatforms' => ['iPhoneOS'],
'CFBundleVersion' => @version,
@@ -483,7 +512,8 @@ EOS
'UIAppFonts' => fonts,
'UIDeviceFamily' => device_family_ints.map { |x| x.to_s },
'UISupportedInterfaceOrientations' => interface_orientations_consts,
'UIStatusBarStyle' => 'UIStatusBarStyleDefault',
'UIStatusBarStyle' => status_bar_style_const,
'UIBackgroundModes' => background_modes_consts,
'DTXcode' => '0431',
'DTSDKName' => 'iphoneos5.0',
'DTSDKBuild' => '9A334',