Skip to content

Loading…

Which scala version is used? Contradictory information reported at command line. #854

Merged
merged 2 commits into from

5 participants

@DanBurton

I edited project/Build.scala, setting Keys.scalaVersion := "2.10.1" . Now when I fire up play, it still tells me it is using ... Scala 2.10.0, but then scala-version will report 2.10.1. What is the meaning of this?

$play
[info] blahblah
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.1.0 (using Java 1.6.0_43 and Scala 2.10.0), http://www.playframework.org

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

[dev_portal] $ scala-version
[info] 2.10.1

@gissues:{"order":99.21875,"status":"inprogress"}

@huntc
Play Framework member

That does appear a little confusing. The Java version is picked up by calling System.getProperty("java.version") yet the Scala version is picked up via play.core.PlayVersion.scalaVersion (a constant that we define which represents the default version of Scala).

I shall look at changing the console output to pick up the actual Scala version being used at runtime.

@huntc huntc was assigned
@huntc huntc Changed the Play console message to report the actual version of Scal…
…a being used at runtime - to be consistent with the reporting of the Java runtime. Fixes issue #854
7519a4a
@huntc
Play Framework member

@DanBurton are you in a position to test out my pull request and see if my change works for you?

@DanBurton

@huntc Okay, I cloned the repo, and copy/pasted the change (yeah I'm a git newb like that..). It didn't do what I expected. Now I'm getting this:

       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.2-SNAPSHOT (using Java 1.6.0_43 and Scala 2.9.2), http://www.playframework.com

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

[test-scala-version] $ scala-version
[info] 2.10.1

Scala 2.9.2. Not sure where that came from.

@huntc
Play Framework member

The Scala version reported is the one that Play itself has as a runtime. This is consistent with the reporting if the Java version.

@huntc huntc closed this
@huntc huntc reopened this
@cppexpert

I'm on Play 2.1.1-RC2. I agree that this message is misleading.

@huntc
Play Framework member

The information now reported is something like:

play! 2.2-SNAPSHOT built with Scala 2.10.0 (running Java 1.7.0_12-ea), http://www.playframework.com

i.e. clarity to the meaning of the values being reported has been added.

@jroper can you please review/merge as appropriate?

@jroper jroper merged commit 3ebf599 into playframework:master
@cloudbees-pull-request-builder

play2-master-PRs #14 SUCCESS
This pull request looks good

@huntc huntc deleted the huntc:scala-version-runtime-report branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 15, 2013
  1. @huntc

    Changed the Play console message to report the actual version of Scal…

    huntc committed
    …a being used at runtime - to be consistent with the reporting of the Java runtime. Fixes issue #854
Commits on Apr 8, 2013
  1. @huntc
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 framework/src/console/src/main/scala/Console.scala
View
6 framework/src/console/src/main/scala/Console.scala
@@ -21,7 +21,11 @@ object Console {
|| __/|_|\____|\__ (_)
||_| |__/
|
- |""".stripMargin) + ("play! " + play.core.PlayVersion.current + " (using Java " + System.getProperty("java.version") + " and Scala " + play.core.PlayVersion.scalaVersion + "), http://www.playframework.com")
+ |""".stripMargin) +
+ ("play! " + play.core.PlayVersion.current +
+ " built with Scala " + play.core.PlayVersion.scalaVersion +
+ " (running Java " + System.getProperty("java.version") + ")," +
+ " http://www.playframework.com")
// -- Commands
Something went wrong with that request. Please try again.