lib/motion/project/project.rb in motion-sparkle-sandbox-0.7.0 vs lib/motion/project/project.rb in motion-sparkle-sandbox-0.8.0
- old
+ new
@@ -27,33 +27,41 @@
alias_method "build", "build_with_sparkle"
end
end
class Builder
-
# if we're using the sandboxed version of Sparkle, then we need to copy the
# xpc services to the proper folder and sign them. This has to be done
# before we sign the app itself
#------------------------------------------------------------------------------
def codesign_with_sparkle(config, platform)
if App.config.embedded_frameworks.any? {|item| item.to_s.include?('Sparkle.framework')}
bundle_path = App.config.app_bundle('MacOSX')
+
if File.directory?(App.config.sparkle.sparkle_xpc_path)
+ App.info 'Sparkle', 'Removing unnecessary executables...'
+ sparkle_path = File.join(bundle_path, "Frameworks/Sparkle.framework")
+ ['Resources/Autoupdate', 'Resources/Updater.app'].each do |item|
+ bundle = File.join(sparkle_path, item)
+ FileUtils.rm_r(bundle) if File.exist?(bundle)
+ end
+
xpc_path = File.join(bundle_path, "XPCServices")
App.info 'Sparkle', "Copying XPCServices to #{xpc_path}"
+
FileUtils.mkdir_p(xpc_path)
`cp -R #{App.config.sparkle.sparkle_xpc_path}/*.xpc "#{xpc_path}"`
Dir.glob("#{xpc_path}/*.xpc").each do |path|
App.info 'Codesign', path
results = `#{App.config.sparkle.sparkle_vendor_path}/codesign_xpc "#{App.config.codesign_certificate}" "#{File.expand_path(path)}" 2>&1`
end
end
- end
+ end
+
codesign_without_sparkle(config, platform)
end
alias_method "codesign_without_sparkle", "codesign"
alias_method "codesign", "codesign_with_sparkle"
end
-
end