Bazel: Stamp git version for core plugins
Bazel: Stamp git version for core plugins

Extend workspace status script to scan plugins directory and generate
git version for each of them in stable-status.txt file. This can be
used in plugin build rule to include this as plugin version info.

Given that there is no way to dynamically merge manifest file content
in Bazel[1] in java_binary rule, we have two options: either manipulate
the plugin artifact file by appending the generated plugin version in
post java_binary step in the META-INF/MANIFEST.MF file, or add VERSION
resource file in the plugin and route reading plugin version to this
file.

TEST PLAN:

  $ bazel build :gen_version
  $ cat bazel-out/stable-status.txt
  STABLE_BUILD_COMMIT-MESSAGE-LENGTH-VALIDATOR_LABEL v2.13.1-2-g76b9115
  STABLE_BUILD_COOKBOOK-PLUGIN_LABEL v2.13.2-12-g0162fc1
  STABLE_BUILD_DOWNLOAD-COMMANDS_LABEL v2.13.1-4-g6326db6
  STABLE_BUILD_GERRIT_LABEL v2.13.2-1329-g7c5917b-dirty
  [...]

[1] https://github.com/bazelbuild/bazel/issues/2009

Change-Id: Ie900617e918246ebb54080517161021f3030fdab

qtproject/qtqa-gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,WANdisco/gerrit,gerrit-review/gerrit,WANdisco/gerrit,qtproject/qtqa-gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,WANdisco/gerrit,WANdisco/gerrit,qtproject/qtqa-gerrit,gerrit-review/gerrit,WANdisco/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,qtproject/qtqa-gerrit,gerrit-review/gerrit,gerrit-review/gerrit,gerrit-review/gerrit,gerrit-review/gerrit,GerritCodeReview/gerrit,WANdisco/gerrit,GerritCodeReview/gerrit,WANdisco/gerrit,gerrit-review/gerrit