From 174d85f79491f74deab2d705d0ebbe8c3b8a4705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 4 Dec 2014 17:37:21 +0100 Subject: [PATCH] [WatchKit] Move default config to the config object. --- .../template/ios-watch-extension-config.rb | 26 +++++++++---------- .../ios-watch-extension/files/Rakefile.erb | 2 -- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/motion/project/template/ios-watch-extension-config.rb b/lib/motion/project/template/ios-watch-extension-config.rb index 06009398..bf58fb68 100644 --- a/lib/motion/project/template/ios-watch-extension-config.rb +++ b/lib/motion/project/template/ios-watch-extension-config.rb @@ -33,6 +33,7 @@ module Motion; module Project; def initialize(*) super @name = nil + frameworks << 'WatchKit' end # @return [String] The name of the Watch extension is always based on that @@ -54,14 +55,18 @@ module Motion; module Project; ENV['RM_TARGET_HOST_APP_IDENTIFIER'] + '.watchkitextension' end - def info_plist_data(platform) - info_plist['NSExtension'] = { - 'NSExtensionPointIdentifier' => 'com.apple.watchkit', - 'NSExtensionAttributes' => { - 'WKAppBundleIdentifier' => watch_app_config.identifier + # @see {XcodeConfig#merged_info_plist} + # + def merged_info_plist(platform) + super.merge({ + 'RemoteInterfacePrincipalClass' => 'InterfaceController', + 'NSExtension' => { + 'NSExtensionPointIdentifier' => 'com.apple.watchkit', + 'NSExtensionAttributes' => { + 'WKAppBundleIdentifier' => watch_app_config.identifier, + }, }, - } - super + }) end # @return [WatchAppConfig] A config instance for the watch application. @@ -148,12 +153,7 @@ EOS # @todo There are more differences with Xcode's Info.plist. # - # @param [String] platform - # The platform identifier that's being build for, such as - # `iPhoneSimulator` or `iPhoneOS`. - # - # @return [Hash] A hash that contains all the various `Info.plist` data - # merged into one hash. + # @see {XcodeConfig#merged_info_plist} # def merged_info_plist(platform) plist = super diff --git a/lib/motion/project/template/ios-watch-extension/files/Rakefile.erb b/lib/motion/project/template/ios-watch-extension/files/Rakefile.erb index 61ace936..da0b32e0 100644 --- a/lib/motion/project/template/ios-watch-extension/files/Rakefile.erb +++ b/lib/motion/project/template/ios-watch-extension/files/Rakefile.erb @@ -10,6 +10,4 @@ end Motion::Project::App.setup do |app| # Use `rake config' to see complete project settings. - app.frameworks << "WatchKit" - app.info_plist['RemoteInterfacePrincipalClass'] = 'InterfaceController' end