Author: djspiewak
Date: Tue Jun 23 00:06:17 2009
New Revision: 787482
URL: http://svn.apache.org/viewvc?rev=787482&view=rev
Log:
Factored JavaRebel functionality into a separate module
Modified:
buildr/trunk/lib/buildr/scala/shell.rb
buildr/trunk/lib/buildr/shell.rb
Modified: buildr/trunk/lib/buildr/scala/shell.rb
URL:
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/scala/shell.rb?rev=787482&r1=787481&r2=787482&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/scala/shell.rb (original)
+++ buildr/trunk/lib/buildr/scala/shell.rb Tue Jun 23 00:06:17 2009
@@ -4,6 +4,8 @@
module Buildr
module Scala
class ScalaShell < Buildr::Shell::Base
+ include Buildr::Shell::JavaRebel
+
SUFFIX = if Util.win_os? then '.bat' else '' end
class << self
@@ -34,43 +36,6 @@
:java_args => rebel_args
}
end
-
- private
-
- def rebel_home
- unless @rebel_home
- @rebel_home = ENV['REBEL_HOME'] or ENV['JAVA_REBEL'] or
ENV['JAVAREBEL'] or ENV['JAVAREBEL_HOME']
-
- if @rebel_home and File.directory? @rebel_home
- @rebel_home += File::SEPARATOR + 'javarebel.jar'
- end
- end
-
- if @rebel_home and File.exists? @rebel_home
- @rebel_home
- else
- nil
- end
- end
-
- def rebel_args
- if rebel_home
- [
- '-noverify',
- "-javaagent:#{rebel_home}"
- ]
- else
- []
- end
- end
-
- def rebel_props(project)
- if rebel_home
- { 'rebel.dirs' => project.path_to(:target, :classes) }
- else
- {}
- end
- end
end
end
end
Modified: buildr/trunk/lib/buildr/shell.rb
URL:
http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/shell.rb?rev=787482&r1=787481&r2=787482&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/shell.rb (original)
+++ buildr/trunk/lib/buildr/shell.rb Tue Jun 23 00:06:17 2009
@@ -53,6 +53,43 @@
fail 'Not implemented'
end
end
+
+ module JavaRebel
+ def rebel_home
+ unless @rebel_home
+ @rebel_home = ENV['REBEL_HOME'] or ENV['JAVA_REBEL'] or
ENV['JAVAREBEL'] or ENV['JAVAREBEL_HOME']
+
+ if @rebel_home and File.directory? @rebel_home
+ @rebel_home += File::SEPARATOR + 'javarebel.jar'
+ end
+ end
+
+ if @rebel_home and File.exists? @rebel_home
+ @rebel_home
+ else
+ nil
+ end
+ end
+
+ def rebel_args
+ if rebel_home
+ [
+ '-noverify',
+ "-javaagent:#{rebel_home}"
+ ]
+ else
+ []
+ end
+ end
+
+ def rebel_props(project)
+ if rebel_home
+ { 'rebel.dirs' => project.path_to(:target, :classes) }
+ else
+ {}
+ end
+ end
+ end
end
module ShellExtension