diff options
author | Christian Aistleitner <christian@quelltextlich.at> | 2020-05-29 16:41:01 +0200 |
---|---|---|
committer | Christian Aistleitner <christian@quelltextlich.at> | 2020-05-29 16:41:01 +0200 |
commit | 2d9a44d5f50696746b14df00025f68fb2613a92d (patch) | |
tree | c3cbccc787d5bb74297c9b3270fa3400866e41a7 | |
parent | 52ac1dacc728af2658b9c8cd1a48607956ee9939 (diff) |
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
-rw-r--r-- | tools/bzl/plugin.bzl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/bzl/plugin.bzl b/tools/bzl/plugin.bzl index ef2963e745..40a361346d 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 @@ def gerrit_plugin( "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/$@ .", ]), |