Skip to content

Instantly share code, notes, and snippets.

@lukeredpath
Created March 1, 2009 22:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save lukeredpath/72511 to your computer and use it in GitHub Desktop.
Save lukeredpath/72511 to your computer and use it in GitHub Desktop.
RELEASE_OUTPUT_PATH = File.expand_path("~/Projects/releases/Squeemote")
TARGET_NAME = "Squeemote"
CONFIGURATION = ENV['CONFIGURATION'] || "Distribution"
SDK_VERSION = ENV['SDK'] || 'iphoneos2.2'
task :release do
puts "* Bumping build version."
`agvtool bump -all`
puts "* Building #{CONFIGURATION} release."
`xcodebuild -target #{TARGET_NAME} -configuration #{CONFIGURATION} -sdk #{SDK_VERSION}`
build_path = File.join('build', "#{CONFIGURATION}-iphoneos")
puts "* Creating #{CONFIGURATION} package"
output_path = File.join(RELEASE_OUTPUT_PATH, `agvtool mvers -terse1`.strip + "-#{CONFIGURATION.downcase}")
`rm -Rf #{output_path}` if File.exist?(output_path)
`mkdir #{output_path} && mv #{File.join(build_path, '*')} #{output_path}`
puts "* Compressing."
`cd #{output_path} && zip -ry #{TARGET_NAME}.zip #{TARGET_NAME}.app`
puts "* Done."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment