modify CFBundleIdentifier for Watch extension

This commit is contained in:
Watson
2014-11-21 14:18:22 +09:00
committed by Eloy Durán
parent 9d14fe1000
commit 7f0e8c1079
2 changed files with 8 additions and 2 deletions

View File

@@ -77,7 +77,12 @@ module Motion; module Project
extension_dir = File.join(dest_extension_path, extension_name)
info_plist = File.join(extension_dir, 'Info.plist')
extension_bundle_name = `/usr/libexec/PlistBuddy -c "print CFBundleName" "#{info_plist}"`.strip
extension_bundle_indentifer = "#{@config.identifier}.#{extension_bundle_name}"
extension_bundle_indentifer = `/usr/libexec/PlistBuddy -c "print CFBundleIdentifier" "#{info_plist}"`.strip
if extension_bundle_indentifer.include?(".watchkitextension")
extension_bundle_indentifer = "#{@config.identifier}.watchkitextension"
else
extension_bundle_indentifer = "#{@config.identifier}.#{extension_bundle_name}"
end
`/usr/libexec/PlistBuddy -c "set CFBundleIdentifier #{extension_bundle_indentifer}" "#{info_plist}"`
end
end

View File

@@ -27,9 +27,10 @@ require 'motion/project/template/ios-extension-config'
module Motion; module Project;
class IOSWatchExtensionConfig < IOSExtensionConfig
register :'ios-watch-extension'
register :'ios-extension'
def info_plist_data(platform)
info_plist['CFBundleIdentifier'] = identifier + '.watchkitextension'
Motion::PropertyList.to_s({
'MinimumOSVersion' => deployment_target,
'CFBundleResourceSpecification' => 'ResourceRules.plist',