Author: assaf
Date: Fri Jan 18 22:07:42 2008
New Revision: 613369
URL: http://svn.apache.org/viewvc?rev=613369&view=rev
Log:
Fixed darwin discovery in JRuby, isatty aliasing on trunk, and updated
documentation for using JRuby
Modified:
incubator/buildr/trunk/doc/pages/download.textile
incubator/buildr/trunk/doc/pages/index.textile
incubator/buildr/trunk/doc/pages/whats_new.textile
incubator/buildr/trunk/lib/core/application.rb
incubator/buildr/trunk/lib/core/help.rb
incubator/buildr/trunk/lib/java/jruby.rb
Modified: incubator/buildr/trunk/doc/pages/download.textile
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/pages/download.textile?rev=613369&r1=613368&r2=613369&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/pages/download.textile (original)
+++ incubator/buildr/trunk/doc/pages/download.textile Fri Jan 18 22:07:42 2008
@@ -1,37 +1,14 @@
h1. Download and Installation
-The current release of Buildr works with Ruby 1.8 and JRuby 1.1RC1. We do not
yet support Ruby 1.9.
-
-
-h2. JRuby (Java)
-
-If you don't already have JRuby 1.1RC1 or later installed, you can download it
-from the "JRuby site":http://dist.codehaus.org/jruby/.
-
-After uncompressing JRuby, make sure you set the @JAVA_HOME@ environment
-variable to point to your JDK distribution, and @JRUBY_HOME@ to point to the
-directory containing the uncompressed JRuby installation.
-
-Finally update your @PATH@ to include both JRuby and Java executables, so you
-can run JRuby with the command @[EMAIL PROTECTED]
-
-For Windows:
-
-{{{!sh
-> set PATH=%JRUBY_HOME%/bin;%JAVA_HOME%/bin;%PATH
-> jruby -S gem install buildr
-}}}
-
-And for Unix:
-
-{{{!sh
-$ export PATH=$JRUBY_HOME/bin:$JAVA_HOME/bin:$PATH
-$ jruby -S gem install buildr
-}}}
-
-Once installed, you will find the @buildr@ exectuable in the @JRUBY_HOME/bin@
directory.
+The current release of Buildr works with Ruby 1.8 and JRuby 1.1RC1. We do not
+yet support Ruby 1.9 yet.
+The installation instructions are slightly different for each operating system.
+If you are using Ruby, pick the one that best matches your operating system.
+If you are using JRuby, see the instructions for "JRuby":#jruby and also read
+about using "JRuby and Ruby side by side":#using_jruby_and_ruby.
+
h2. Linux, BSD, Cygwin
To get started you will need a recent version of Ruby, Ruby Gems and build
@@ -133,6 +110,86 @@
{{{!sh
> gem install buildr -v 1.3.0
}}}
+
+
+h2. JRuby
+
+If you don't already have JRuby 1.1RC1 or later installed, you can download it
+from the "JRuby site":http://dist.codehaus.org/jruby/.
+
+After uncompressing JRuby, make sure you set the @JAVA_HOME@ environment
+variable to point to your JDK distribution.
+
+Finally update your @PATH@ to include both JRuby and Java executables, so you
+can run JRuby with the command @[EMAIL PROTECTED]
+
+For Windows:
+
+{{{!sh
+> set JRUBY_HOME=<path to JRuby>
+> set PATH=%JRUBY_HOME%/bin;%JAVA_HOME%/bin;%PATH%
+> gem install buildr
+}}}
+
+And for Unix:
+
+{{{!sh
+$ export JRUBY_HOME=<path to JRuby>
+$ export PATH=$JRUBY_HOME/bin:$JAVA_HOME/bin:$PATH
+$ gem install buildr
+}}}
+
+Once installed, you will find the @buildr@ exectuable in the @JRUBY_HOME/bin@
+directory.
+
+To upgrade to a new version of Buildr:
+
+{{{!sh
+$ sudo gem update buildr
+}}}
+
+To install a specific version of Buildr:
+
+{{{!sh
+$ sudo gem install buildr -v 1.3.0
+}}}
+
+
+h2. Using JRuby and Ruby
+
+Ruby and JRuby maintain separate Gem repositories, and in fact install slightly
+different versions of the Buildr Gem (same functionality, different
+dependencies). If you want to use Buildr with both, you must install it
+separately for each one.
+
+If you installed JRuby but don't have Ruby installed on your machine, the @gem@
+command will install Buildr for JRuby, and the @buildr@ command will run Buildr
+using JRuby.
+
+Note that some operating systems, specifically OS/X and various flavors of
+Linux, come with Ruby pre-installed, you can check this out by running the
[EMAIL PROTECTED]@ command.
+
+You can use the @PATH@ environment variable to determine which one is used by
+default. The instructions above show you how to place JRuby first on the
[EMAIL PROTECTED]@, afterwhich you can install and use Buildr for JRuby.
+
+If you need to use both versions together, you can pick Ruby or JRuby and run
+the various commands using the @-S@ argument. For example, to install and run
+Buildr for JRuby, even though Ruby appears first on the @PATH@:
+
+{{{!
+$ jruby -S gem install buildr
+$ jruby -S buildr
+}}}
+
+To find out which version you are currently running:
+
+{{{!
+$ buildr help
+}}}
+
+When running on JRuby you will see @(JRuby)@ next to Buildr version number.
h2. Binaries and Source Code
Modified: incubator/buildr/trunk/doc/pages/index.textile
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/pages/index.textile?rev=613369&r1=613368&r2=613369&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/pages/index.textile (original)
+++ incubator/buildr/trunk/doc/pages/index.textile Fri Jan 18 22:07:42 2008
@@ -27,7 +27,21 @@
* Simple way to upgrade to new versions.
* Did we mention fast?
-*Disclaimer* Apache Buildr is an effort undergoing incubation at The Apache
+h4. Buildr 1.3
+
+* Building Scala projects
+* Running on JRuby
+* EAR packaging
+* New API for accessing Java libraries
+* Alternative source layouts,
+* More documentation
+* Other features and bug fixes.
+
+Check out "what's new in Buildr 1.3":whats_new.html.
+
+h4. Disclaimer
+
+Apache Buildr is an effort undergoing incubation at The Apache
Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is
required of all newly accepted projects until a further review indicates that
the infrastructure, communications, and decision making process have stabilized
Modified: incubator/buildr/trunk/doc/pages/whats_new.textile
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/pages/whats_new.textile?rev=613369&r1=613368&r2=613369&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/pages/whats_new.textile (original)
+++ incubator/buildr/trunk/doc/pages/whats_new.textile Fri Jan 18 22:07:42 2008
@@ -75,6 +75,15 @@
"Read more ...":packaging.html#packaging_ears
+h4. JRuby Support
+
+We now offer two versions of Buildr, one for Ruby and one for JRuby. They're
+exactly the same, except the Ruby version will also install RJB (Ruby Java
+Bridge), the JRuby version obviously can do well without it.
+
+"Read more ...":download.html#jruby
+
+
h4. New API for accessing Java libraries
Java classes are accessed as static methods on the @Java@ module, for example:
Modified: incubator/buildr/trunk/lib/core/application.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/core/application.rb?rev=613369&r1=613368&r2=613369&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/core/application.rb (original)
+++ incubator/buildr/trunk/lib/core/application.rb Fri Jan 18 22:07:42 2008
@@ -117,7 +117,7 @@
end
def usage()
- puts "Buildr #{Buildr::VERSION}"
+ puts "Buildr #{Buildr::VERSION} #{RUBY_PLATFORM[/java/] && '(JRuby)'}"
puts
puts "Usage:"
puts " buildr [-f buildfile] {options} targets..."
Modified: incubator/buildr/trunk/lib/core/help.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/core/help.rb?rev=613369&r1=613368&r2=613369&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/core/help.rb (original)
+++ incubator/buildr/trunk/lib/core/help.rb Fri Jan 18 22:07:42 2008
@@ -1,6 +1,66 @@
require "core/common"
require "core/project"
+module Buildr
+ module Help
+
+ class Topic
+
+ def initialize(content = nil, &proc)
+ @content, @proc = content, @proc
+ end
+
+ def content
+ @content ||= @proc.call if @proc
+ end
+
+ def content=(content)
+ @content = content
+ end
+
+ def match(against)
+ nil
+ end
+
+ end
+
+ class Main < Topic
+
+ def initialize
+ @texters = []
+ end
+
+ def content
+ @texters.each { |texter| texter.call }.join("\n")
+ end
+
+ def <<(&texter)
+ @texters << texter
+ end
+
+ end
+
+ class << self
+
+ def topics
+ @topics ||= { 'main'=>Main.new }
+ end
+
+ def topic(name)
+ topics[name]
+ end
+
+ def match(against)
+ topic = topics[against]
+ content = [topic && topic.content]
+ topics.inject(content) { |content, (name, topic)| topic.match(aginst)
}.compact
+ end
+
+ end
+
+ end
+end
+
task "help" do
# Greeater.
@@ -36,7 +96,7 @@
# Use this to enhance the help task, e.g. to print some important
information about your build,
# configuration options, build instructions, etc.
def help(&block)
- Rake.application["help"].enhance &block
+ Buildr.help.topics['main'] << block
end
end
Modified: incubator/buildr/trunk/lib/java/jruby.rb
URL:
http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/java/jruby.rb?rev=613369&r1=613368&r2=613369&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/java/jruby.rb (original)
+++ incubator/buildr/trunk/lib/java/jruby.rb Fri Jan 18 22:07:42 2008
@@ -1,4 +1,5 @@
require 'java'
+require 'rbconfig'
# Buildr runs along side a JVM, using either RJB or JRuby. The Java module
allows
@@ -65,7 +66,7 @@
$CLASSPATH << lib
end
end
- load_java_tools unless RUBY_PLATFORM =~ /darwin/i
+ load_java_tools unless Config::CONFIG['host_os'] =~ /darwin/i
@loaded = true
self
end
@@ -117,10 +118,10 @@
end
-# Misnamed in RC1.
+# Misnamed in RC1, but fixed before 1.1.
class IO #:nodoc:
alias :isatty :isatty?
-end
+end unless IO.public_instance_methods.include?('isatty')
module Buildr