lib/java/compile.rb in buildr-0.22.0 vs lib/java/compile.rb in buildr-1.0.0
- old
+ new
@@ -47,27 +47,27 @@
OPTIONS = [:warnings, :deprecation, :source, :target, :lint, :debug, :other]
# Generate warnings (opposite of -nowarn).
attr_accessor :warnings
- inherited_attr :warnings
+ inherited_attr :warnings, false
# Output source locations where deprecated APIs are used.
attr_accessor :deprecation
- inherited_attr :deprecation
+ inherited_attr :deprecation, false
# Provide source compatibility with specified release.
attr_accessor :source
inherited_attr :source
# Generate class files for specific VM version.
attr_accessor :target
inherited_attr :target
# Values to pass to Xlint: string or array. Use true to enable
# Xlint with no values.
attr_accessor :lint
- inherited_attr :lint
+ inherited_attr :lint, false
# Generate all debugging info.
attr_accessor :debug
- inherited_attr :debug
+ inherited_attr(:debug) { Buildr.options.debug }
# Array of arguments passed to the Java compiler as is.
attr_accessor :other
inherited_attr :other
def initialize(parent = nil) #:nodoc:
@@ -554,7 +554,23 @@
project.build project.compile.target
# This comes last so we can determine all the source paths and classpath dependencies.
project.javadoc.from project
end
end
+
+
+ class Options
+
+ # Runs the compile in debugging mode when true (default).
+ #
+ # You can turn this option off directly, or by setting the environment variable
+ # DEBUG to "no". For example:
+ # rake build DEBUG=no
+ #
+ # The release tasks runs a build with <tt>DEBUG=no</tt>.
+ attr_accessor :debug
+
+ end
+
+ options.debug = (ENV["DEBUG"] || ENV["debug"]) !~ /(no|off|false)/
end