Class: Javac
Instance Attribute Summary collapse
-
#cp ⇒ Object
Returns the value of attribute cp.
-
#output ⇒ Object
Returns the value of attribute output.
-
#src ⇒ Object
Returns the value of attribute src.
Attributes inherited from JavaTask
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(path) ⇒ Javac
constructor
A new instance of Javac.
Methods inherited from JavaTask
Constructor Details
#initialize(path) ⇒ Javac
Returns a new instance of Javac.
4 5 6 7 |
# File 'lib/jake/javac.rb', line 4 def initialize(path) super(path) @cp = [] end |
Instance Attribute Details
#cp ⇒ Object
Returns the value of attribute cp.
2 3 4 |
# File 'lib/jake/javac.rb', line 2 def cp @cp end |
#output ⇒ Object
Returns the value of attribute output.
2 3 4 |
# File 'lib/jake/javac.rb', line 2 def output @output end |
#src ⇒ Object
Returns the value of attribute src.
2 3 4 |
# File 'lib/jake/javac.rb', line 2 def src @src end |
Instance Method Details
#command ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/jake/javac.rb', line 9 def command classpath = [] @src = Dir.glob(@src) @cp.each do |p| puts "Globbing #{p}" classpath << Dir.glob(p) puts "CP = #{classpath}" end FileUtils.mkdir_p(@output) unless File.exist? @output "javac " + @src.join(' ').to_s + " -cp " + classpath.join(cp_separator).to_s + " -d " + @output end |