Skip to content

Instantly share code, notes, and snippets.

@stve
Forked from lukeredpath/gist:72511
Created March 25, 2009 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stve/84541 to your computer and use it in GitHub Desktop.
Save stve/84541 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