class Object
Constants
- ENV_JAVA
Equivalent to Java system properties. For example:
ENV_JAVA['java.version'] ENV_JAVA['java.class.version']
- Scala
Public Instance Methods
error(message)
click to toggle source
Show error message. Use this when you need to show an error message and not throwing an exception that will stop the build.
# File lib/buildr/core/application.rb, line 608 def error(message) puts Buildr::Console.color(message.to_s, :red) end
growl_notify(type, title, message)
click to toggle source
# File lib/buildr/core/osx.rb, line 18 def growl_notify(type, title, message) begin # Loading Ruby Cocoa can slow the build down (hooks on Object class), so we're # saving the best for last and only requiring it at the very end. require 'osx/cocoa' icon = OSX::NSApplication.sharedApplication.applicationIconImage icon = OSX::NSImage.alloc.initWithContentsOfFile(File.join(File.dirname(__FILE__), '../resources/buildr.icns')) # Register with Growl, that way you can turn notifications on/off from system preferences. OSX::NSDistributedNotificationCenter.defaultCenter. postNotificationName_object_userInfo_deliverImmediately(:GrowlApplicationRegistrationNotification, nil, { :ApplicationName=>'Buildr', :AllNotifications=>['Completed', 'Failed'], :ApplicationIcon=>icon.TIFFRepresentation }, true) OSX::NSDistributedNotificationCenter.defaultCenter. postNotificationName_object_userInfo_deliverImmediately(:GrowlNotification, nil, { :ApplicationName=>'Buildr', :NotificationName=>type, :NotificationTitle=>title, :NotificationDescription=>message }, true) rescue Exception # We get here in two cases: system doesn't have Growl installed so one of the OSX # calls raises an exception; system doesn't have osx/cocoa, e.g. MacPorts Ruby 1.9, # so we also need to rescue LoadError. end end
info(message)
click to toggle source
Show optional information. The message is printed only when running in verbose mode (the default).
# File lib/buildr/core/application.rb, line 614 def info(message) puts message if verbose end
notify_send(type, title, message)
click to toggle source
# File lib/buildr/core/linux.rb, line 20 def notify_send(type, title, message) icon = File.join(File.dirname(__FILE__), '../resources/', type.to_s + '.png') system "notify-send -i #{icon} \"#{title}\" \"#{message}\"" end
tar(file) → TarTask
click to toggle source
The TarTask creates a new Tar file. You can include any number of files and and directories, use exclusion patterns, and include files into specific directories.
To create a GZipped Tar, either set the gzip option to true, or use the .tgz or .gz suffix.
For example:
tar("test.tgz").tap do |tgz| tgz.include "srcs" tgz.include "README", "LICENSE" end
# File lib/buildr/packaging/tar.rb, line 185 def tar(file) TarTask.define_task(file) end
trace(message)
click to toggle source
Show message. The message is printed out only when running in trace mode.
# File lib/buildr/core/application.rb, line 619 def trace(message) puts message if Buildr.application.options.trace end
trace?(*category)
click to toggle source
# File lib/buildr/core/application.rb, line 623 def trace?(*category) options = Buildr.application.options return options.trace if category.empty? return true if options.trace_all return false unless options.trace_categories options.trace_categories.include?(category.first) end
warn(message)
click to toggle source
Show warning message.
# File lib/buildr/core/application.rb, line 602 def warn(message) warn_without_color Buildr::Console.color(message.to_s, :blue) if verbose end
Also aliased as: warn_without_color