Class: Buildr::Doc::VScaladoc
Constant Summary collapse
- VERSION =
'1.2-m1'
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Buildr::Doc::Base
Class Method Details
Instance Method Details
#generate(sources, target, options = {}) ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/buildr/scala/doc.rb', line 100 def generate(sources, target, = {}) cmd_args = [ '-d', target, (trace?(:vscaladoc) ? '-verbose' : ''), '-sourcepath', project.compile.sources.join(File::PATH_SEPARATOR) ] .reject { |key, value| [:sourcepath, :classpath].include?(key) }. each { |key, value| value.invoke if value.respond_to?(:invoke) }. each do |key, value| case value when true, nil cmd_args << "-#{key}" when false cmd_args << "-no#{key}" when Hash value.each { |k,v| cmd_args << "-#{key}" << k.to_s << v.to_s } else cmd_args += Array(value).map { |item| ["-#{key}", item.to_s] }.flatten end end [:sourcepath, :classpath].each do |option| Array([option]).flatten.tap do |paths| cmd_args << "-#{option}" << paths.flatten.map(&:to_s).join(File::PATH_SEPARATOR) unless paths.empty? end end cmd_args += sources.flatten.uniq unless Buildr.application..dryrun info "Generating VScaladoc for #{project.name}" trace (['vscaladoc'] + cmd_args).join(' ') Java.load Java.org.scala_tools.vscaladoc.Main.main(cmd_args.to_java(Java.java.lang.String)) == 0 or fail 'Failed to generate VScaladocs, see errors above' end end |