lib/java/java.rb in buildr-1.2.5 vs lib/java/java.rb in buildr-1.2.6
- old
+ new
@@ -230,17 +230,14 @@
case value
when true, nil
cmd_args << "-#{key}"
when false
cmd_args << "-no#{key}"
- when Array
- cmd_args << "-#{key}"
- cmd_args += value.map(&:to_s)
when Hash
value.each { |k,v| cmd_args << "-#{key}" << k.to_s << v.to_s }
else
- cmd_args << "-#{key}" << value.to_s
+ cmd_args += Array(value).map { |item| ["-#{key}", item.to_s] }.flatten
end
end
[:sourcepath, :classpath].each do |option|
options[option].to_a.flatten.tap do |paths|
cmd_args << "-#{option}" << paths.flatten.map(&:to_s).join(File::PATH_SEPARATOR) unless paths.empty?
@@ -376,23 +373,23 @@
# :call-seq:
# java_args => array
#
# Returns the Java arguments.
def java_args()
- @java_args ||= (ENV["JAVA_OPTIONS"] || ENV["java_options"] || "").split(" ")
+ @java_args ||= (ENV["JAVA_OPTS"] || ENV["JAVA_OPTIONS"] || "").split(" ")
end
# :call-seq:
# java_args = array|string|nil
#
# Sets the Java arguments. These arguments are used when creating a JVM, including for use with RJB
# for most tasks (e.g. Ant, compile) and when forking a separate JVM (e.g. JUnit tests). You can also
- # use the JAVA_OPTIONS environment variable.
+ # use the JAVA_OPTS environment variable.
#
# For example:
# options.java_args = "-verbose"
# Or:
- # $ set JAVA_OPTIONS = "-Xms1g"
+ # $ set JAVA_OPTS = "-Xms1g"
# $ buildr
def java_args=(args)
args = args.split if String === args
@java_args = args.to_a
end