Allows the load Gerrit plugins implemented as Scala scripts

Clone this repo:
  1. 904df79 Adapt plugin scanner to the latest master avoiding Enumeration by Luca Milanesio · 9 weeks ago master
  2. 9a9304e Replace bazel-genfiles with bazel-bin in documentation by David Pursehouse · 6 years ago
  3. c7b26e5 ScalaPluginProvider: Adjust to new constructor of ServerPlugin by Luca Milanesio · 7 years ago v2.16
  4. 60607b0 Reformat all files with GJF by Luca Milanesio · 7 years ago stable-2.14 stable-2.15
  5. 50bfa50 Remove buck build by Paladox none · 8 years ago v2.14 v2.15.3

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