Skip to content
Browse files

add the Rakefile to create dmg file

  • Loading branch information...
1 parent ce05f15 commit 1c1a3a42bbd84d2e01068c55e8e2e404aafd5b7a @Watson1978 committed Sep 18, 2012
Showing with 34 additions and 0 deletions.
  1. +34 −0 Rakefile
View
34 Rakefile
@@ -0,0 +1,34 @@
+APP_NAME = "PodCreator"
+CONFIG = "Release"
+
+begin
+ info_plist = load_plist(File.read("#{APP_NAME}/#{APP_NAME}-Info.plist"))
+ VERSION = info_plist["CFBundleShortVersionString"].to_s
+ raise "can't load Info.plist" if VERSION.length == 0
+ DMG_FILE = "#{APP_NAME}-#{VERSION}.dmg"
+rescue
+ raise "<< This Rakefile depends on MacRuby!! Should run with macrake. >>"
+end
+
+task :default => :dmg
+
+desc "Build Application"
+task :build do
+ sh "xcodebuild -target #{APP_NAME} -configuration #{CONFIG}"
+end
+
+desc "Embed MacRuby to Application"
+task :embed do
+ sh "xcodebuild -target Deployment"
+end
+
+desc "Make #{DMG_FILE}"
+task :dmg => [:clean, :embed] do
+ sh "hdiutil create #{DMG_FILE} -volname #{APP_NAME} -srcfolder build/Release/#{APP_NAME}.app"
+end
+
+desc "Clean building files"
+task :clean do
+ sh "rm -rf build"
+ sh "rm -rf #{DMG_FILE}"
+end

0 comments on commit 1c1a3a4

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