Move Api version for plugin manifests to non-stamped binary

While the Api version is actually kind of a stamp, adding it in the
stamping phase makes the stamping code harder to read. As the Api
version can be determined early and does not rely on the workspace,
we bring it to the non-stamped binary, as `Gerrit-ApiType' is there
already as well.

Change-Id: I4af551c41f66580c4497027b6261b9667e609a88
diff --git a/tools/bzl/plugin.bzl b/tools/bzl/plugin.bzl
index 40a3613..92f9309 100644
--- a/tools/bzl/plugin.bzl
+++ b/tools/bzl/plugin.bzl
@@ -53,7 +53,10 @@
 
     java_binary(
         name = "%s__non_stamped" % name,
-        deploy_manifest_lines = manifest_entries + ["Gerrit-ApiType: plugin"],
+        deploy_manifest_lines = manifest_entries + [
+            "Gerrit-ApiType: plugin",
+            "Gerrit-ApiVersion: " + GERRIT_VERSION,
+        ],
         main_class = "Dummy",
         runtime_deps = [
             ":%s__plugin" % name,
@@ -104,7 +107,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\nGerrit-ApiVersion: " + GERRIT_VERSION + "\n$$(cat META-INF/MANIFEST.MF)\" > META-INF/MANIFEST.MF",
+            "echo \"Implementation-Version: $$GEN_VERSION\n$$(cat META-INF/MANIFEST.MF)\" > META-INF/MANIFEST.MF",
             "find . -exec touch '{}' ';'",
             "zip -Xqr $$ROOT/$@ .",
         ]),