Top Level Namespace

Extended by:
Buildr
Includes:
Rake::DSL

Defined Under Namespace

Modules: Buildr, FileUtils, Java, Kernel, Rake, 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::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, ensure_rspec, environment, filter, group, help, help, install, integration, options, options, project, projects, read, repositories, rspec_present?, 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.



608
609
610
# 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) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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) ⇒ Object

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



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

def info(message)
  puts message if verbose
end

#notify_send(type, title, message) ⇒ Object



20
21
22
23
# 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) ⇒ 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


220
221
222
# File 'lib/buildr/packaging/tar.rb', line 220

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

#trace(message) ⇒ Object

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



619
620
621
# File 'lib/buildr/core/application.rb', line 619

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

#trace?(*category) ⇒ Boolean

Returns:

  • (Boolean)


623
624
625
626
627
628
629
# 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) ⇒ Object

Show warning message.



602
603
604
# File 'lib/buildr/core/application.rb', line 602

def warn(message)
  warn_without_color Buildr::Console.color(message.to_s, :blue) if verbose
end

#warn_without_colorObject



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

alias :warn_without_color :warn