Skip to content

Instantly share code, notes, and snippets.

@Bodacious
Created September 21, 2012 09:06
Show Gist options
  • Save Bodacious/3760494 to your computer and use it in GitHub Desktop.
Save Bodacious/3760494 to your computer and use it in GitHub Desktop.
What's in your RubyMotion project's Rakefile?

There's not a great deal of documentation on the options available when configuring your Rakefile in Rubymotion.

I figure having the community share what's in theirs will help other developers get a better idea of how they should configure their own project.

$:.unshift("/Library/RubyMotion/lib")
# I keep a separate file called version.rb which contains a constant with the current version:
# e.g. VERSION = '3.4.1'
require File.join(File.dirname(__FILE__), 'version')
require 'motion/project'
# Include the gems from my Gemfile and require their necessary load files
require 'bundler'
Bundler.require
Motion::Project::App.setup do |app|
app.name = "My App Name"
app.seed_id = "MYS33D1D"
app.identifier = "com.katanacode.MyAppName"
app.prerendered_icon = false
app.deployment_target = "4.3"
app.sdk_version = "6.0"
app.device_family = :iphone
app.interface_orientations = [:portrait]
app.entitlements['application-identifier'] = "#{app.seed_id}.#{app.identifier}"
app.entitlements['keychain-access-groups'] = ["#{app.seed_id}.#{app.identifier}"]
app.development do
app.codesign_certificate = "iPhone Developer: Gavin Morrice (MYD3VH45H)"
app.provisioning_profile = '/Users/Gavin/Library/MobileDevice/Provisioning Profiles/MYD3VH45H-MYD3VH45H-MYD3VH45H-409F.mobileprovision'
app.entitlements['aps-environment'] = 'development'
app.entitlements['get-task-allow'] = true
end
app.release do
app.codesign_certificate = "iPhone Distribution: Katana Code Ltd."
app.provisioning_profile = '/Users/Gavin/Library/MobileDevice/Provisioning Profiles/NYD3VH45H-MYD3VH45H-MYD3VH45H-409F.mobileprovision'
app.entitlements['aps-environment'] = 'production'
app.entitlements['get-task-allow'] = false
end
# load these files before the others
filesOrder = %W{
version.rb
app/lib/ui_color.rb
app/lib/standard_user_defaults.rb
... #
}
app.files = filesOrder
directoryOrder = %W{ app/lib app/lib/** app/models app/views app/controllers vendor/*/*/lib }
for dir in directoryOrder
Dir.glob(File.join(File.dirname(__FILE__), dir, '*.rb')) do |file|
file = file.split('SynergeeMotion/').last
app.files << file unless app.files.include?(file)
end
end
app.files << 'app/app_delegate.rb'
app.frameworks = ["UIKit", "Foundation", "CoreGraphics", 'CoreLocation', 'MapKit', 'QuartzCore']
app.icons = ['Icon.png', 'Icon-72.png', '[email protected]']
app.short_version = VERSION.scan(/^\d+\.\d+/).first # e.g. "3.4"
app.version = VERSION.scan(/^\d+\.\d+\.(.+)/).flatten.first # e.g. "1"
app.pods do
pod 'AFNetworking', '~> 1.0RC1'
pod 'Facebook-iOS-SDK', '>= 3.0.8'
pod 'MBProgressHUD', '~> 0.5'
pod 'PullToRefresh', '~> 0.0.1'
end
# TestFlight
app.testflight.sdk = 'vendor/TestFlightSDK'
app.testflight.api_token = '7303366cf2392c9982e9e3f3ddNOTREALLYMYTOKENMjAxMi0wMi0yMSAwOToyMjozOC43NjkwMDM'
app.testflight.team_token = 'FALSE36cf2392c9982e9e3f3ddNOTREALLYMYTOKENMjAxMi0wMi0yMSAwOToyMjozOC43NjkwMDM'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment