commit | d656cfcc747ada9fe4133fe25e0510614dc45eae | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Tue Apr 29 18:14:19 2014 +0100 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Mon Jun 30 09:49:16 2014 +0100 |
tree | 7326aebf0d9c5fe464baba2bb4b4d0cefc67bd72 | |
parent | 30d1f701ef1ca8f525e5582d617523d496eb05f7 [diff] |
Serve static resources from directory-based Scala scripts When using Scala scripts inside a plugin directory, the requests to static/<some relative path> will return the static resources under the static subdirectory of the Scala script. This change allows to delivery a fully feature client + server plugin experience by leveraging HTTP/JS client UX with server-side Scala script controllers. ScalaPluginProvider interface aligned with the latest changes under review on Gerrit I1d07343 Change-Id: Ib6f026197556348c2b15cc29418da6cbf4b85618
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”.