Skip to content

Commit

Permalink
[OSX] Refactor codesigning code from last commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy authored and Watson1978 committed Nov 5, 2014
1 parent 769fb8b commit 1dfbafe
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions lib/motion/project/template/osx/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,19 @@ def archive(config)
# @todo Do we really need the platform parameter when it's always the same?
#
def codesign(config, platform)
frameworks_path = File.join(config.app_bundle(platform), 'Frameworks')
if File.exist?(frameworks_path)
Dir.entries(frameworks_path).each do |framework|
next if framework.start_with?('.')
versions_path = File.join(frameworks_path, framework, 'Versions')
Dir.entries(versions_path).each do |version|
next if version.start_with?('.') || version == 'Current'
codesign_bundle(config, File.join(versions_path, version))
end
app_bundle = config.app_bundle(platform)
framework_versions = 'Frameworks/*.framework/Versions/*'
Dir.glob(File.join(app_bundle, framework_versions)) do |version|
unless version == File.basename('Current')
codesign_bundle(config, version)
end
end

codesign_bundle(config, config.app_bundle_raw(platform)) do
entitlements_path = File.join(config.versionized_build_dir(platform), "Entitlements.plist")
File.open(entitlements_path, 'w') { |io| io.write(config.entitlements_data) }
entitlements_path
build_dir = config.versionized_build_dir(platform)
entitlements = File.join(build_dir, "Entitlements.plist")
File.open(entitlements, 'w') { |io| io.write(config.entitlements_data) }
entitlements
end
end

Expand Down

0 comments on commit 1dfbafe

Please sign in to comment.