Top Level Namespace

Defined Under Namespace

Modules: JavaTools

Instance Method Summary collapse

Instance Method Details

#jar(output, files = nil, options = nil) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/java_tools.rb', line 44

def jar( output, files = nil, options = nil )
  base_dir = nil
  
  if options && options[:base_dir]
    base_dir = options[:base_dir]
  end
  
  obj = JavaTools::Jar.new(output, files, base_dir)
  
  if block_given?
    yield obj
  elsif options
    JavaTools::configure_command(obj, options)
  end
  
  obj.execute
end

#javac(source_files, options = nil) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/java_tools.rb', line 32

def javac( source_files, options = nil )
  obj = JavaTools::Javac.new(*source_files)
  
  if block_given?
    yield obj
  elsif options
    JavaTools::configure_command(obj, options)
  end
  
  obj.execute
end