From 185c8fd946243507769cf454c3c8aaf09cc65ce7 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 22 Sep 2014 16:06:40 +0800 Subject: [PATCH] Codesign embedded_frameworks for OS X too --- lib/motion/project/template/osx/builder.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/motion/project/template/osx/builder.rb b/lib/motion/project/template/osx/builder.rb index 900602e7..9c5dd2a2 100644 --- a/lib/motion/project/template/osx/builder.rb +++ b/lib/motion/project/template/osx/builder.rb @@ -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")