From 185c8fd946243507769cf454c3c8aaf09cc65ce7 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 22 Sep 2014 16:06:40 +0800 Subject: [PATCH 1/2] 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") From 50ee2f142d24e829d0d156288d0ac6b76a997752 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 22 Sep 2014 19:15:29 +0800 Subject: [PATCH 2/2] Should still include resource-rules when signing embedded_frameworks for OS X (not Yosemite yet) --- lib/motion/project/template/osx/builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/motion/project/template/osx/builder.rb b/lib/motion/project/template/osx/builder.rb index 9c5dd2a2..d57bb68d 100644 --- a/lib/motion/project/template/osx/builder.rb +++ b/lib/motion/project/template/osx/builder.rb @@ -50,7 +50,7 @@ def codesign(config, platform) 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}\"" + sh "/usr/bin/codesign --force --sign \"#{config.codesign_certificate}\" --preserve-metadata=\"identifier,entitlements,resource-rules\" \"#{framework_path}\"" end end