[Config] Don't use @name variable directly and add API to get bundle filename.

This commit is contained in:
Eloy Durán
2014-11-27 14:51:46 +01:00
committed by Watson
parent 5c6fa347bc
commit 62d5d40f32
3 changed files with 23 additions and 9 deletions

View File

@@ -324,8 +324,14 @@ module Motion; module Project;
end
end
# @param [String] platform
# The platform identifier that's being build for, such as
# `iPhoneSimulator` or `iPhoneOS`.
#
# @return [String] The path to the app bundle in the build directory.
#
def app_bundle(platform)
File.join(versionized_build_dir(platform), bundle_name + '.app')
File.join(versionized_build_dir(platform), bundle_filename)
end
def app_bundle_executable(platform)
@@ -459,7 +465,7 @@ module Motion; module Project;
'bundle-identifier' => identifier,
'bundle-version' => @version,
'kind' => 'software',
'title' => @name
'title' => name
} }
]
})

View File

@@ -122,7 +122,7 @@ module Motion; module Project;
end
def app_bundle_raw(platform)
File.join(versionized_build_dir(platform), bundle_name + '.app')
File.join(versionized_build_dir(platform), bundle_filename)
end
def app_bundle(platform)

View File

@@ -289,8 +289,16 @@ EOS
common_flags(platform) + ' -Wl,-no_pie'
end
# @return [String] The application bundle name, excluding extname.
#
def bundle_name
@name + (spec_mode ? '_spec' : '')
name + (spec_mode ? '_spec' : '')
end
# @return [String] The application bundle filename, including extname.
#
def bundle_filename
bundle_name + '.app'
end
def versionized_build_dir(platform)
@@ -298,7 +306,7 @@ EOS
end
def app_bundle_dsym(platform)
File.join(versionized_build_dir(platform), bundle_name + '.app.dSYM')
File.join(versionized_build_dir(platform), bundle_filename + '.dSYM')
end
def archive_extension
@@ -310,7 +318,7 @@ EOS
end
def identifier
@identifier ||= "com.yourcompany.#{@name.gsub(/\s/, '')}"
@identifier ||= "com.yourcompany.#{name.gsub(/\s/, '')}"
spec_mode ? @identifier + '_spec' : @identifier
end
@@ -326,10 +334,10 @@ EOS
{
'BuildMachineOSBuild' => `sw_vers -buildVersion`.strip,
'CFBundleDevelopmentRegion' => 'en',
'CFBundleName' => @name,
'CFBundleDisplayName' => @name,
'CFBundleName' => name,
'CFBundleDisplayName' => name,
'CFBundleIdentifier' => identifier,
'CFBundleExecutable' => @name,
'CFBundleExecutable' => name,
'CFBundleInfoDictionaryVersion' => '6.0',
'CFBundlePackageType' => 'APPL',
'CFBundleShortVersionString' => (@short_version || @version),