mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-14 12:13:04 +08:00
osx: support for entitlements
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user