diff --git a/lib/motion/project/template/osx/builder.rb b/lib/motion/project/template/osx/builder.rb index 53421d64..7b6a4e68 100644 --- a/lib/motion/project/template/osx/builder.rb +++ b/lib/motion/project/template/osx/builder.rb @@ -37,10 +37,12 @@ module Motion; module Project def codesign(config, platform) app_bundle = config.app_bundle_raw('MacOSX') + 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") App.info 'Codesign', app_bundle - sh "/usr/bin/codesign --force --sign \"#{config.codesign_certificate}\" \"#{app_bundle}\"" + File.open(entitlements, 'w') { |io| io.write(config.entitlements_data) } + sh "/usr/bin/codesign --force --sign \"#{config.codesign_certificate}\" --entitlements \"#{entitlements}\" \"#{app_bundle}\"" end end end diff --git a/lib/motion/project/template/osx/config.rb b/lib/motion/project/template/osx/config.rb index 7e8b58ea..40e1a021 100644 --- a/lib/motion/project/template/osx/config.rb +++ b/lib/motion/project/template/osx/config.rb @@ -70,6 +70,11 @@ module Motion; module Project; super('Mac') end + def entitlements_data + dict = entitlements + Motion::PropertyList.to_s(dict) + end + def common_flags(platform) super + " -mmacosx-version-min=#{deployment_target}" end