mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-07 22:42:10 +08:00
[Config] Consolidate way to add/change info plist data.
This commit is contained in:
@@ -409,7 +409,7 @@ module Motion; module Project;
|
||||
end
|
||||
|
||||
def merged_info_plist(platform)
|
||||
ios = {
|
||||
plist = super.merge({
|
||||
'MinimumOSVersion' => deployment_target,
|
||||
'CFBundleResourceSpecification' => 'ResourceRules.plist',
|
||||
'CFBundleSupportedPlatforms' => [deploy_platform],
|
||||
@@ -441,19 +441,13 @@ module Motion; module Project;
|
||||
'DTCompiler' => 'com.apple.compilers.llvm.clang.1_0',
|
||||
'DTPlatformVersion' => sdk_version,
|
||||
'DTPlatformBuild' => sdk_build_version(platform),
|
||||
}
|
||||
|
||||
base = info_plist
|
||||
})
|
||||
# If the user has not explicitely specified launch images, try to find
|
||||
# them ourselves.
|
||||
if !base.include?('UILaunchImages') && launch_images = self.launch_images
|
||||
base['UILaunchImages'] = launch_images
|
||||
if !plist.has_key?('UILaunchImages') && launch_images = self.launch_images
|
||||
plist['UILaunchImages'] = launch_images
|
||||
end
|
||||
ios.merge(generic_info_plist).merge(dt_info_plist).merge(base)
|
||||
end
|
||||
|
||||
def info_plist_data(platform)
|
||||
Motion::PropertyList.to_s(merged_info_plist(platform))
|
||||
plist
|
||||
end
|
||||
|
||||
def manifest_plist_data
|
||||
|
||||
@@ -151,14 +151,6 @@ module Motion; module Project;
|
||||
})
|
||||
end
|
||||
|
||||
def merged_info_plist
|
||||
generic_info_plist.merge(dt_info_plist).merge(info_plist)
|
||||
end
|
||||
|
||||
def info_plist_data(platform)
|
||||
Motion::PropertyList.to_s(merged_info_plist)
|
||||
end
|
||||
|
||||
def strip_args
|
||||
''
|
||||
end
|
||||
|
||||
@@ -346,6 +346,24 @@ EOS
|
||||
}
|
||||
end
|
||||
|
||||
# @return [Hash] A hash that contains all the various `Info.plist` data
|
||||
# merged into one hash.
|
||||
#
|
||||
def merged_info_plist(platform)
|
||||
generic_info_plist.merge(dt_info_plist).merge(info_plist)
|
||||
end
|
||||
|
||||
# @param [String] platform
|
||||
# The platform identifier that's being build for, such as
|
||||
# `iPhoneSimulator`, `iPhoneOS`, or `MacOSX`.
|
||||
#
|
||||
#
|
||||
# @return [String] A serialized version of the `merged_info_plist` hash.
|
||||
#
|
||||
def info_plist_data(platform)
|
||||
Motion::PropertyList.to_s(merged_info_plist(platform))
|
||||
end
|
||||
|
||||
# TODO
|
||||
# * Add env vars from user.
|
||||
# * Add optional Instruments template to use.
|
||||
|
||||
Reference in New Issue
Block a user