Module: Buildr::Compiler

Defined in:
lib/buildr/core/compile.rb,
lib/buildr/java/compiler.rb

Overview

The underlying compiler used by CompileTask. To add a new compiler, extend Compiler::Base and add your compiler using:

Buildr::Compiler.add MyCompiler

Defined Under Namespace

Classes: Base, Javac

Class Method Summary collapse

Class Method Details

.add(compiler) ⇒ Object Also known as: <<

Adds a compiler to the list of supported compiler.

For example:

Buildr::Compiler << Buildr::Javac


43
44
45
46
# File 'lib/buildr/core/compile.rb', line 43

def add(compiler)
  @compilers ||= []
  @compilers |= [compiler]
end

.compilersObject

Returns a list of available compilers.



50
51
52
# File 'lib/buildr/core/compile.rb', line 50

def compilers
  @compilers ||= []
end

.has?(name) ⇒ Boolean

Returns true if the specified compiler exists.

Returns:

  • (Boolean)


30
31
32
# File 'lib/buildr/core/compile.rb', line 30

def has?(name)
  compilers.any? { |compiler| compiler.to_sym == name.to_sym }
end

.select(name) ⇒ Object

Select a compiler by its name.



35
36
37
# File 'lib/buildr/core/compile.rb', line 35

def select(name)
  compilers.detect { |compiler| compiler.to_sym == name.to_sym }
end