class Buildr::Groovy::Groovyc

Groovyc compiler:

compile.using(:groovyc)

You need to require 'buildr/groovy/compiler' if you need to use this compiler.

Used by default if .groovy files are found in the src/main/groovy directory (or src/test/groovy) and sets the target directory to target/classes (or target/test/classes).

Groovyc is a joint compiler, this means that when selected for a project, this compiler is used to compile both groovy and java sources. It's recommended that Groovy sources are placed in the src/main/groovy directory, even though this compiler also looks in src/main/java

Groovyc accepts the following options:

Constants

ANT_TASK
GROOVYC_OPTIONS
JAVAC_OPTIONS
OPTIONS
REQUIRES

The groovyc compiler jars are added to classpath at load time, if you want to customize artifact versions, you must set them on the

artifact_ns(Buildr::Groovy::Groovyc).groovy = '1.7.1'

namespace before this file is required.

Private Instance Methods

groovyc_options(sources, target) click to toggle source
# File lib/buildr/groovy/compiler.rb, line 132
def groovyc_options(sources, target)
  check_options options, OPTIONS
  groovyc_options = options.to_hash.only(*GROOVYC_OPTIONS)
  groovyc_options[:destdir] = File.expand_path(target)
  groovyc_options
end
javac_options() click to toggle source
# File lib/buildr/groovy/compiler.rb, line 139
def javac_options
  check_options options, OPTIONS
  javac_options = options.to_hash.only(*JAVAC_OPTIONS)
  javac_options[:optimize] = (javac_options.delete(:optimise) || false)
  javac_options[:nowarn] = (javac_options.delete(:warnings) || verbose).to_s !~ /^(true|yes|on)$/i
  other = javac_options.delete(:javac) || {}
  javac_options.merge!(other)
  javac_options
end