class Buildr::Options

Collection of options for controlling Buildr.



Runs the build in parallel when true (defaults to false). You can force a parallel build by setting this option directly, or by running the parallel task ahead of the build task.

This option only affects recursive tasks. For example:

buildr parallel package

will run all package tasks (from the sub-projects) in parallel, but each sub-project’s package task runs its child tasks (prepare, compile, resources, etc) in sequence.

Public Instance Methods

debug() click to toggle source

Returns the debug option (environment variable DEBUG).

# File lib/buildr/core/compile.rb, line 593
def debug
  (ENV['DEBUG'] || ENV['debug']) !~ /(no|off|false)/
debug=(flag) click to toggle source

Sets the debug option (environment variable DEBUG).

You can turn this option off directly, or by setting the environment variable DEBUG to no. For example:

buildr build DEBUG=no

The release tasks runs a build with DEBUG=no.

# File lib/buildr/core/compile.rb, line 604
def debug=(flag)
  ENV['debug'] = nil
  ENV['DEBUG'] = flag.to_s
proxy → options click to toggle source

Returns the proxy options. Currently supported options are:

  • :http – HTTP proxy for use when downloading.

  • :exclude – Do not use proxy for these hosts/domains.

For example:

options.proxy.http = ''

You can also set it using the environment variable HTTP_PROXY.

You can exclude individual hosts from being proxied, or entire domains, for example:

options.proxy.exclude = 'optimus'
options.proxy.exclude = ['optimus', 'prime']
options.proxy.exclude << '*.internal'
# File lib/buildr/core/environment.rb, line 101
def proxy
  @proxy ||=
test() click to toggle source

Returns the test option (environment variable TEST). Possible values are:

  • :false – Do not run any tests (also accepts ‘no’ and ‘skip’).

  • :true – Run all tests, stop on failure (default if not set).

  • :all – Run all tests, ignore failures.

# File lib/buildr/core/test.rb, line 791
def test
  case value = ENV['TEST'] || ENV['test']
  when /^(no|off|false|skip)$/
  when /^all$/
  when /^only$/
  when /^(yes|on|true)$/, nil
    warn "Expecting the environment variable test to be 'no' or 'all', not sure what to do with #{value}, so I'm just going to run all the tests and stop at failure."
test=(flag) click to toggle source

Sets the test option (environment variable TEST). Possible values are true, false or :all.

You can also set this from the environment variable, e.g.:

buildr          # With tests
buildr test=no  # Without tests
buildr test=all # Ignore failures
set TEST=no
buildr          # Without tests
# File lib/buildr/core/test.rb, line 816
def test=(flag)
  ENV['test'] = nil
  ENV['TEST'] = flag.to_s