Set Api version for plugin jars

Since we did not set the Api in the manifest per default, most built
plugins do not expose the Api version they got against. Yet this
version would help with upgrades as it would help to assure the
correct plugins are in place. This holds especially true, where a
single commit of a plugin gets used to build for different Api
versions (E.g.: commit-message-length-validator).

The Api version in the jar is currently only shown in a plugin's
about page.

Change-Id: I0a786a911474a7024a63227f6d28be664c88af18
diff --git a/tools/bzl/plugin.bzl b/tools/bzl/plugin.bzl
index ef2963e..40a3613 100644
--- a/tools/bzl/plugin.bzl
+++ b/tools/bzl/plugin.bzl
@@ -1,5 +1,6 @@
 load("@rules_java//java:defs.bzl", "java_binary", "java_library")
 load("//tools/bzl:genrule2.bzl", "genrule2")
+load("//:version.bzl", "GERRIT_VERSION")
 load(
     "//tools/bzl:gwt.bzl",
     "GWT_COMPILER_ARGS",
@@ -103,7 +104,7 @@
             "GEN_VERSION=$$(cat bazel-out/stable-status.txt | grep -w STABLE_BUILD_%s_LABEL | cut -d ' ' -f 2)" % dir_name.upper(),
             "cd $$TMP",
             "unzip -q $$ROOT/$<",
-            "echo \"Implementation-Version: $$GEN_VERSION\n$$(cat META-INF/MANIFEST.MF)\" > META-INF/MANIFEST.MF",
+            "echo \"Implementation-Version: $$GEN_VERSION\nGerrit-ApiVersion: " + GERRIT_VERSION + "\n$$(cat META-INF/MANIFEST.MF)\" > META-INF/MANIFEST.MF",
             "find . -exec touch '{}' ';'",
             "zip -Xqr $$ROOT/$@ .",
         ]),