mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-06-11 08:14:16 +08:00
[Target] Configure the bundle ID in the config object only.
This commit is contained in:
@@ -37,19 +37,6 @@ module Motion; module Project
|
||||
if !File.exist?(extension_path) or File.mtime(src_path) > File.mtime(extension_path)
|
||||
App.info 'Copy', src_path
|
||||
FileUtils.cp_r(src_path, dest_path)
|
||||
|
||||
# At build time Extensions do not know the bundle indentifier of its
|
||||
# parent app, so we have to modify their Info.plist later
|
||||
extension_dir = File.join(destination_dir, 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 = `/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
|
||||
|
||||
|
||||
@@ -182,6 +182,16 @@ module Motion; module Project;
|
||||
ary.map { |family| device_family_int(family) }
|
||||
end
|
||||
|
||||
# @todo Is it correct that a bundle identifier may contain spaces? Because
|
||||
# the `bundle_name` definitely can contain spaces.
|
||||
#
|
||||
# @return [String] The bundle identifier of the application extension based
|
||||
# on the bundle identifier of the host application.
|
||||
#
|
||||
def identifier
|
||||
ENV['RM_TARGET_HOST_APP_IDENTIFIER'] + '.' + bundle_name
|
||||
end
|
||||
|
||||
def app_bundle(platform)
|
||||
File.join(versionized_build_dir(platform), bundle_name + '.appex')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user