Skip to content

Commit

Permalink
Codesign embedded_frameworks for OS X too
Browse files Browse the repository at this point in the history
  • Loading branch information
hboon committed Sep 22, 2014
1 parent e247650 commit 185c8fd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/motion/project/template/osx/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ def archive(config)

def codesign(config, platform)
app_bundle = config.app_bundle_raw('MacOSX')
app_frameworks = File.join(config.app_bundle(platform), 'Frameworks')
config.embedded_frameworks.each do |framework|
framework_path = File.join(app_frameworks, File.basename(framework))
if File.mtime(config.project_file) > File.mtime(framework_path) \
or !system("/usr/bin/codesign --verify \"#{framework_path}\" >& /dev/null")
App.info 'Codesign', framework_path
sh "/usr/bin/codesign --force --sign \"#{config.codesign_certificate}\" --preserve-metadata=\"identifier,entitlements\" \"#{framework_path}\""
end
end

entitlements = File.join(config.versionized_build_dir(platform), "Entitlements.plist")
if File.mtime(config.project_file) > File.mtime(app_bundle) \
or !system("/usr/bin/codesign --verify \"#{app_bundle}\" >& /dev/null")
Expand Down

0 comments on commit 185c8fd

Please sign in to comment.