Files
RubyMotion/lib/motion/project/app.rb

61 lines
1.2 KiB
Ruby

module Motion; module Project
class App
VERBOSE =
begin
if Rake.send(:verbose) != true
Rake.send(:verbose, false)
false
else
true
end
rescue
true
end
class << self
def config
@config ||= Motion::Project::Config.new('.')
end
def builder
@builder ||= Motion::Project::Builder.new
end
def setup
yield config
config.validate
end
def build(platform)
builder.build(config, platform)
end
def codesign(platform)
builder.codesign(config, platform)
end
def log(what, msg)
@print_mutex ||= Mutex.new
# Because this method can be called concurrently, we don't want to mess any output.
@print_mutex.synchronize do
what = "\e[1m" + what.rjust(10) + "\e[0m" # bold
$stderr.puts what + ' ' + msg
end
end
def warn(msg)
log 'WARNING!', msg
end
def fail(msg)
log 'ERROR!', msg
exit 1
end
def info(what, msg)
log what, msg unless VERBOSE
end
end
end
end; end