mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-11 11:39:09 +08:00
[WatchKit] Move default config to the config object.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user