Class: Buildr::Mirah::Mirahc
- Inherits:
-
Compiler::Base
- Object
- Compiler::Base
- Buildr::Mirah::Mirahc
- Defined in:
- lib/buildr/mirah.rb
Constant Summary collapse
- REQUIRES =
ArtifactNamespace.for(self) do |ns| ns.mirah! "org.mirah:mirah-complete:jar:>=0.0.7" end
- CLASSNAME =
"org.mirah.MirahCommand"
- OPTIONS =
[:classpath, :dest]
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.applies_to?(project, task) ⇒ Boolean
15 16 17 18 19 20 21 |
# File 'lib/buildr/mirah.rb', line 15 def applies_to?(project, task) paths = task.sources + [sources].flatten.map do |src| Array(project.path_to(:source, task.usage, src.to_sym)) end paths.flatten! paths.any? { |path| !Dir["#{path}/**/*.mirah"].empty? } end |
.dependencies ⇒ Object
11 12 13 |
# File 'lib/buildr/mirah.rb', line 11 def dependencies REQUIRES.artifacts end |
Instance Method Details
#compile(sources, target, dependencies) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/buildr/mirah.rb', line 31 def compile(sources, target, dependencies) return if Buildr.application..dryrun Buildr.ant "mirahc" do |ant| refid = "mirahc-classpath" ant.path(:id => refid) do dependencies.each { |dep| ant.pathelement :location => dep } end = { :classname => "org.mirah.MirahCommand", :classpathref => refid, :fork => true, :failonerror => true, } ant.java() do ant.arg(:value => "compile") = .to_hash.only(*OPTIONS) [:dest] = target .each_pair do |key, value| ant.arg(:value => "--#{key.to_s}") ant.arg(:value => value) end ant.arg(:value => "--explicit-packages") sources.each do |src| ant.arg(:value => src) end end end end |