You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by "Tommy C. Li" <to...@ucla.edu> on 2009/12/30 01:35:20 UTC

Preferred way of choosing scala version?

What's the preferred way in buildr of choosing which version of Scala to 
compile with?

I see a DEFAULT_VERSION variable in scala/compiler.rb, but am not sure 
how to override.

Tommy

Re: Preferred way of choosing scala version?

Posted by Alex Boisvert <al...@gmail.com>.
This issue is now tracked by
https://issues.apache.org/jira/browse/BUILDR-366 and I have a fix on my
machine so it shouldn't be long before it's committed.

alex


On Tue, Dec 29, 2009 at 5:54 PM, Alex Boisvert <al...@gmail.com>wrote:

> On Tue, Dec 29, 2009 at 4:35 PM, Tommy C. Li <to...@ucla.edu> wrote:
>
>> What's the preferred way in buildr of choosing which version of Scala to
>> compile with?
>>
>> I see a DEFAULT_VERSION variable in scala/compiler.rb, but am not sure how
>> to override.
>
>
> The easiest is to just set your SCALA_HOME to point to whichever Scala
> version you want to use.
>
> If you want to programmatically ensure a specific version, you would write:
>
> Buildr::Scala::Scalac::REQUIRES.library = '2.8.Beta1-RC6'
> Buildr::Scala::Scalac::REQUIRES.compiler = '2.8.Beta1-RC6'
>
> after require 'buildr/scala'.
>
> but due to a bug you currently also have to fiddle with the classpath :(
>
> Java.classpath.reject! { |c| c.to_s.index('scala') }
> Java.classpath << Buildr::Scala::Scalac::REQUIRES
>
> I'll fix this for Buildr 1.4.0.
>
> alex
>
>

Re: Preferred way of choosing scala version?

Posted by Alex Boisvert <al...@gmail.com>.
On Tue, Dec 29, 2009 at 4:35 PM, Tommy C. Li <to...@ucla.edu> wrote:

> What's the preferred way in buildr of choosing which version of Scala to
> compile with?
>
> I see a DEFAULT_VERSION variable in scala/compiler.rb, but am not sure how
> to override.


The easiest is to just set your SCALA_HOME to point to whichever Scala
version you want to use.

If you want to programmatically ensure a specific version, you would write:

Buildr::Scala::Scalac::REQUIRES.library = '2.8.Beta1-RC6'
Buildr::Scala::Scalac::REQUIRES.compiler = '2.8.Beta1-RC6'

after require 'buildr/scala'.

but due to a bug you currently also have to fiddle with the classpath :(

Java.classpath.reject! { |c| c.to_s.index('scala') }
Java.classpath << Buildr::Scala::Scalac::REQUIRES

I'll fix this for Buildr 1.4.0.

alex