Awesome! Unfortunately I’ve encountered the following when trying to upgrade from v1.2
New scalaConsole task
Please document that this task was added, as it conflicted with our custom one. It might be nice if the gradle task included the classes (not just main classes). The console appears to suffer from the same problems that our custom task had:
- The Scala REPL does not run well in Gradle daemon mode - Command completion and history do not work properly - The console must be reset due to a jline bug - Best to use quiet mode for a clean console.
I’d advise using the following when running the scalaConsole task: $ gradle -q scalaConsole --no-daemon; reset
Zinc Compiler Options
The Zink incremental Scala compiler does not appear to support specifying a maximum file name length for generated classes. We enable this option for developer machines, some of which are running on encrypted ext4 partitions. Due to a bug, the maximum file name is 143 characters.
This becomes an issue when using the fatJar when packaging a deployment jar. We are moving to the application plugin’s zip for server deployments due to being faster and a cleaner approach, but still use fatJar for a client Swing application. I’m hopeful that this will not be a problem as we do not use Scala for this application yet, are migrating all deployment processes to be driven through Jenkins, and replacing this client application with a webapp.
The following configuration fails when using Zinc. It would be helpful if the user guide linked to the Zinc compiler options as they appear to differ from scalac.
scalaCompileOptions.additionalParameters = ['-Xmax-classfile-name 127']
19:04:07.337 [Daemon] INFO
o.g.a.i.t.s.jdk6.ZincScalaCompiler - Compiling 4 Scala sources to /home/ben/projects/AMP/infra/libraries/testing/build/classes/main...
19:04:07.351 [Daemon] INFO
o.g.a.i.t.s.jdk6.ZincScalaCompiler - bad option: '-Xmax-classfile-name 127'
19:04:07.356 [Daemon] INFO
o.g.a.i.t.s.jdk6.ZincScalaCompiler - Compilation failed (CompilerInterface)
:infra:libraries:testing:compileScala FAILED
Zinc Compiler Output
The output is currently very verbose. This may be configured for development but please prune it down in the final release.
Scala compilation in external process
The ‘fork’ and ‘forkOptions’ does not appear to be available on the ScalaCompiler.
$ gradle clean build
FAILURE: Build failed with an exception.
* Where:
Script '/home/ben/projects/AMP/gradle/scala.gradle' line: 48
* What went wrong:
A problem occurred evaluating script.
> No such property: fork for class: org.gradle.api.tasks.scala.ScalaCompile
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
PermGen Scala compilation in external process
Performing a ‘gradle clean build’ results in PermGen space failure. An incremental build afterwards works.
I have not determined a work around yet for a clean build. I increased the ‘test.jvmArgs’ from 256m to 512m but that didn’t appear to help…