Skip to content

Commit 185c8fd

Browse files
committed
Codesign embedded_frameworks for OS X too
1 parent e247650 commit 185c8fd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/motion/project/template/osx/builder.rb

+10
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ def archive(config)
4444

4545
def codesign(config, platform)
4646
app_bundle = config.app_bundle_raw('MacOSX')
47+
app_frameworks = File.join(config.app_bundle(platform), 'Frameworks')
48+
config.embedded_frameworks.each do |framework|
49+
framework_path = File.join(app_frameworks, File.basename(framework))
50+
if File.mtime(config.project_file) > File.mtime(framework_path) \
51+
or !system("/usr/bin/codesign --verify \"#{framework_path}\" >& /dev/null")
52+
App.info 'Codesign', framework_path
53+
sh "/usr/bin/codesign --force --sign \"#{config.codesign_certificate}\" --preserve-metadata=\"identifier,entitlements\" \"#{framework_path}\""
54+
end
55+
end
56+
4757
entitlements = File.join(config.versionized_build_dir(platform), "Entitlements.plist")
4858
if File.mtime(config.project_file) > File.mtime(app_bundle) \
4959
or !system("/usr/bin/codesign --verify \"#{app_bundle}\" >& /dev/null")

0 commit comments

Comments
 (0)