Class: Buildr::Groovy::GroovySH

Inherits:
Shell::Base show all
Defined in:
lib/buildr/groovy/shell.rb

Constant Summary collapse

SUFFIX =
if Util.win_os? then '.bat' else '' end

Instance Attribute Summary

Attributes inherited from Shell::Base

#project

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Shell::Base

#build?, #initialize, to_sym

Constructor Details

This class inherits a constructor from Buildr::Shell::Base

Class Method Details

.langObject



24
25
26
# File 'lib/buildr/groovy/shell.rb', line 24

def lang
  :groovy
end

Instance Method Details

#launchObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/buildr/groovy/shell.rb', line 29

def launch
  fail 'Are we forgetting something? GROOVY_HOME not set.' unless groovy_home
  
  cp = project.compile.dependencies.join(File::PATH_SEPARATOR) + 
    File::PATH_SEPARATOR + project.path_to(:target, :classes)
  
  cmd_args = " -classpath '#{cp}'"
  trace "groovysh #{cmd_args}"
  system(File.expand_path("bin#{File::SEPARATOR}groovysh#{SUFFIX}", groovy_home) + cmd_args)
end