You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by bo...@apache.org on 2010/04/05 03:41:38 UTC

svn commit: r930778 - in /buildr/trunk: CHANGELOG doc/languages.textile

Author: boisvert
Date: Mon Apr  5 01:41:38 2010
New Revision: 930778

URL: http://svn.apache.org/viewvc?rev=930778&view=rev
Log:
Update documentation regarding SCALA_HOME and Buildr.settings.build['scala.version']

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/doc/languages.textile

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=930778&r1=930777&r2=930778&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Mon Apr  5 01:41:38 2010
@@ -46,6 +46,10 @@
           ($HOME/buildr.rb is still loaded with deprecation warning)
 * Change: BUILDR-400 Don't forbid projects to use their own compiler after one has been guessed
 * Change: BUILDR-401 Don't set compiler to output warnings if verbose
+* Change: Buildr.settings.build['scala.version'] now overrides SCALA_HOME to
+          determine which Scala libraries used for compiling.  If both are
+          are provided and reference the same Scala version, then local
+          jars from SCALA_HOME are used.
 * Fixed:  BUILDR-208 ansi control characters are printed on Windows (Pepjin Van Eeckhoudt)
 * Fixed:  BUILDR-348 Buildr fails on windows with jruby and ODE 1.X
 * Fixed:  BUILDR-183 Can't define root artifact namespace outside of project

Modified: buildr/trunk/doc/languages.textile
URL: http://svn.apache.org/viewvc/buildr/trunk/doc/languages.textile?rev=930778&r1=930777&r2=930778&view=diff
==============================================================================
--- buildr/trunk/doc/languages.textile (original)
+++ buildr/trunk/doc/languages.textile Mon Apr  5 01:41:38 2010
@@ -170,43 +170,31 @@ Before using Scala, you must first @requ
 require 'buildr/scala'
 {% endhighlight %}
 
-By default, Buildr will attempt to use any version of Scala which is already
-installed on your system.  However, Buildr isn't *quite* smart enough to intuit
-such things on its own, so for most cases, it requires the @SCALA_HOME@
-environment variable to be set pointing to the root of the Scala installation
-(e.g. @/usr/local/scala-2.7.5.final@).  The only exception to this is if you have
-installed Scala via "MacPorts":http://www.macports.org/  Buildr will look in the
-@/opt/local/share/scala/@ directory *before* it uses the @SCALA_HOME@ envar.
-
-However, if @SCALA_HOME@ is not set, or if it points to an invalid Scala
-installation, then Buildr has a fallback option.  The Scala compiler and standard
-library are both available from the "Scala Tools repository":http://scala-tools.org/.
-If no other Scala installation can be found, Buildr will download the appropriate
-artifacts and use them instead of a full install.  The only drawback to this
-approach is the FSC compiler is *not* available when Scala has been downloaded
-in this fashion.
-
-When Scala is downloaded from the Maven2 repository, Buildr will attempt to use
-the very latest version (starting from version 2.7.5).  If you wish to override
-this default, you will need to make use of the @artifact_ns@ construct *before*
-you @require@ Scala support in your buildfile:
+By default, Buildr will attempt to use the latest stable release of Scala, which is currently Scala 2.7.7 as of April 2010.  Of course you can configure a specific version of Scala for your project by adding the following entry in @build.yaml@:
 
-{% highlight ruby %}
-artifact_ns['Buildr::Compiler::Scalac'].library = '2.7.5'
-
-require 'buildr/scala'
+{% highlight yaml %}
+scala.version: 2.8.0.Beta1  # Pick your version
 {% endhighlight %}
 
-This snippet tells Buildr to use exactly version 2.7.5 of Scala when it downloads
-the JARs from Scala-Tools, regardless of what the latest version may be.
+Or, you can do the same programmatically:
+
+{% highlight yaml %}
+# Must be placed before require 'buildr/scala'
+Buildr.settings.build['scala.version'] = "2.8.0.Beta1"
+{% endhighlight %}
 
-Regardless of how Scala has been obtained, you may determine the version in use
-by querying the @Scala.version@ attribute:
+You may also determine the version in use by querying the @Scala.version@ attribute:
 
 {% highlight ruby %}
-Scala.version       # => '2.7.5'
+Scala.version       # => '2.7.7'
 {% endhighlight %}
 
+Regardless of how the Scala version is determined, if you have the same Scala version installed on your system and the SCALA_HOME environment variable points to it, then your local installation will be used.   Otherwise, Buildr will download it from the "Scala Tools repository":http://scala-tools.org/ which is automatically enlisted when you @require@ Scala.  The only drawback if you don't have a local installation is the FSC compiler won't be available.
+
+p(tip). For Mac users, if you have installed Scala via "MacPorts":http://www.macports.org/  Buildr will look in the
+@/opt/local/share/scala/@ directory if you have not set @SCALA_HOME@.
+
+
 h3. Compiling Scala
 
 The Scala compiler looks for source files in the project's @src/main/scala@  directory, and defaults to compiling them into the @target/classes@ directory.  It looks for test cases in the project's @src/test/scala@ and defaults to  compile them into the @target/test/classes@ directory.