diff --git a/lib/motion/project/template/ios/config.rb b/lib/motion/project/template/ios/config.rb index 64e8bb37..beb9f97f 100644 --- a/lib/motion/project/template/ios/config.rb +++ b/lib/motion/project/template/ios/config.rb @@ -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 diff --git a/lib/motion/project/template/osx/config.rb b/lib/motion/project/template/osx/config.rb index 5bdfad3c..a7c0eb0e 100644 --- a/lib/motion/project/template/osx/config.rb +++ b/lib/motion/project/template/osx/config.rb @@ -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 diff --git a/lib/motion/project/xcode_config.rb b/lib/motion/project/xcode_config.rb index 49a1c9ca..ddceefbd 100644 --- a/lib/motion/project/xcode_config.rb +++ b/lib/motion/project/xcode_config.rb @@ -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.