From 1c487741c2cf8600ccd71a79fe294d817441f6df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Wed, 6 Aug 2014 11:29:16 +0200 Subject: [PATCH] [osx] Merge all Info.plist data in one place and ensure there's always a principal class. --- lib/motion/project/template/osx/config.rb | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/motion/project/template/osx/config.rb b/lib/motion/project/template/osx/config.rb index d06fd58a..33ac788c 100644 --- a/lib/motion/project/template/osx/config.rb +++ b/lib/motion/project/template/osx/config.rb @@ -145,14 +145,22 @@ module Motion; module Project; File.expand_path(File.join('~/Library/Containers', identifier, "Data/rubymotion-repl-#{Time.now.to_i}")) end - def info_plist_data(platform) - Motion::PropertyList.to_s({ + def generic_info_plist + super.merge({ 'NSHumanReadableCopyright' => copyright, 'NSPrincipalClass' => 'NSApplication', 'CFBundleIconFile' => (icon or ''), 'LSMinimumSystemVersion' => deployment_target, 'LSApplicationCategoryType' => (@category.start_with?('public.app-category') ? @category : 'public.app-category.' + @category) - }.merge(generic_info_plist).merge(dt_info_plist).merge(info_plist)) + }) + 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 @@ -230,17 +238,17 @@ EOS end main_txt << <