Created
May 13, 2013 12:41
-
-
Save xslim/5568050 to your computer and use it in GitHub Desktop.
Rakefile for iOS builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'xcoder' | |
# gem install specific_install | |
# gem specific_install -l https://github.com/xslim/xcoder.git | |
#xcoder -l notice -r build | |
#xcoder -l notice -r package | |
#xcoder -l notice -r deploy | |
# Define or comment out | |
identity = "iPhone Developer:" | |
profile_udid = 'XXX-XXX-XXX' | |
build_dir = 'build' | |
workspace = Xcode.workspaces.select {|w| w.name != 'Pods'}.first | |
scheme = workspace.schemes.select {|s| (s.name != 'Pods') && (s.name !~ /-cal$/)}.first | |
deploy_notes=`git log --pretty=format:'* %h %s (%cr, %an)' --abbrev-commit --date=relative -n 5` | |
# Install `moreutils` - `brew install moreutils` | |
#deploy_notes=`export EDITOR=vim; git log --pretty=format:'* %h %s (%cr, %an)' --abbrev-commit --date=relative -n 5 | vipe` #`git log -n 1` | |
pprofile = Xcode::ProvisioningProfile.find_installed_by_uuid(profile_udid) | |
pprofile_path = pprofile.path | |
build_path = File.join(File.expand_path(File.dirname(__FILE__)), build_dir) | |
puts "Using #{workspace.name}: #{scheme.name}" | |
Xcode::TerminalOutput.log_level = :notice | |
builder = scheme.builder | |
desc "Build App" | |
task :build do | |
builder.profile = pprofile_path | |
builder.identity = identity | |
builder.build_path = build_path | |
builder.clean | |
builder.build | |
end | |
desc "Build and Package App" | |
task :package => :build do | |
builder.package | |
end | |
desc "Build, Package and Deploy to TestFlight" | |
task :deploy => :package do | |
builder.deploy :testflight, | |
:api_token => 'XXX', | |
:team_token => 'XXX', | |
:notify => true, | |
:lists => ['Internal'], | |
:notes => deploy_notes | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment