Allows the load Gerrit plugins implemented as Scala scripts

Clone this repo:
  1. c7b26e5 ScalaPluginProvider: Adjust to new constructor of ServerPlugin by Luca Milanesio · 5 weeks ago master
  2. 60607b0 Reformat all files with GJF by Luca Milanesio · 5 weeks ago stable-2.14 stable-2.15
  3. 50bfa50 Remove buck build by Paladox none · 1 year, 6 months ago v2.14 v2.15.3
  4. f39e2d4 Add support for Bazel in Gerrit tree build by Paladox none · 1 year, 6 months ago
  5. bf79f89 Use throw in catch block by Paladox none · 1 year, 6 months ago

Gerrit Scala Provider Plugin

This plugin provides Scala runtime environment for Gerrit plugins in Scala.

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”.