Class: Doubleshot::Compiler
- Defined in:
- lib/doubleshot/compiler.rb,
lib/doubleshot/compiler/classpath.rb
Defined Under Namespace
Classes: Classpath
Instance Attribute Summary collapse
-
#classpath ⇒ Object
readonly
Returns the value of attribute classpath.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #build!(add_target_to_current_classpath = false) ⇒ Object
-
#initialize(source, target) ⇒ Compiler
constructor
A new instance of Compiler.
- #pending? ⇒ Boolean
Constructor Details
Instance Attribute Details
#classpath ⇒ Object (readonly)
Returns the value of attribute classpath.
13 14 15 |
# File 'lib/doubleshot/compiler.rb', line 13 def classpath @classpath end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
13 14 15 |
# File 'lib/doubleshot/compiler.rb', line 13 def source @source end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
13 14 15 |
# File 'lib/doubleshot/compiler.rb', line 13 def target @target end |
Instance Method Details
#build!(add_target_to_current_classpath = false) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/doubleshot/compiler.rb', line 21 def build!(add_target_to_current_classpath = false) @target.mkdir unless @target.exist? # The JRuby ant integration throws JRuby Persistence # warnings that you can't supress, so we run it # inside of a Kernel#silence block. silence do # Since the ant.path block is instance_evaled, # the following line is a hack to ensure we have # access to the contents of @classpath. classpath = @classpath ant.path id: "classpath" do classpath.each do |path| fileset dir: path end end ant.javac srcdir: @source.to_s, destdir: @target.to_s, debug: "yes", includeantruntime: "no", classpathref: "classpath" end $CLASSPATH << @target.to_url if add_target_to_current_classpath self end |