Skip to content
Browse files

refactoring dmg builder into own file

  • Loading branch information...
1 parent 9556915 commit 1f04ac4f4da7c5130cbbd7d1fdae4a8fa8aa7fc1 @drnic committed Jan 25, 2009
Showing with 54 additions and 5 deletions.
  1. +1 −0 README.rdoc
  2. +35 −0 features/dmg.feature
  3. +2 −0 features/steps/dmg_steps.rb
  4. +1 −0 lib/choctop.rb
  5. +0 −5 lib/choctop/appcast.rb
  6. +15 −0 lib/choctop/dmg.rb
View
1 README.rdoc
@@ -88,6 +88,7 @@ its set to Debug for development) and then Build. The "rake appcast" task should
* Chris Bailey at http://codeintensity.blogspot.com/2008/03/creating-sparkle-appcast-via-rake-tasks.html
* Eloy Duran's Rucola at http://github.com/alloy/rucola
+* Emanuele Vicentini's rake_dmg at http://github.com/baldowl/rake_dmg
== SPONSORED BY:
View
35 features/dmg.feature
@@ -0,0 +1,35 @@
+Feature: Can build a customised DMG image from application build
+ In order to reduce cost of building DMG images for each release of an application
+ As a Cocoa developer or release manager
+ I want a rake task to generate a DMG based on custom settings
+
+ Scenario: Build a vanilla DMG
+ Given a Cocoa app with choctop installed
+ When task 'rake dmg' is invoked
+ Then file 'appcast/build/SampleApp.dmg' is created
+
+ Scenario: Build and mount an editable DMG for design purposes
+ Given a Cocoa app with choctop installed
+ When task 'rake dmg:design' is invoked
+ Then file 'appcast/build/SampleApp-design.dmg' is created
+ And folder '/Volumes/SampleApp' is created
+ And folder '/Volumes/SampleApp/SampleApp.app' is created
+ And file '/Volumes/SampleApp/Application' is created as a symlink to /Application
+
+ Scenario: Freeze the designed DMG by storing the .DS_Store
+ Given a Cocoa app with choctop installed
+ And task 'rake dmg:design' is invoked
+ And a custom .DS_Store is designed with a custom background
+ When task 'rake dmg:freeze_design' is invoked
+ Then folder '/Volumes/SampleApp' is not created
+ And file 'appcast/custom_ds_store' is created
+ And file 'appcast/background.png' is created
+
+ Scenario: Build a designed DMG using files cached from frozen design
+ Given a Cocoa app with choctop installed
+ And task 'rake dmg:design' is invoked
+ And a custom .DS_Store is designed with a custom background
+ And task 'rake dmg:freeze_design' is invoked
+ And task 'rake dmg' is invoked
+ Then file 'appcast/build/SampleApp.dmg' is created
+
View
2 features/steps/dmg_steps.rb
@@ -0,0 +1,2 @@
+Given /^a custom \.DS_Store is designed with a custom background$/ do
+end
View
1 lib/choctop.rb
@@ -124,4 +124,5 @@ def define_tasks
end
end
require "choctop/appcast"
+require "choctop/dmg"
View
5 lib/choctop/appcast.rb
@@ -3,11 +3,6 @@ def make_build
sh "xcodebuild -configuration Release"
end
- def make_dmg
- FileUtils.rm_rf pkg
- sh "hdiutil create -volname '#{name}' -srcfolder 'build/Release/#{target}' '#{pkg}'"
- end
-
def make_appcast
app_name = File.basename(File.expand_path('.'))
View
15 lib/choctop/dmg.rb
@@ -0,0 +1,15 @@
+module ChocTop::Dmg
+ def make_dmg
+ FileUtils.rm_rf pkg
+ sh "hdiutil create -volname '#{name}' -srcfolder 'build/Release/#{target}' '#{pkg}'"
+ end
+
+ def make_writeable_dmg
+ FileUtils.rm_rf pkg
+ sh "hdiutil create -format UDRW -volname '#{name}' -srcfolder 'build/Release/#{target}' '#{pkg}'"
+ end
+
+
+end
+ChocTop.send(:include, ChocTop::Dmg)
+

0 comments on commit 1f04ac4

Please sign in to comment.
Something went wrong with that request. Please try again.