billymeltdown-choctop 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/History.txt +59 -0
  2. data/Manifest.txt +39 -0
  3. data/README.rdoc +155 -0
  4. data/Rakefile +25 -0
  5. data/app_generators/install_choctop/install_choctop_generator.rb +49 -0
  6. data/app_generators/install_choctop/templates/Rakefile.erb +17 -0
  7. data/app_generators/install_choctop/templates/release_notes.txt.erb +5 -0
  8. data/app_generators/install_choctop/templates/release_notes_template.html.erb +13 -0
  9. data/assets/DefaultVolumeIcon.icns +0 -0
  10. data/assets/sky.jpg +0 -0
  11. data/assets/sky_background.jpg +0 -0
  12. data/assets/vanillia_dmg_icon.png +0 -0
  13. data/assets/wood.jpg +0 -0
  14. data/bin/install_choctop +24 -0
  15. data/features/development.feature +13 -0
  16. data/features/dmg.feature +53 -0
  17. data/features/fixtures/custom_assets/appicon.icns +0 -0
  18. data/features/initial_generator.feature +24 -0
  19. data/features/rake_tasks.feature +31 -0
  20. data/features/sparkle_feed.feature +38 -0
  21. data/features/step_definitions/common_steps.rb +168 -0
  22. data/features/step_definitions/dmg_steps.rb +46 -0
  23. data/features/step_definitions/file_attribute_steps.rb +16 -0
  24. data/features/step_definitions/generator_steps.rb +51 -0
  25. data/features/step_definitions/remote_steps.rb +30 -0
  26. data/features/step_definitions/xcode_steps.rb +5 -0
  27. data/features/support/common.rb +44 -0
  28. data/features/support/env.rb +16 -0
  29. data/features/support/matchers.rb +11 -0
  30. data/lib/choctop/appcast.rb +125 -0
  31. data/lib/choctop/dmg.rb +190 -0
  32. data/lib/choctop.rb +294 -0
  33. data/script/console +10 -0
  34. data/script/destroy +14 -0
  35. data/script/generate +14 -0
  36. data/spec/choctop_spec.rb +113 -0
  37. data/spec/spec.opts +1 -0
  38. data/spec/spec_helper.rb +5 -0
  39. data/tasks/rspec.rake +21 -0
  40. metadata +166 -0
data/History.txt ADDED
@@ -0,0 +1,59 @@
1
+
2
+ * ChocTop no longer solely for Cocoa applications
3
+ * Applications shortcut only included if the primary target is a .app bundle
4
+ * Creates a non-versioned symlink to latest released DMG
5
+ * Files to be included can be specified by relative path, method helper (as a symbol) or a proc that returns a string path.
6
+ Examples:
7
+ file 'build/Release/SampleApp.app', :position => [50, 100]
8
+ file :target_bundle, :position => [50, 100]
9
+ file proc { 'README.txt' }, :position => [50, 100]
10
+ file :position => [50, 100] { 'README.txt' }
11
+
12
+
13
+ == 0.10.0 2009-06-11
14
+
15
+ * Extra files supported: +add_file 'project/path/to/file_or_folder_or_bundle', :position => [x, y]+
16
+
17
+ == 0.9.7 2009-05-17
18
+
19
+ * New config option: s.build_type = ENV['BUILD_TYPE'] || 'Release' [kdbdallas]
20
+ * permit SUFeedURL to not be specified (cleanly exit from deploy rake tasks)
21
+ * removed unused 'appcast' rake task
22
+
23
+ == 0.9.6 2009-02-10
24
+
25
+ * Custom Applications Icons!!!
26
+ * New config option: s.application_icon = "xxx.png"
27
+ * New config option: s.icon_text_size = 12
28
+ * rake dmg NO_BUILD=1 will skip the build step
29
+ * The background image no longer appears in the "real time" design of the DMG as its in .background folder
30
+
31
+ == 0.9.5 2009-02-03
32
+
33
+ * Fixed whitespace in project names bug
34
+
35
+ == 0.9.4 2009-01-31
36
+
37
+ * ReleaseNotes.txt renamed to release_notes.txt in applications
38
+
39
+ == 0.9.3 2009-01-29
40
+
41
+ * install_choctop generates a release_notes.txt file
42
+ * 'rake feed' converts release_notes.txt into release_notes.html file for upload
43
+ * #name is the project's folder name if info_plist['CFBundleExecutable'] == "${EXECUTABLE_NAME}"
44
+ * builder of xml feed flushes immediately now so no more 0 length xml feeds
45
+
46
+ == 0.9.2 2009-01-29
47
+
48
+ * fixed instances of "SUFeedURLKey" to "SUFeedURL" due to f@#$-up error message in Sparkle code that led me astray
49
+
50
+ == 0.9.1 2009-01-29
51
+
52
+ * default DMG theme is a sky background and plain volume icon
53
+ * sparkle xml feed includes a DSA signature
54
+ * explicit release_notes property
55
+
56
+ == 0.9.0 2009-01-28
57
+
58
+ * 1 major enhancement:
59
+ * Initial release
data/Manifest.txt ADDED
@@ -0,0 +1,39 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.rdoc
4
+ Rakefile
5
+ app_generators/install_choctop/install_choctop_generator.rb
6
+ app_generators/install_choctop/templates/Rakefile.erb
7
+ app_generators/install_choctop/templates/release_notes.txt.erb
8
+ app_generators/install_choctop/templates/release_notes_template.html.erb
9
+ assets/DefaultVolumeIcon.icns
10
+ assets/sky.jpg
11
+ assets/sky_background.jpg
12
+ assets/vanillia_dmg_icon.png
13
+ assets/wood.jpg
14
+ bin/install_choctop
15
+ features/development.feature
16
+ features/dmg.feature
17
+ features/fixtures/custom_assets/appicon.icns
18
+ features/initial_generator.feature
19
+ features/rake_tasks.feature
20
+ features/sparkle_feed.feature
21
+ features/step_definitions/common_steps.rb
22
+ features/step_definitions/dmg_steps.rb
23
+ features/step_definitions/file_attribute_steps.rb
24
+ features/step_definitions/generator_steps.rb
25
+ features/step_definitions/remote_steps.rb
26
+ features/step_definitions/xcode_steps.rb
27
+ features/support/common.rb
28
+ features/support/env.rb
29
+ features/support/matchers.rb
30
+ lib/choctop.rb
31
+ lib/choctop/appcast.rb
32
+ lib/choctop/dmg.rb
33
+ script/console
34
+ script/destroy
35
+ script/generate
36
+ spec/choctop_spec.rb
37
+ spec/spec.opts
38
+ spec/spec_helper.rb
39
+ tasks/rspec.rake
data/README.rdoc ADDED
@@ -0,0 +1,155 @@
1
+ = choctop
2
+
3
+ * http://drnic.github.com/choctop
4
+
5
+ == Modifications by billymeltdown:
6
+
7
+ Just some real basic stuff for our internal use here at Zetetic. I'd ignore the :scp business,
8
+ in the end it turned out to be whack, but I'll preserve it here in case anyone really needs it.
9
+ Rsync is definitely more appropriate.
10
+
11
+ The thing I needed in particular was to be able to pass build settings to xcodebuild that I
12
+ have set in the XCode project and that we use in dependent projects (e.g. -sdk macosx10.5, etc).
13
+
14
+ Added a gemspec so I can publish it from github, allowing us here at zetetic to use it specifically.
15
+
16
+ == DESCRIPTION:
17
+
18
+ Build and deploy tools for Cocoa apps using Sparkle for distributions and upgrades;
19
+ it’s like Hoe but for Cocoa apps.
20
+
21
+ Package up your OS X/Cocoa applications into Custom DMGs, generate Sparkle XML, and
22
+ upload. Instead of hours, its only 30 seconds to release each new version of an application.
23
+
24
+ Build and deploy tools for Cocoa apps using Sparkle for distributions and upgrades; it's
25
+ like Hoe but for Cocoa apps.
26
+
27
+ The main feature is a powerful rake task "rake appcast" which builds a release of your
28
+ application, creates a DMG package, generates a Sparkle XML file, and posts the package
29
+ and XML file to your remote host via rsync.
30
+
31
+ All rake tasks:
32
+
33
+ rake appcast # Create dmg, update appcast file, and upload to host
34
+ rake build # Build Xcode Release
35
+ rake dmg # Create the dmg file for appcasting
36
+ rake feed # Create/update the appcast file
37
+ rake upload # Upload the appcast file to the host
38
+
39
+ == Why is it called 'ChocTop'?
40
+
41
+ In Australia, Choc-Tops are ice cream cones, with hardened chocolate on top,
42
+ normally served at the movie cinemas. When we (http://mocra.com) were brainstorming a name for this
43
+ project we combined "Sparkle" + "Cocoa" + "it's almost lunch time and we're hungry" to remember
44
+ the wonderful Choc-Top ice creams. MMmmm.
45
+
46
+ Wikipedia: http://en.wikipedia.org/wiki/Choc-Top
47
+
48
+ == FEATURES/PROBLEMS:
49
+
50
+ ChocTop comes with rake tasks to instantly deploy your latest Cocoa app's version
51
+ to a remote host, instantly activating all your users' Sparkle auto-updates.
52
+
53
+ * builds a Release of your project from your Xcode project (via xcodebuild tool)
54
+ * packages a DMG of your released app using Info.plist configuration (rake dmg)
55
+ * generates Sparkle-formatted XML file
56
+ * uploads the DMG and XML files to a remote host
57
+
58
+ == SYNOPSIS:
59
+
60
+ cd to/my/cocoa/app
61
+ install_choctop .
62
+
63
+ Alternately, if you already have a Rakefile in your Xcode project, then add the following
64
+ to the end:
65
+
66
+ require "choctop"
67
+
68
+ ChocTop.new do |s|
69
+ s.remote_dir = '/path/to/upload/root/of/app'
70
+
71
+ # Optional, showing defaults
72
+ s.host = host from Info.plist['SUFeedURL']
73
+ s.base_url = "http://#{s.host}"
74
+ s.release_notes = "release_notes.html"
75
+
76
+ # Custom DMG
77
+ s.background_file = "background.jpg"
78
+ s.app_icon_position = [100, 90]
79
+ s.applications_icon_position = [400, 90]
80
+ s.applications_icon = "applications.icns"
81
+
82
+ # Extra files
83
+ s.add_file 'path/to/README.txt', :position => [250, 90]
84
+ s.file :target_bundle, :position => [50, 100]
85
+ s.file proc { 'README.txt' }, :position => [50, 100]
86
+ s.file :position => [50, 100] { 'README.txt' }
87
+
88
+ # Custom DMG options
89
+ s.volume_icon = "dmg.icns"
90
+ s.icon_size = 104
91
+ end
92
+
93
+ In your Rakefile, update the ChocTop configuration with the host and remote_dir details.
94
+ The rake tasks use rsync to upload the files, so ensure that you have ssh access to the
95
+ remote server, with a password/ssh keys.
96
+
97
+ Also, in your project's Info.plist, remember to update/add the following keys:
98
+
99
+ CFBundleExecutable - name of your project
100
+ CFBundleVersion - version for next release, using X.Y.Z format
101
+ SUFeedURL - url to Sparkle URL (future: insert this automatically)
102
+
103
+ The create the distribution, Sparkle XML file, and upload it to the remote host:
104
+
105
+ rake appcast
106
+
107
+ The build process uses your Xcode project file, via the xcodebuild command. If this fails,
108
+ you may need to run the build process manually via Xcode. Set Configuration to Release (normally
109
+ its set to Debug for development) and then Build. The "rake appcast" task should finish to completion.
110
+
111
+ == REQUIREMENTS:
112
+
113
+ * RubyCocoa (installed with OS X 10.5 Leopard)
114
+ * Xcode 3+
115
+
116
+ == INSTALL:
117
+
118
+ sudo gem install choctop
119
+
120
+ == ORIGINAL CODE IDEAS:
121
+
122
+ * Chris Bailey at http://codeintensity.blogspot.com/2008/03/creating-sparkle-appcast-via-rake-tasks.html
123
+ * Eloy Duran's Rucola at http://github.com/alloy/rucola
124
+ * Emanuele Vicentini's rake_dmg at http://github.com/baldowl/rake_dmg
125
+ * AppleScript ideas from http://svn.tribler.org/abc/branches/old-mainbranch-till-4.1.7plus/mac/Makefile-from-vlc-ready
126
+
127
+
128
+ == SPONSORED BY:
129
+
130
+ http://mocra.com - Mocra - the premier Rails/iPhone consultancy
131
+
132
+ == LICENSE:
133
+
134
+ (The MIT License)
135
+
136
+ Copyright (c) 2009 Dr Nic Williams, drnicwilliams@gmail.com
137
+
138
+ Permission is hereby granted, free of charge, to any person obtaining
139
+ a copy of this software and associated documentation files (the
140
+ 'Software'), to deal in the Software without restriction, including
141
+ without limitation the rights to use, copy, modify, merge, publish,
142
+ distribute, sublicense, and/or sell copies of the Software, and to
143
+ permit persons to whom the Software is furnished to do so, subject to
144
+ the following conditions:
145
+
146
+ The above copyright notice and this permission notice shall be
147
+ included in all copies or substantial portions of the Software.
148
+
149
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
150
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
151
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
152
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
153
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
154
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
155
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,25 @@
1
+ gem 'hoe', '>= 2.3.2'
2
+ require 'hoe'
3
+ gem 'newgem', '>= 1.5.0'
4
+ require 'newgem'
5
+ require './lib/choctop'
6
+
7
+ Hoe.plugin :newgem
8
+
9
+ $hoe = Hoe.spec 'choctop' do
10
+ developer 'Dr Nic Williams', 'drnicwilliams@gmail.com'
11
+ developer 'Chris Bailey', 'chris@cobaltedge.com'
12
+
13
+ extra_deps << ['activesupport']
14
+ extra_deps << ['builder','>= 2.1.2']
15
+ extra_dev_deps << ['newgem', ">= #{::Newgem::VERSION}"]
16
+ end
17
+
18
+ task :release do
19
+ sh "gem push pkg/#{$hoe.name}-#{$hoe.version}.gem"
20
+ end
21
+
22
+ require 'newgem/tasks' # load /tasks/*.rake
23
+ Dir['tasks/**/*.rake'].each { |t| load t }
24
+
25
+ task :default => [:features]
@@ -0,0 +1,49 @@
1
+ class InstallChoctopGenerator < RubiGen::Base
2
+ attr_reader :name, :module_name, :urlname, :version
3
+
4
+ default_options :version => "0.1.0"
5
+
6
+ def initialize(runtime_args, runtime_options = {})
7
+ super
8
+ usage if args.empty?
9
+ @destination_root = File.expand_path(args.shift)
10
+ @name = base_name
11
+ @module_name = name.gsub(/[-]+/, '_').camelcase
12
+ @urlname = name.gsub(/[-_]+/, '').downcase
13
+ extract_options
14
+ end
15
+
16
+ def manifest
17
+ record do |m|
18
+ %w( appcast/build ).each { |path| m.directory path }
19
+
20
+ m.template "Rakefile.erb", "Rakefile"
21
+ m.template "release_notes.txt.erb", "release_notes.txt"
22
+ m.file "release_notes_template.html.erb", "release_notes_template.html.erb"
23
+ end
24
+ end
25
+
26
+ protected
27
+ def banner
28
+ <<-EOS
29
+ Installs choctop into your Cocoa application. This gives you
30
+ rake tasks to build and deploy your Cocoa app's latest version for
31
+ Sparkle appcast mechanism.
32
+
33
+ USAGE: #{spec.name} path/to/CocoaApp
34
+ EOS
35
+ end
36
+
37
+ def add_options!(opts)
38
+ opts.separator ''
39
+ opts.separator 'Options:'
40
+ opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
41
+ opts.on("-V", "--initial-version",
42
+ "Show the #{File.basename($0)} version number and quit.",
43
+ "Default: 0.1.0") { |o| options[:version] = o }
44
+ end
45
+
46
+ def extract_options
47
+ @version = options[:version]
48
+ end
49
+ end
@@ -0,0 +1,17 @@
1
+ require "rubygems"
2
+ require "rake"
3
+
4
+ require "choctop"
5
+
6
+ ChocTop.new do |s|
7
+ # Remote upload target (set host if not same as Info.plist['SUFeedURL'])
8
+ # s.host = '<%= urlname %>.com'
9
+ s.remote_dir = '/path/to/upload/root/of/app'
10
+
11
+ # Custom DMG
12
+ # s.background_file = "background.jpg"
13
+ # s.app_icon_position = [100, 90]
14
+ # s.applications_icon_position = [400, 90]
15
+ # s.volume_icon = "dmg.icns"
16
+ # s.applications_icon = "appicon.icns" # or "appicon.png"
17
+ end
@@ -0,0 +1,5 @@
1
+ h1. <span><%= Date.today %></span> Release <%= version %>
2
+
3
+ h2. Initial release
4
+
5
+ Yay! First release.
@@ -0,0 +1,13 @@
1
+ <html>
2
+ <head>
3
+ <title>Release Notes</title>
4
+ <style>
5
+ * { font-family: serif;}
6
+ h1 { font-family: sans-serif; background-color: #ABABFF; padding: 10px;}
7
+ h1 span { font-size: 75%; font-weight: normal; float: right;}
8
+ </style>
9
+ </head>
10
+ <body>
11
+ <%= release_notes_html %>
12
+ </body>
13
+ </html>
Binary file
data/assets/sky.jpg ADDED
Binary file
Binary file
Binary file
data/assets/wood.jpg ADDED
Binary file
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'rubigen'
5
+
6
+ if %w(-v --version).include? ARGV.first
7
+ require 'install_choctop/version'
8
+ puts "#{File.basename($0)} #{InstallChocTop::VERSION}"
9
+ exit(0)
10
+ end
11
+
12
+ require 'rubigen/scripts/generate'
13
+ source = RubiGen::PathSource.new(:application,
14
+ File.join(File.dirname(__FILE__), "../app_generators"))
15
+ RubiGen::Base.reset_sources
16
+ RubiGen::Base.append_sources source
17
+ RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'install_choctop')
18
+ puts <<-EOS
19
+ You use choctop with the following rake tasks:
20
+ rake appcast # Create dmg, update appcast file, and upload to host
21
+ rake build # Create/update the appcast file
22
+ rake dmg # Create the dmg file for appcasting
23
+ rake upload # Upload the appcast file to the host
24
+ EOS
@@ -0,0 +1,13 @@
1
+ Feature: Development processes of newgem itself (rake tasks)
2
+
3
+ As a Newgem maintainer or contributor
4
+ I want rake tasks to maintain and release the gem
5
+ So that I can spend time on the tests and code, and not excessive time on maintenance processes
6
+
7
+ Scenario: Generate RubyGem
8
+ Given this project is active project folder
9
+ And "pkg" folder is deleted
10
+ When I invoke task "rake gem"
11
+ Then folder "pkg" is created
12
+ And file with name matching "pkg/*.gem" is created else you should run "rake manifest" to fix this
13
+ And gem spec key "rdoc_options" contains /(--mainREADME.rdoc|\[\"--main\", \"README.rdoc\"\])/
@@ -0,0 +1,53 @@
1
+ Feature: Can build a customised DMG image from application build
2
+ In order to reduce cost of building DMG images for each release of an application
3
+ As a Cocoa developer or release manager
4
+ I want a rake task to generate a DMG based on custom settings
5
+
6
+ Scenario: Build a DMG with default custom DMG config
7
+ Given a Cocoa app with choctop installed called "SampleApp"
8
+ When I invoke task "rake dmg"
9
+ Then file "appcast/build/SampleApp-0.1.0.dmg" is created
10
+ When dmg "appcast/build/SampleApp-0.1.0.dmg" is mounted as "SampleApp"
11
+ Then folder "SampleApp.app" in mounted volume is created
12
+ And file "Applications" in mounted volume is created
13
+ And file ".background/background.jpg" in mounted volume is created
14
+ And file ".background/background.jpg" in mounted volume is invisible
15
+ And file ".VolumeIcon.icns" in mounted volume is created
16
+
17
+ Scenario: Build a DMG with a whitespace name
18
+ Given a Cocoa app with choctop installed called "App With Whitespace"
19
+ When I invoke task "rake dmg"
20
+ Then file "appcast/build/App With Whitespace-1.0.dmg" is created
21
+ When dmg "appcast/build/App With Whitespace-1.0.dmg" is mounted as "App With Whitespace"
22
+ Then folder "App With Whitespace.app" in mounted volume is created
23
+ And file "Applications" in mounted volume is created
24
+ And file ".background/background.jpg" in mounted volume is created
25
+ And file ".background/background.jpg" in mounted volume is invisible
26
+ And file ".VolumeIcon.icns" in mounted volume is created
27
+
28
+ Scenario: Build a DMG with custom Applications symlink icon
29
+ Given a Cocoa app with choctop installed called "SampleApp"
30
+ And is configured for custom Applications icon
31
+ When I invoke task "rake dmg"
32
+ And dmg "appcast/build/SampleApp-0.1.0.dmg" is mounted as "SampleApp"
33
+ Then file "Applications" in mounted volume is created
34
+ And file "Applications" in mounted volume has GetFileInfo type ""fdrp""
35
+ And file "Applications" in mounted volume has GetFileInfo alias "1"
36
+ And file "Applications" in mounted volume has GetFileInfo custom icon "1"
37
+ And file "Applications" in mounted volume is aliased to "/Applications"
38
+
39
+ Scenario: Build a DMG with extra included file such as README in the project folder
40
+ Given a Cocoa app with choctop installed called "SampleApp"
41
+ And is configured for an asset file "README.txt" to be included in dmg
42
+ When I invoke task "rake dmg"
43
+ And dmg "appcast/build/SampleApp-0.1.0.dmg" is mounted as "SampleApp"
44
+ And file "README.txt" in mounted volume is created
45
+ And file "SampleApp.app.dSYM" in mounted volume is not created
46
+
47
+ Scenario: Build a DMG for non-Xcode project
48
+ Given a non-Xcode chcotop project "MyProject" with files: README.txt, SomeBundle.thingy
49
+ When I invoke task "rake dmg"
50
+ And dmg "appcast/build/MyProject.dmg" is mounted as "MyProject"
51
+ And file "README.txt" in mounted volume is created
52
+ And file "SomeBundle.thingy" in mounted volume is created
53
+ And file "Applications" in mounted volume is not created
@@ -0,0 +1,24 @@
1
+ Feature: Setup a Cocoa app with choctop
2
+ In order to reduce cost of using Sparkle to generate appcasts
3
+ As a Cocoa developer or Cocoa application deployer
4
+ I want a generator to install rake tasks that make using Sparkle easy-peasy
5
+
6
+ Scenario: Install choctop into an app that has no existing Rakefile
7
+ Given a Cocoa app that does not have an existing Rakefile
8
+ When I run local executable "install_choctop" with arguments "."
9
+ And Rakefile wired to use development code instead of installed RubyGem
10
+ Then file "Rakefile" is created
11
+ And I should see /rake build/
12
+ And I should see /rake upload/
13
+
14
+ Scenario: Run "install_choctop" without arguments shows an error
15
+ Given a Cocoa app that does not have an existing Rakefile
16
+ When I run local executable "install_choctop" with arguments ""
17
+ Then I should see /USAGE: install_choctop path/to/CocoaApp/
18
+
19
+ Scenario: Install choctop and generate a release_notes file
20
+ Given a Cocoa app that does not have an existing Rakefile
21
+ When I run local executable "install_choctop" with arguments "."
22
+ Then file "release_notes.txt" is created
23
+ And file "release_notes.txt" contents does match /Initial release/
24
+
@@ -0,0 +1,31 @@
1
+ Feature: Rake tasks are available to build and deploy Cocoa apps with Sparkle
2
+ In order to reduce time and cost of deploying Sparkle-enabled Cocoa apps
3
+ As a Cocoa developer or Cocoa application deployer
4
+ I want rake tasks to build and deploy my Cocoa app
5
+
6
+ Scenario: rake task to build Release of app
7
+ Given a Cocoa app with choctop installed called "SampleApp"
8
+ When I invoke task "rake build"
9
+ Then folder "build/Release/SampleApp.app" is created
10
+
11
+ Scenario: rake task to create dmg file of build
12
+ Given a Cocoa app with choctop installed called "SampleApp"
13
+ When I invoke task "rake dmg"
14
+ Then file "appcast/build/SampleApp-0.1.0.dmg" is created
15
+
16
+ Scenario: rake task to upload the appcast file to the server
17
+ Given a Cocoa app with choctop installed called "SampleApp"
18
+ And I invoke task "rake dmg feed"
19
+ And ChocTop config is configured for local rsync
20
+ When I invoke task "rake upload"
21
+ Then remote file "my_feed.xml" is created
22
+ Then remote file "SampleApp-0.1.0.dmg" is created
23
+ Then remote file "SampleApp.dmg" is created
24
+ Then remote file "index.php" is created
25
+
26
+ Scenario: change the version number in the Info.plist
27
+ Given a Cocoa app with choctop installed called "SampleApp"
28
+ When I invoke task "rake version:set VERSION="1.2.3""
29
+ Then current xcode project version is "1.2.3"
30
+
31
+
@@ -0,0 +1,38 @@
1
+ Feature: Generate an XML file for Sparkle to use for updates
2
+ In order to reduce cost of distributing apps to users
3
+ As a developer/release manager
4
+ I want to generate an XML file for the Sparkle framework
5
+
6
+ Scenario: rake task to create/update the appcast file
7
+ Given a Cocoa app with choctop installed called "SampleApp"
8
+ And ChocTop config is configured for remote Sparkle
9
+ When I invoke task "rake dmg feed"
10
+ Then file "appcast/build/my_feed.xml" is created
11
+ And file "appcast/build/my_feed.xml" contents does match /<channel>/
12
+ And file "appcast/build/my_feed.xml" contents does match /</channel>/
13
+ And file "appcast/build/my_feed.xml" contents does match /<pubDate>/
14
+ And file "appcast/build/my_feed.xml" contents does match /<item>/
15
+ And file "appcast/build/my_feed.xml" contents does match /<title>SampleApp 0.1.0</title>/
16
+ And file "appcast/build/my_feed.xml" contents does match /href="http://mocra.com/sample_app/my_feed.xml"/
17
+ And file "appcast/build/my_feed.xml" contents does match /<sparkle:releaseNotesLink>http://mocra.com/sample_app/release_notes.html</sparkle:releaseNotesLink>/
18
+ And file "appcast/build/index.php" is created
19
+ And file "appcast/build/index.php" contents does match /Location/
20
+ And file "appcast/build/index.php" contents does match /SampleApp-0.1.0.dmg/
21
+ And file "appcast/build/release_notes.html" is created
22
+ And file "appcast/build/release_notes.html" contents does match /0.1.0/
23
+ And file "appcast/build/release_notes.html" contents does match /<h2>Initial release</h2>/
24
+ And file "appcast/build/release_notes.html" contents does match /<p>Yay! First release.</p>/
25
+ And file "appcast/build/release_notes.html" contents does match /<html>/
26
+
27
+ Scenario: generate default release notes if no release_notes.txt
28
+ Given a Cocoa app with choctop installed called "SampleApp"
29
+ And ChocTop config is configured for remote Sparkle
30
+ And "release_notes.txt" file is deleted
31
+ When I invoke task "rake dmg feed"
32
+ Then file "appcast/build/release_notes.html" is created
33
+ And file "appcast/build/release_notes.html" contents does match /0.1.0/
34
+ And file "appcast/build/release_notes.html" contents does match /<h2>Initial release</h2>/
35
+ And file "appcast/build/release_notes.html" contents does match /<html>/
36
+
37
+
38
+