Skip to content

Commit

Permalink
[Config] Don't use @name variable directly and add API to get bundl…
Browse files Browse the repository at this point in the history
…e filename.
  • Loading branch information
alloy authored and Watson1978 committed Dec 11, 2014
1 parent 5c6fa34 commit 62d5d40
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
10 changes: 8 additions & 2 deletions lib/motion/project/template/ios/config.rb
Expand Up @@ -324,8 +324,14 @@ def device_id
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)
Expand Down Expand Up @@ -459,7 +465,7 @@ def manifest_plist_data
'bundle-identifier' => identifier,
'bundle-version' => @version,
'kind' => 'software',
'title' => @name
'title' => name
} }
]
})
Expand Down
2 changes: 1 addition & 1 deletion lib/motion/project/template/osx/config.rb
Expand Up @@ -122,7 +122,7 @@ def bridgesupport_cflags
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)
Expand Down
20 changes: 14 additions & 6 deletions lib/motion/project/xcode_config.rb
Expand Up @@ -289,16 +289,24 @@ def ldflags(platform)
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)
File.join(build_dir, platform + '-' + deployment_target + '-' + build_mode_name)
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
Expand All @@ -310,7 +318,7 @@ def archive
end

def identifier
@identifier ||= "com.yourcompany.#{@name.gsub(/\s/, '')}"
@identifier ||= "com.yourcompany.#{name.gsub(/\s/, '')}"
spec_mode ? @identifier + '_spec' : @identifier
end

Expand All @@ -326,10 +334,10 @@ def generic_info_plist
{
'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),
Expand Down

0 comments on commit 62d5d40

Please sign in to comment.