Top Level Namespace

Extended by:
Buildr

Defined Under Namespace

Modules: Buildr, FileUtils, Java, Kernel, Rake, RakeFileUtils, URI, Zip Classes: Array, Hash, Module, Object, OpenObject, ProgressBar, Symbol

Constant Summary collapse

ENV_JAVA =

Equivalent to Java system properties. For example:

ENV_JAVA['java.version']
ENV_JAVA['java.class.version']
{}

Constants included from Buildr

Buildr::ScalaCheck, Buildr::ScalaSpecs, Buildr::ScalaTest, Buildr::VERSION

Constants included from Buildr::Ant

Buildr::Ant::VERSION

Instance Method Summary collapse

Methods included from Buildr

application, application=, artifact, artifact_ns, artifacts, concat, define, download, environment, filter, group, help, help, install, integration, options, options, project, projects, read, repositories, settings, struct, transitive, unzip, upload, write, zip

Methods included from Buildr::Ant

#ant, dependencies, version

Instance Method Details

#error(message) ⇒ Object

Show error message. Use this when you need to show an error message and not throwing an exception that will stop the build.



621
622
623
# File 'lib/buildr/core/application.rb', line 621

def error(message)
  puts $terminal.color(message.to_s, :red)
end

#growl_notify(type, title, message) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/buildr/core/osx.rb', line 19

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) ⇒ Object

Show optional information. The message is printed only when running in verbose mode (the default).



627
628
629
# File 'lib/buildr/core/application.rb', line 627

def info(message)
  puts message if verbose
end

#notify_send(type, title, message) ⇒ Object



21
22
23
24
# File 'lib/buildr/core/linux.rb', line 21

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) ⇒ Object

:call-seq:

tar(file) => TarTask

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


187
188
189
# File 'lib/buildr/packaging/tar.rb', line 187

def tar(file)
  TarTask.define_task(file)
end

#trace(message) ⇒ Object

Show message. The message is printed out only when running in trace mode.



632
633
634
# File 'lib/buildr/core/application.rb', line 632

def trace(message)
  puts message if Buildr.application.options.trace
end

#trace?(*category) ⇒ Boolean

Returns:

  • (Boolean)


636
637
638
639
640
641
642
# File 'lib/buildr/core/application.rb', line 636

def trace?(*category)
  options = Buildr.application.options
  return options.trace if category.empty?
  return true if options.trace_all
  return false unless Buildr.application.options.trace_categories
  options.trace_categories.include?(category.first)
end

#warn(message) ⇒ Object

Show warning message.



615
616
617
# File 'lib/buildr/core/application.rb', line 615

def warn(message)
  warn_without_color $terminal.color(message.to_s, :blue) if verbose
end

#warn_without_colorObject



612
# File 'lib/buildr/core/application.rb', line 612

alias :warn_without_color :warn