Allows the load Gerrit plugins implemented as Scala scripts

Clone this repo:
  1. 9a9304e Replace bazel-genfiles with bazel-bin in documentation by David Pursehouse · 5 years ago master
  2. c7b26e5 ScalaPluginProvider: Adjust to new constructor of ServerPlugin by Luca Milanesio · 6 years ago v2.16
  3. 60607b0 Reformat all files with GJF by Luca Milanesio · 6 years ago stable-2.14 stable-2.15
  4. 50bfa50 Remove buck build by Paladox none · 8 years ago v2.14 v2.15.3
  5. f39e2d4 Add support for Bazel in Gerrit tree build by Paladox none · 8 years 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”.