Author: djspiewak
Date: Tue Jun 23 00:01:58 2009
New Revision: 787461

URL: http://svn.apache.org/viewvc?rev=787461&view=rev
Log:
Initial prototype of Groovy shell integration

Added:
    buildr/trunk/lib/buildr/groovy/shell.rb
Modified:
    buildr/trunk/lib/buildr/groovy.rb

Modified: buildr/trunk/lib/buildr/groovy.rb
URL: 
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/groovy.rb?rev=787461&r1=787460&r2=787461&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/groovy.rb (original)
+++ buildr/trunk/lib/buildr/groovy.rb Tue Jun 23 00:01:58 2009
@@ -16,3 +16,4 @@
 
 require 'buildr/groovy/compiler'
 require 'buildr/groovy/bdd'
+require 'buildr/groovy/shell'

Added: buildr/trunk/lib/buildr/groovy/shell.rb
URL: 
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/groovy/shell.rb?rev=787461&view=auto
==============================================================================
--- buildr/trunk/lib/buildr/groovy/shell.rb (added)
+++ buildr/trunk/lib/buildr/groovy/shell.rb Tue Jun 23 00:01:58 2009
@@ -0,0 +1,33 @@
+require 'buildr/shell'
+
+module Buildr
+  module Groovy
+    class Shell
+      attr_reader :project
+      
+      class << self
+        def lang
+          :groovy
+        end
+      end
+      
+      def initialize(project)
+        @project = project
+      end
+      
+      def launch
+        # TODO  make this more generic!!
+        
+        cp = (project.compile.dependencies + 
Scalac.dependencies).join(File::PATH_SEPARATOR) +
+          project.path_to(:target, :classes)
+        
+        cmd_args += ' -classpath'
+        cmd_args += " '#{cp}'"
+        
+        system('groovysh' + cmd_args)
+      end
+    end
+  end
+end
+
+Buildr::ShellProviders << Buildr::Groovy::Shell


Reply via email to