[Config] Consolidate way to add/change info plist data.

This commit is contained in:
Eloy Durán
2014-12-04 17:35:49 +01:00
parent 3bcdb74536
commit 474ae828f0
3 changed files with 23 additions and 19 deletions

View File

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

View File

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

View File

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