scalaConsole fails for Gradle 2.6

Hi,

I am running any of the examples under the 2.6 release of samples/scala/* using all of the stock build.gradle files for each of the samples.

For each scala sample , I tried running

gradle scalaConsole

and I get the output

paris mixedJavaAndScala % gradle scalaConsole
:compileJava UP-TO-DATE
:compileScala UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:scalaConsole
Error: Could not find or load main class scala.tools.nsc.MainGenericRunner
:scalaConsole FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:scalaConsole’.

Process ‘command ‘/usr/lib/jvm/java-7-openjdk-amd64/bin/java’’ finished with non-zero exit value 1

Seems to me that if you are going to have this code released, at least don’t expose / provide tasks to the user that are indeed broken or won’t ever work.

You’re right. We should remove this experimental, untested task.

The reason it fails in this way with the samples is a missing dependency. Adding this dependency to samples/scala/quickstart/build.gradle will at least get the scala console to run:

    compile 'org.scala-lang:scala-compiler:2.11.1'

Not sure if this question deserved a snarky response , but perhaps this dependency should get added to the samples’ build.gradle file instead of relying on newbies to read your minds when the tool doesn’t work as it should for things as basic as sample programs.

I verified that

dependencies {
compile ‘org.scala-lang:scala-library:2.11.1’
}

added to the samples makes them work and this bug can be closed.

Hey Jimi. I think you misread my response. I really do think that we should remove the scalaConsole task, since it doesn’t have any automated test coverage or documentation and it wasn’t ever finished properly.

Daz,

Please pardon my testiness as I was in a bad mood from something else. Your answer was just perfect and it solved my problem. Is there a community involvement part of this project that would allow these kinds of features to live on ? Is it like Github projects where people can submit pull requests ?

Cheers / Apologies,

-Jimi

Yep, Gradle is fully open-source project, hosted on GitHub. See http://gradle.org/contribute-to-gradle/ for more details.

I’m taking a look at this issue right now in source. I’ve found where the task is added and have removed it from the source. I’m in the process of testing it. Once it’s tested, I was going to push it up to my Github. Is there a JIRA task for this issue?

I just pushed up my commit to my Github and have submitted a pull request.