[WatchKit] Move default config to the config object.

This commit is contained in:
Eloy Durán
2014-12-04 17:37:21 +01:00
parent 474ae828f0
commit 174d85f794
2 changed files with 13 additions and 15 deletions

View File

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

View File

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