Merge branch 'stable-2.14' into stable-2.15

* stable-2.14:
  Adjust names of prolog dependencies

Change-Id: I84a725069ed1afd1bde28c398664e85bc77fd00c
diff --git a/gerrit_api.bzl b/gerrit_api.bzl
index 1304e9b..fd72e92 100644
--- a/gerrit_api.bzl
+++ b/gerrit_api.bzl
@@ -5,7 +5,7 @@
 gerrit_api is rule for fetching Gerrit plugin API using Bazel.
 """
 
-VER = "2.14.8"
+VER = "2.15.2"
 
 def gerrit_api():
   bouncycastle_repos()
@@ -13,18 +13,18 @@
   maven_jar(
     name = 'gerrit_plugin_api',
     artifact = 'com.google.gerrit:gerrit-plugin-api:' + VER,
-    sha1 = '80855a1736a5e28c6d86fb8ccfeb6b2642bf5133',
+    sha1 = '118179c5577e6d6d67a6347694eedc8214d0e44b',
   )
   maven_jar(
     name = 'gerrit_plugin_gwtui',
     artifact = 'com.google.gerrit:gerrit-plugin-gwtui:' + VER,
-    sha1 = '03e3e95205562a8ed6c8b348276c5eaf84cf1a23',
+    sha1 = 'bc1b74ca1cdef78ee0533c853adb3a399682a648',
     exclude = ['com/google/gwt/*'],
   )
   maven_jar(
     name = 'gerrit_acceptance_framework',
     artifact = 'com.google.gerrit:gerrit-acceptance-framework:' + VER,
-    sha1 = '4b4f9f13448aa3211cb32642f08018675889e363',
+    sha1 = '5c2dee7b74812cd78c054fc5b933778e5daaf7ed',
   )
   native.bind(
     name = 'gerrit-plugin-api',
diff --git a/gerrit_api_maven_local.bzl b/gerrit_api_maven_local.bzl
index ccaa7fe..32f0db7 100644
--- a/gerrit_api_maven_local.bzl
+++ b/gerrit_api_maven_local.bzl
@@ -5,7 +5,7 @@
 gerrit_api is rule for fetching Gerrit plugin API using Bazel.
 """
 
-VER = "2.14.9-SNAPSHOT"
+VER = "2.15.2-SNAPSHOT"
 
 def gerrit_api_maven_local():
   bouncycastle_repos()
diff --git a/gerrit_plugin.bzl b/gerrit_plugin.bzl
index c75a5ab..a0b425f 100644
--- a/gerrit_plugin.bzl
+++ b/gerrit_plugin.bzl
@@ -27,6 +27,7 @@
     gwt_module = [],
     resources = [],
     manifest_entries = [],
+    dir_name = None,
     target_suffix = "",
     **kwargs):
 
@@ -36,6 +37,9 @@
     static_jars = [':%s-static' % name]
     gwt_deps = GWT_PLUGIN_DEPS_NEVERLINK
 
+  if not dir_name:
+    dir_name = name
+
   native.java_library(
     name = name + '__plugin',
     srcs = srcs,
@@ -84,6 +88,13 @@
       jvm_args = GWT_JVM_ARGS,
     )
 
+  native.genrule(
+    name = name + "__gen_stamp_info",
+    stamp = 1,
+    cmd = "cat bazel-out/stable-status.txt | grep \"^STABLE_BUILD_%s_LABEL\" | awk '{print $$NF}' > $@" % dir_name.upper(),
+    outs = ["%s__gen_stamp_info.txt" % name],
+  )
+
   # TODO(davido): Remove manual merge of manifest file when this feature
   # request is implemented: https://github.com/bazelbuild/bazel/issues/2009
   genrule2(
@@ -91,11 +102,12 @@
     stamp = 1,
     srcs = ['%s__non_stamped_deploy.jar' % name],
     cmd = " && ".join([
-      "GEN_VERSION=$$(cat bazel-out/stable-status.txt | grep %s | cut -d ' ' -f 2)" % name.upper(),
+      "GEN_VERSION=$$(cat $(location :%s__gen_stamp_info))" % name,
       "cd $$TMP",
       "unzip -q $$ROOT/$<",
       "echo \"Implementation-Version: $$GEN_VERSION\n$$(cat META-INF/MANIFEST.MF)\" > META-INF/MANIFEST.MF",
       "zip -qr $$ROOT/$@ ."]),
+    tools = [':%s__gen_stamp_info' % name],
     outs = ['%s%s.jar' % (name, target_suffix)],
     visibility = ['//visibility:public'],
   )