motion-sparkle-sandbox 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.rspec +2 -0
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +183 -0
- data/.ruby-version +1 -0
- data/.travis.yml +37 -0
- data/Gemfile +13 -3
- data/README.md +73 -71
- data/Rakefile +2 -7
- data/bin/bundle +103 -0
- data/bin/byebug +29 -0
- data/bin/coderay +29 -0
- data/bin/fuzzy_match +29 -0
- data/bin/htmldiff +29 -0
- data/bin/httpclient +29 -0
- data/bin/ldiff +29 -0
- data/bin/pod +29 -0
- data/bin/pry +29 -0
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/bin/ruby-parse +29 -0
- data/bin/ruby-rewrite +29 -0
- data/bin/sandbox-pod +29 -0
- data/bin/xcodeproj +29 -0
- data/lib/motion/project/appcast.rb +177 -104
- data/lib/motion/project/indent_string.rb +18 -0
- data/lib/motion/project/install.rb +22 -66
- data/lib/motion/project/package.rb +52 -36
- data/lib/motion/project/project.rb +41 -51
- data/lib/motion/project/rake_tasks.rb +28 -32
- data/lib/motion/project/setup.rb +67 -73
- data/lib/motion/project/sparkle.rb +244 -148
- data/lib/motion/project/templates.rb +24 -22
- data/lib/motion-sparkle-sandbox/version.rb +5 -0
- data/lib/motion-sparkle-sandbox.rb +19 -3
- data/motion-sparkle-sandbox.gemspec +26 -16
- data/sample-app/.gitignore +9 -0
- data/sample-app/Gemfile +8 -0
- data/sample-app/README.md +87 -0
- data/sample-app/Rakefile +44 -0
- data/sample-app/app/app_delegate.rb +15 -0
- data/sample-app/app/menu.rb +155 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/1024x1024.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_128x128.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_128x128@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_16x16.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_16x16@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_256x256.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_256x256@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_32x32.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_32x32@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_512x512.png +0 -0
- data/sample-app/resources/Assets.xcassets/AppIcon.appiconset/Icon_512x512@2x.png +0 -0
- data/sample-app/resources/Assets.xcassets/Contents.json +6 -0
- data/sample-app/resources/Credits.rtf +29 -0
- data/sample-app/spec/main_spec.rb +11 -0
- data/spec/setup_spec.rb +67 -0
- data/spec/sparkle_spec.rb +113 -65
- data/spec/spec_helper.rb +94 -29
- data/spec/spec_utils.rb +32 -0
- data/vendor/.git_keep +0 -0
- metadata +78 -14
- data/vendor/README.md +0 -34
- data/vendor/Sparkle.zip +0 -0
- data/vendor/codesign_embedded_executable +0 -46
- data/vendor/generate_appcast +0 -0
@@ -1,18 +1,27 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Sparkle specific rake tasks
|
2
4
|
namespace :sparkle do
|
5
|
+
desc 'Sparkle Help'
|
6
|
+
task :help do
|
7
|
+
puts <<~HELP
|
8
|
+
During initial Sparkle setup, run these rake tasks:
|
3
9
|
|
4
|
-
|
5
|
-
|
6
|
-
|
10
|
+
1. `rake sparkle:setup_certificates`
|
11
|
+
2. `rake sparkle:setup`
|
12
|
+
|
13
|
+
Then after running `rake build:release`, you can run
|
14
|
+
`rake sparkle:package`
|
15
|
+
HELP
|
7
16
|
end
|
8
17
|
|
9
|
-
desc
|
18
|
+
desc 'Setup Sparkle configuration'
|
10
19
|
task :setup do
|
11
20
|
sparkle = App.config.sparkle
|
12
21
|
sparkle.setup
|
13
22
|
end
|
14
23
|
|
15
|
-
desc
|
24
|
+
desc 'Create a ZIP file with your application .app release build'
|
16
25
|
task :package do
|
17
26
|
App.config_without_setup.build_mode = :release
|
18
27
|
sparkle = App.config.sparkle
|
@@ -24,50 +33,37 @@ namespace :sparkle do
|
|
24
33
|
sparkle.generate_keys
|
25
34
|
end
|
26
35
|
|
27
|
-
desc
|
36
|
+
desc 'Generate the EdDSA signature for a package'
|
28
37
|
task :sign do
|
29
38
|
App.config_without_setup.build_mode = :release
|
30
39
|
sparkle = App.config.sparkle
|
31
40
|
sparkle.sign_package
|
32
41
|
end
|
33
42
|
|
34
|
-
|
35
|
-
|
36
|
-
sparkle.generate_public_key
|
37
|
-
end
|
38
|
-
|
39
|
-
task :copy_release_notes_templates do
|
40
|
-
App.config_without_setup.build_mode = :release
|
41
|
-
sparkle = App.config.sparkle
|
42
|
-
sparkle.copy_templates(force = true)
|
43
|
-
end
|
44
|
-
|
45
|
-
desc "Generate the appcast xml feed"
|
46
|
-
task :feed do
|
43
|
+
desc "Generate the appcast xml feed using Sparkle's `generate_appcast`"
|
44
|
+
task :generate_appcast do
|
47
45
|
App.config_without_setup.build_mode = :release
|
48
46
|
sparkle = App.config.sparkle
|
49
|
-
sparkle.
|
47
|
+
sparkle.generate_appcast
|
50
48
|
end
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
namespace :generate_appcast do
|
51
|
+
desc "Show help for Sparkle's `generate_appcast`"
|
52
|
+
task :help do
|
53
|
+
App.config_without_setup.build_mode = :release
|
54
|
+
sparkle = App.config.sparkle
|
55
|
+
sparkle.generate_appcast_help
|
56
|
+
end
|
57
57
|
end
|
58
58
|
|
59
|
-
desc
|
59
|
+
desc 'Update the release notes of this build'
|
60
60
|
task :release_notes do
|
61
61
|
App.config_without_setup.build_mode = :release
|
62
62
|
sparkle = App.config.sparkle
|
63
63
|
sparkle.create_release_notes
|
64
64
|
end
|
65
65
|
|
66
|
-
desc
|
67
|
-
task :upload do
|
68
|
-
end
|
69
|
-
|
70
|
-
desc "Clean the Sparkle release folder"
|
66
|
+
desc 'Clean the Sparkle release folder'
|
71
67
|
task :clean do
|
72
68
|
dir = Motion::Project::Sparkle::RELEASE_PATH
|
73
69
|
if File.exist?("./#{dir}")
|
data/lib/motion/project/setup.rb
CHANGED
@@ -1,96 +1,90 @@
|
|
1
|
-
|
2
|
-
class Sparkle
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module Motion
|
4
|
+
module Project
|
5
|
+
class Sparkle
|
6
|
+
def setup_ok?
|
7
|
+
config_ok?
|
8
|
+
certificates_ok?
|
9
|
+
end
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
def config_ok?
|
12
|
+
check_base_url
|
13
|
+
check_feed_url
|
14
|
+
check_public_key
|
15
|
+
end
|
16
|
+
|
17
|
+
def check_base_url
|
18
|
+
return true if appcast.base_url.present?
|
14
19
|
|
15
|
-
def check_base_url
|
16
|
-
base_url_check = appcast.base_url.to_s
|
17
|
-
if base_url_check.nil? or base_url_check.empty?
|
18
20
|
App.fail "Sparkle :base_url missing. Use `release :base_url, 'http://example.com/your_app_folder'` in your Rakefile's `app.sparkle` block"
|
19
21
|
end
|
20
|
-
true
|
21
|
-
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
App.fail "Sparkle :feed_filename is nil or blank. Please check your Rakefile."
|
23
|
+
def check_feed_url
|
24
|
+
return true if feed_url.present? && appcast.feed_filename.present?
|
25
|
+
|
26
|
+
App.fail 'Sparkle :feed_filename is nil or blank. Please check your Rakefile.'
|
28
27
|
end
|
29
|
-
true
|
30
|
-
end
|
31
28
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
App.fail
|
29
|
+
def check_public_key
|
30
|
+
return true if public_EdDSA_key.present?
|
31
|
+
|
32
|
+
App.fail 'Sparkle :public_key is nil or blank. Please check your Rakefile.'
|
36
33
|
end
|
37
|
-
true
|
38
|
-
end
|
39
34
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
App.fail "Missing `#{Sparkle::CONFIG_PATH}`. Run `rake sparkle:setup` to get started"
|
35
|
+
def certificates_ok?(silence = false)
|
36
|
+
unless File.exist?("./#{Sparkle::CONFIG_PATH}")
|
37
|
+
return false if silence
|
38
|
+
|
39
|
+
App.fail "Missing `#{Sparkle::CONFIG_PATH}`. Run `rake sparkle:setup` to get started"
|
46
40
|
end
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
else
|
41
|
+
|
42
|
+
if appcast.use_exported_private_key && !File.exist?(private_key_path)
|
43
|
+
return false if silence
|
44
|
+
|
52
45
|
App.fail "Missing `#{private_key_path}`. Please run `rake sparkle:setup_certificates` or check the docs to know where to put them."
|
53
46
|
end
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
else
|
47
|
+
|
48
|
+
unless public_EdDSA_key.present?
|
49
|
+
return false if silence
|
50
|
+
|
59
51
|
App.fail "Missing `#{public_key_path}`. Did you configure `release :public_key` correctly in the Rakefile? Advanced: recreate your public key with `rake sparkle:recreate_public_key`"
|
60
52
|
end
|
53
|
+
|
54
|
+
true
|
61
55
|
end
|
62
|
-
true
|
63
|
-
end
|
64
56
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
57
|
+
def setup
|
58
|
+
verify_installation
|
59
|
+
create_sparkle_folder
|
60
|
+
add_to_gitignore
|
61
|
+
copy_templates
|
70
62
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
return false
|
75
|
-
end
|
63
|
+
return false unless config_ok?
|
64
|
+
|
65
|
+
App.info 'Sparkle', 'Config found'
|
76
66
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
Please generate your private and public keys with
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
67
|
+
silence = true
|
68
|
+
unless certificates_ok?(silence)
|
69
|
+
App.info 'Sparkle', <<~CERTIFICATES
|
70
|
+
Certificates not found
|
71
|
+
|
72
|
+
Please generate your private and public keys with
|
73
|
+
`rake sparkle:setup_certificates`
|
74
|
+
|
75
|
+
If you already have your certificates and only need to include them in the project, follow these steps:
|
76
|
+
1. Rename your private key to `./#{private_key_path}`
|
77
|
+
and make sure you've added it to your `.gitignore` file - it should NEVER be
|
78
|
+
stored in your repository
|
79
|
+
2. Add `publish :public_key, 'PUBLIC_KEY'` to the Sparkle config in your Rakefile
|
80
|
+
CERTIFICATES
|
81
|
+
|
82
|
+
return false
|
83
|
+
end
|
84
|
+
|
85
|
+
App.info 'Sparkle', 'Certificates found'
|
86
|
+
App.info 'Sparkle', 'Setup OK. After `rake build:release`, you can now run `rake sparkle:package`.'
|
91
87
|
end
|
92
|
-
App.info "Sparkle", "Setup OK. After `rake build:release`, you can now run `rake sparkle:package`."
|
93
88
|
end
|
94
|
-
|
95
89
|
end
|
96
90
|
end
|