Login required
Download

Scala Plugin

(2)
Author(s): Vaclav Pech
Current Release: 0.5
Grails Version: 1.1 > *
Tags integration

Installation

Type this command in your Grail application directory

$> grails install-plugin scala

or if you have a plugin archive locally.

$> grails install-plugin /path/to/grails-scala-0.3.zip

Dependencies

The scala plugin has no other dependencies. If it cannot run out-of-the box, please report in the Grails user group. The SCALA_HOME environment variable pointing to a valid Scala distribution can be set to instruct the Scala plugin to use the specific Scala distribution for compilation in place of the budled one.

This is a Scala plugin for Grails. This plugin allows you to compile Scala sources in the /src/java and /src/scala folders of your grails application.

The latest plugin version is 0.5

Getting Started

This plugin runs the scala compiler on all sources in /src/java and /src/scala folders before grails invokes the groovyc compiler. Currently the scala code must not contain dependencies on groovy code or dependencies on java code outside the /src/java and /src/scala folders.

The scala plugin comes with a scala distribution bundled, however, it can use any scala distribution specified by the SCALA_HOME environment variable instead. If SCALA_HOME is set the scala plugin will use it instead of the bundled distribution unless instructed by scala.useBundledLibs=true property set in BuildConfig.groovy file.

After compilation the scala plugin will copy (with overwrite=false) Scala runtime libraries from the actually used Scala distribution into your project's lib folder, unless instructed not to by scala.no.jar.copy=true property set in BuildConfig.groovy file.

Configuration

The BuildConfig.groovy file in /grails-app/conf/ folder of your application can be used to configure behavior of the scala plugin.
scala.src.encoding='UTF-8'  //Scala src file encoding, UTF-8 by default

//Don't copy Scala runtime libraries to project's lib folder, //false by default (meaning do copy by default)

scala.no.jar.copy=false

//Ignore SCALA_HOME and use bundled Scala distribution, //false by default (meaning use SCALA_HOME if set)

scala.useBundledLibs=false

Version History

v. 0,3

  • Polish and documentation
v. 0.2
  • Bundled Scala 2.7.3 distribution
  • Ability to switch between SCALA_HOME and the bundled Scala distribution
  • Optional automatic copy of Scala run-time libs into the project's lib folder after compilation
v. 0.1
  • initial