commit | 588dc4ebf80510c09198bfa9d4e03c40491a7346 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Sat Apr 26 17:20:48 2014 +0100 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Sat Apr 26 17:20:48 2014 +0100 |
tree | 72ef29ab781c15381a52fb5472c6e3769aee14da | |
parent | c2f50a912e73acbdb9dc3562b63c56c613c27b4d [diff] |
Support for Scala classes organised in packages When a Scala script define classes within packages, the internal compiled files structure reflect the package structure as in Java. It is necessary then to navigate the tree and compose the full class name according to the directory structure in memory. Change-Id: Iae06b57e899aaf656c297c09bc63f1c4f47ae232
This plugin provides Scala runtime environment for Gerrit plugins in Scala.
To test this series must be applied on top of Gerrit master [1].
To build link this directory under Gerrit's tree plugins directory and run:
buck build plugins/scala-provider:scala-provider
The resulting artifact can be found under:
buck-out/gen/plugins/scala-provider/scala-provider.jar
A sample Scala hello world script is:
import com.google.gerrit.sshd._ import com.google.gerrit.extensions.annotations._ @Export("scala") class ScalaCommand extends SshCommand { override def run = stdout println "Hello from Scala!" }
Copy and past the above sample Scala fragment into the file $GERRIT_SITE/plugin/hello-1.0.scala.
The “hello” plugin version 1.0 will be automatically loaded into Gerrit and will provide a new SSH command “hello scala”.