libin (owner)

Fork Of

Revisions

gist: 73717 Download_button fork
public
Public Clone URL: git://gist.github.com/73717.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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