Skip to content

Commit 76745b2

Browse files
committed
Remove extraneous executables when using xpc
1 parent 586abc3 commit 76745b2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

lib/motion/project/project.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,25 @@ def build_with_sparkle(platform, opts = {})
2929
end
3030

3131
class Builder
32-
3332
# if we're using the sandboxed version of Sparkle, then we need to copy the
3433
# xpc services to the proper folder and sign them. This has to be done
3534
# before we sign the app itself
3635
#------------------------------------------------------------------------------
3736
def codesign_with_sparkle(config, platform)
3837
if App.config.embedded_frameworks.any? {|item| item.to_s.include?('Sparkle.framework')}
3938
bundle_path = App.config.app_bundle('MacOSX')
39+
4040
if File.directory?(App.config.sparkle.sparkle_xpc_path)
41+
App.info 'Sparkle', 'Removing unnecessary executables...'
42+
sparkle_path = File.join(bundle_path, "Frameworks/Sparkle.framework")
43+
['Resources/Autoupdate', 'Resources/Updater.app'].each do |item|
44+
bundle = File.join(sparkle_path, item)
45+
FileUtils.rm_r(bundle) if File.exist?(bundle)
46+
end
47+
4148
xpc_path = File.join(bundle_path, "XPCServices")
4249
App.info 'Sparkle', "Copying XPCServices to #{xpc_path}"
50+
4351
FileUtils.mkdir_p(xpc_path)
4452
`cp -R #{App.config.sparkle.sparkle_xpc_path}/*.xpc "#{xpc_path}"`
4553

@@ -48,12 +56,12 @@ def codesign_with_sparkle(config, platform)
4856
results = `#{App.config.sparkle.sparkle_vendor_path}/codesign_xpc "#{App.config.codesign_certificate}" "#{File.expand_path(path)}" 2>&1`
4957
end
5058
end
51-
end
59+
end
60+
5261
codesign_without_sparkle(config, platform)
5362
end
5463

5564
alias_method "codesign_without_sparkle", "codesign"
5665
alias_method "codesign", "codesign_with_sparkle"
5766
end
58-
5967
end

motion-sparkle-sandbox.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $:.unshift File.expand_path('../lib', __FILE__)
88

99
Gem::Specification.new do |spec|
1010
spec.name = 'motion-sparkle-sandbox'
11-
spec.version = '0.7.0'
11+
spec.version = '0.8.0'
1212
spec.date = Date.today
1313
spec.summary = 'Sparkle (sandboxed) integration for Rubymotion projects'
1414
spec.description = "motion-sparkle-sandbox makes it easy to use the sandboxed version of Sparkle in your RubyMotion OS X apps"

0 commit comments

Comments
 (0)